Fix unnamed FK constraints parse for Sqlite
| Q | A |
|---|---|
| Type | bug |
| Fixed issues | n/a |
Summary
https://github.com/doctrine/dbal/pull/5490 must be merged first, this PR depends on it
fixes https://dbfiddle.uk/?rdbms=sqlite_3.27&fiddle=4651f0cc575a2f2df11856003d2e0af8
$i as a fallback name in
https://github.com/doctrine/dbal/blob/d8fdd45b3a1e6b8d5eb9fa5a565c69d8de2cfda8/src/Schema/SqliteSchemaManager.php#L647
is wrong, as Sqlite constraint name cannot start with a number.
Empty string ('') as a fallback name must be used, so CONSTRAINT <numerical_name> FOREIGN KEY... is not generated for CREATE TABLE
https://www.sqlite.org/syntax/table-constraint.html
Empty string (
'') as a fallback name must be used, soCONSTRAINT <numerical_name> FOREIGN KEY...is not generated forCREATE TABLE
Please make sure the fix works when a table contains multiple unnamed foreign keys:
https://github.com/doctrine/dbal/blob/3ae5312bbd0b5fe271e90ca8d957038d14e1c840/src/Schema/SqliteSchemaManager.php#L446-L447
Please note this PR requires https://github.com/doctrine/dbal/pull/5490 for the test, let's resolve/merge that PR first.
Closing as it's most likely no longer relevant.