Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Postgres SET NULL, SET DEFAULT, and NO ACTION foreign key detection in the PostgresSQLSchema Manager #18

Merged
merged 1 commit into from
Jul 12, 2011

Conversation

richardfullmer
Copy link

Previous regex was incorrectly parsing these values and would only pull the first word, causing DBAL to php fatal error later when it cannot match "SET" to "SET NULL"

…T NULL", "NO ACTION", and "SET DEFAULT" foreign key update and delete definitions.
@beberlei
Copy link
Member

Can you give some examples in the comments? I could write an additional test then.

@richardfullmer
Copy link
Author

From our implementation

$tableForeignKey['conname'] = 'order_product_type_fkey';
$tableForeignKey['condef'] = 'FOREIGN KEY (product_type) REFERENCES product_types(id) ON UPDATE CASCADE ON DELETE SET NULL';

$fkey = $pgSchemaManager->_getPortableTableForeignKeyDefinition($tableForeignKey);

expect

$fkey->onDelete() == 'SET NULL';   // (previously $fkey->onDelete() would return 'SET')  
$fkey->onUpdate() == 'CASCADE';

guilhermeblanco added a commit that referenced this pull request Jul 12, 2011
Support for Postgres SET NULL, SET DEFAULT, and NO ACTION foreign key detection in the PostgresSQLSchema Manager
@guilhermeblanco guilhermeblanco merged commit 2434d95 into doctrine:master Jul 12, 2011
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants