Restore SqlitePlatform#supportsForeignKeyConstraints (no lies!) #242

Merged
merged 3 commits into from Jan 7, 2013

Conversation

Projects
None yet
5 participants
Owner

Ocramius commented Jan 2, 2013

This PR applies a hotfix for broken behavior introduced in DBAL-370 (doctrine/dbal#220).

Basically, the SQLite platform lies about its ability to support foreign key constraint generation. This leads to various failures in the ORM schema tools.

In fact, the platform itself doesn't even generate the foreign key generation SQL, and instead throws a Doctrine\DBAL\DBALException (similar to "not implemented" in this particular case).
The PR introduces a failing test that exposes the (currently) missing feature in the platform and restores the return value of Doctrine\DBAL\Platforms\SqlitePlatform#supportsForeignKeyConstraints().

While SQLite 3.6.19 introduces support for Foreign keys, the DBAL platform still doesn't have it.

Ping @lsmith77 @hason

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-1232

Contributor

hason commented Jan 2, 2013

👍 The #220 was WIP. I will continue on it.

Owner

Ocramius commented Jan 2, 2013

@hason I was just panicking because my CI environment was going bananas ;)

beberlei added a commit that referenced this pull request Jan 7, 2013

Merge pull request #242 from Ocramius/hotfix/DBAL-370
Restore SqlitePlatform#supportsForeignKeyConstraints (no lies!)

@beberlei beberlei merged commit e65517e into doctrine:master Jan 7, 2013

1 check passed

default The Travis build passed
Details

zorang commented Apr 9, 2013

New doctrine 2.3.3 version is available, and I waited a lot for that because i hoped that when create SQLite schema that FK-s will be created also! But not! FK-s are still not generated! Can anyone tell me why?! I know that it was implemented last year (2012) in some branch... What happened?! Its removed or what?! Its not supported in new 2.3.3 doctrine?!?!

Zoran

GawainLynch added a commit to GawainLynch/bolt that referenced this pull request Jul 17, 2016

Remove the Foreign Key Constraint properties from diffs when supports…
…ForeignKeyConstraints() is false

See:
   * doctrine/dbal#242
   *      \Doctrine\DBAL\Platforms\SqlitePlatform::supportsForeignKeyConstraints
   *      https://www.sqlite.org/foreignkeys.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment