Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-147

PostgreSqlSchemaManager fails to set foreign key onDelete/Update option properly if table has 'SET NULL' or 'SET DEFAULT' foreign key constraints

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.2
    • Component/s: Schema Managers
    • Labels:
      None

      Description

      This table structure:
      CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY(id));
      CREATE TABLE t2 (id INT NOT NULL, fk_id INT DEFAULT NULL);
      ALTER TABLE t2 ADD FOREIGN KEY (fk_id) REFERENCES t1(id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE;

      will cause the listTableForeignKeys to produce incorrect results for the onDelete/Update constraints (the 'DEFAULT' or 'NULL' in 'SET DEFAULT' or 'SET NULL' respectively gets cut off).

      This looks to be fixed in the main branch.

        Activity

        Payam Hekmat created issue -
        Hide
        Kenny Millington added a comment -

        Seems to be fixed in:-

        https://github.com/doctrine/dbal/commit/208f995607a544f9606c83d36752a9fd96ed9e64

        Would definitely be nice to have that ported to the 2.1.x branch.

        Show
        Kenny Millington added a comment - Seems to be fixed in:- https://github.com/doctrine/dbal/commit/208f995607a544f9606c83d36752a9fd96ed9e64 Would definitely be nice to have that ported to the 2.1.x branch.
        Hide
        Benjamin Eberlei added a comment -

        Fixed and merged for 2.1.2

        Show
        Benjamin Eberlei added a comment - Fixed and merged for 2.1.2
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.1.2 [ 10160 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12922 ] jira-feedback2 [ 17741 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17741 ] jira-feedback3 [ 20096 ]

        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=DBAL-147, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Payam Hekmat
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: