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

        Stephan created issue -
        Guilherme Blanco made changes -
        Field Original Value New Value
        Affects Version/s 1.2.4 [ 10063 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-1038, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated: