Doctrine 1
  1. Doctrine 1
  2. DC-1038

Missing Foreign Key Constraint in SQL

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      I have the problem, that a foreign key constraint is not created in the SQL schema. This occurs, when the primary key is not the column 'id'.

      Here is an example:

      User:
      columns:
      username:
      type: string(30)
      notnull: false
      email:
      type: string(80)
      notnull: true
      gender:
      type: enum
      values: [0,m,f]
      notblank: true
      notnull: true
      birthday:
      type: date

      Address:
      columns:
      user_id:
      type: integer(4)
      unsigned: 1
      notnull: true
      primary: true
      some_data:
      type: string(100)
      relations:
      User:
      local: user_id
      foreign: id
      foreignType: one

      The foreign key from contacts to users is not created in der SQL schema. But if I delete the attribute 'primary' at the column 'user_id' (and a primary key 'id' will generated), everything is okay.

      Can you help me please?

      With kind regards
      Stephan

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Stephan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: