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

Allow to disable foreign keys #63

Closed
theofidry opened this issue Oct 30, 2017 · 4 comments
Closed

Allow to disable foreign keys #63

theofidry opened this issue Oct 30, 2017 · 4 comments

Comments

@theofidry
Copy link
Owner

From #32, we could add it to the Purge in the purge() method to get access to the connection and disable the foreign key checks before running the actual purge.

As this may not be the desirable default behaviour, we could add an option in the config passed to the purger factory.

/cc @robertfausk

@robertfausk
Copy link

I just created a PR in doctrine/data-fixtures doctrine/data-fixtures#272.

If it is not going to be merged then I will provide a PR for this in AliceDataFixtures.

@theofidry
Copy link
Owner Author

@robertfausk maybe a better idea would be to completely ditch the DataFixtures purge and have our own here. As we would disable the foreign key check, it would also be much simpler as there is no need to sort depending of the associations and co. to know what to truncate first, we can just truncate everything. This would also allow us to ditch the doctrine/data-fixtures as a requirement.

WDYT?

@theofidry
Copy link
Owner Author

Thinking about this again, it doesn't make much sense as the issue is the order. The order is true irrelevant with a TRUNCATE, but it is still for the DELETE with is the default.

@robertfausk
Copy link

Coolio! I think its a good approach to have a solution for AliceDataFixtures as long as there is no decision in doctrine/data-fixtures#272.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants