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

Add ability to truncate with foreign keys disabled #278

Closed
josephmancuso opened this issue Dec 23, 2020 · 1 comment · Fixed by #279
Closed

Add ability to truncate with foreign keys disabled #278

josephmancuso opened this issue Dec 23, 2020 · 1 comment · Fixed by #279
Labels
medium These issues are geared for people who have contributed to the project before Schema Related to the schema builder

Comments

@josephmancuso
Copy link
Member

Most times if you ar truncating and have foreign keys it will throw an error so need a way to disable foreign key checks when truncating

@josephmancuso josephmancuso added medium These issues are geared for people who have contributed to the project before Schema Related to the schema builder labels Dec 23, 2020
@josephmancuso
Copy link
Member Author

josephmancuso commented Dec 23, 2020

Needs these 2 new methods on the schema class:

Schema.disable_foreign_key_constraints()
Schema.enable_foreign_key_constraints()

and possibly one method that does all of it in 1:

Schema.truncate_without_foreign_keys()

or maybe even:

Schema.truncate(foreign_keys=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium These issues are geared for people who have contributed to the project before Schema Related to the schema builder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant