data-fixtures icon indicating copy to clipboard operation
data-fixtures copied to clipboard

Disable foreign key checks on purge for all MySQL versions

Open robertfausk opened this issue 6 years ago • 4 comments

... when purge mode is truncate

  • add test for change of foreign key check when using MySQL
  • add test for not set foreign key check when using SQLite

As statet in https://github.com/doctrine/dbal/pull/2620 doctrine/dbal is not responsible for this ("third party code has to built its own implementation around this because it is highly use-case specific"). So I give it a try to finish this long term never ending story.

Closes (stale?) PR #127 and fixes #113.

robertfausk avatar Oct 30 '17 14:10 robertfausk

Määähhh. Build currently fails because of pecl installation of mongodb. Also see #271.

At least nightly passed :hushed:

robertfausk avatar Oct 30 '17 14:10 robertfausk

@ocramius I know we already talked about that and at that time you were not in favour of that choice.

Maybe you changed your opinion since then, but I still think this should be done here. We are in the context of fixtures were truncating/deleting some tables doesn't make sense for the application.

We can always argue that the user can do that on his side (and that's what they end up doing), but it's silly to push that extra step to the user when 90% if not more needs it and the other 10% probably don't care.

On the same token, a recurrent request is to not truncate read-only tables. I have more mixed feeling about this but maybe this is actually a good idea and should be handled by the purger as well.

theofidry avatar Oct 30 '17 14:10 theofidry

I think this is an important change. Can you look at it again?

jopais avatar Mar 19 '20 02:03 jopais

Any update on this? I think it's straight-up ORMPurger's responsibility to purge DB even if there're foreign keys.

ilya-realforce avatar Aug 31 '20 06:08 ilya-realforce