bmabey/database_cleaner — Issue #76: Allow for specifying table truncation order
Author: rurounijones
Created: 2011-10-26 06:49:28+00:00
State: open

I am having to interface with an Microsoft SQL Server 2005 instance which is populated with a bunch of foreign key constraints.

The transaction strategy causes the tests to hang. I am not sure why so I went with the truncation strategy. However because database_cleaner cleans the tables in the order that it finds them it is trying to truncate tables with violates the foreign key constraints of the other tables.

Something like the following would be extremely useful

````ruby
:trunctation, {:order ['table1','table2'] }
````
Which would ensure that DatabaseCleaner first truncates table1 then table2 then the rest (apart from those specified by :except of course).