-
Notifications
You must be signed in to change notification settings - Fork 47
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
Postgres tables not cleaning #59
Comments
@brandon-leapyear not exactly. Can you send a PR? Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A few problems came up for us:
When
database-cleaner
lists out the tables to be deleted, the tables are not ordered by foreign key constraints. So we havechild
with a foreign key toparent
, butDELETE FROM "parent"
is attempted to be run beforeDELETE FROM "child"
, causing the table to not be deleted because there are still rows inchild
referencingparent
When the above command didn't work,
database-cleaner
silently failed. I believedatabase-cleaner
should check that the table was indeed cleared, and error otherwise.Truncation seems to work for us. Is there a reason why truncation is not the default?
The text was updated successfully, but these errors were encountered: