Skip to content

Loading…

DBAL-147: PostgreSqlSchemaManager fails to set foreign key onDelete/Update option properly if table has 'SET NULL' or 'SET DEFAULT' foreign key constraints #1302

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user phekmat:

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.

@doctrinebot

Comment created by kmdm:

Seems to be fixed in:-

208f995

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

@doctrinebot

Comment created by @beberlei:

Fixed and merged for 2.1.2

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.1.2 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.