-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: pass join column options to FK #11499
base: 3.3.x
Are you sure you want to change the base?
Conversation
fa25d4b
to
cc2b82f
Compare
Thank you. Can you please add a functional test that actually creates such a foreign key? |
e882b6d
to
f68b5e3
Compare
No, your test compares the generated SQL. But that SQL still does not hit a database. |
@derrabus If I understood, should I add the test \Doctrine\Tests\ORM\Functional\SchemaTool\PostgreSqlSchemaToolTest here? |
Sounds about right to me. 🙂 |
6fcc563
to
21f5d1b
Compare
21f5d1b
to
6dfe0f3
Compare
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Thanks, dear bot. This is on me. I'll try to conduct a review soon'ish. 🤞 |
@@ -712,6 +713,10 @@ private function gatherRelationJoinColumns( | |||
$uniqueConstraints[] = ['columns' => [$quotedColumnName]]; | |||
} | |||
|
|||
if ($joinColumn->options) { | |||
$fkOptions = array_merge($fkOptions, $joinColumn->options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the correct behavior if key collision occurs? Keep $fkOptions
or overwrite by $joinColumn-options
?
https://www.amitmerchant.com/two-ways-to-merge-arrays-in-php/#gotchas
Summary
Pass options to FK because of \Doctrine\DBAL\Platforms\PostgreSQLPlatform::getAdvancedForeignKeyOptionsSQL
How to use