mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[Bug] SchemaValidator - Sqlite #5540
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @benito103e on GitHub (May 15, 2017).
Originally assigned to: @lcobucci on GitHub.
Hello,
When using pdo_sqlite driver, if the schema contains Foreign keys (ManyToOne join columns on my case) the schema validator fails :
@relte commented on GitHub (Nov 19, 2017):
In my case it's many-to-many relationship and each time I execute
doctrine:schema:update --forcethe output of the dump slightly changes.Before update:
After update:
As you can see only the order of dropping and creating indexes has changed.
Does anyone have any idea why is that?
If it helps, here is the mapping:
@lcobucci commented on GitHub (Nov 24, 2017):
@benito103e @Tykzz the schema is compared using DBAL, which version of
doctrine/dbaldo you have installed?Could you try to send a failing functional test on DBAL so that we can investigate what's happening (or at least create the an issue there)?
@benito103e commented on GitHub (Nov 27, 2017):
@lcobucci I use "doctrine/dbal" v2.5.12 with a Sqlite database.
Let's see how it goes with any entities that have a oneToMany relation :
And the result :
I can force an update, the result stay the same.
@lcobucci commented on GitHub (Nov 27, 2017):
DBAL 2.5.x is not actively maintained (only security issues gets backported), so try to upgrade to 2.6. If you don't manage to solve it please send the failing functional test on DBAL.
@lcobucci commented on GitHub (Nov 27, 2017):
You can use these tests as example:
954ce2e82c/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php (L1206-L1336)@lcobucci commented on GitHub (Nov 27, 2017):
I'll close this issue because it seems to be related to DBAL rather than the ORM. Please reopen it if you feel the need of further discussion.
@benito103e commented on GitHub (Nov 27, 2017):
@lcobucci thanks, dbal 2.6 is only for PHP 7.1 so I won't be able to update.
@relte commented on GitHub (Dec 1, 2017):
@lcobucci
I was using 2.6.2, I've updated to 2.6.3 but nothing has changed.
Here is the test, not sure if done right:
Now I'm wondering, shouldn't the ORM mapping cause creating foreign keys on the
projects_tagstable?The version of
doctrine/ormthat I use is 2.5.12.