You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When database-cleaner lists out the tables to be deleted, the tables are not ordered by foreign key constraints. So we have child with a foreign key to parent, but DELETE FROM "parent" is attempted to be run before DELETE FROM "child", causing the table to not be deleted because there are still rows in child referencing parent
When the above command didn't work, database-cleaner silently failed. I believe database-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:
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: