ActiveRecord::Fixtures#delete_existing_fixtures

I'm working on a solution that resolves the common "seed data vs. fixtures" issue.

It comes down to:

def delete_existing_fixtures     @connection.delete "DELETE FROM #...@connection.quote_table_name(table_name)}", 'Fixture Delete' end

Which deletes all records in a particular table. This is what causes the "hey, I seeded the database by overriding a rake task yet my unit tests still kill my database records" issue.

One solution to this would be to change that DELETE statement to "DELETE...WHERE" and deleting records by id, rather than deleting all records.

I recognize the importance of needing to re-insert fixture data for tests (so each test has unadultered fixtures data in the db). So my question is, are there any major red flags to changing that delete statement, resulting in fixture records being deleted but seed data to remain in the database?

Or would it be better to insert seed data right before each time the fixtures are re-inserted?

One approach is more simple than the other, both in terms of implementation and the test suite performance.

Thanks for your input.