Skip to content
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

Disable foreign key checks on purge for all MySQL versions #272

Open
wants to merge 1 commit into
base: 1.5.x
Choose a base branch
from

Conversation

robertfausk
Copy link

... 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 doctrine/dbal#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.

... 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
@robertfausk
Copy link
Author

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

At least nightly passed 😯

@theofidry
Copy link
Contributor

theofidry commented Oct 30, 2017

@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.

@jopais
Copy link

jopais commented Mar 19, 2020

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

@ilya-realforce
Copy link

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

Base automatically changed from master to 1.5.x January 23, 2021 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support truncating tables with foreign keys
4 participants