These changes allow Rails 2 users, users with foreign key constraints and users with empty fixture directories to use FixtureBuilder.
is it possible to apply the fix to master branch as it stands? since you are more familiar with the change it might be easier for you to perform the merge at your end first. there has been a pretty big refectoring done so I'm not sure how cleanly this patch will merge.
disable referential integrity when deleting tables so databases with …
…contraints don't fail
Here's the only piece that doesn't seem like it was covered from your recent commits. I tried testing it, but SQLite doesn't have true foreign key constraints, so I couldn't actually get a failing test. I could have just asserted that the disable_referential_integrity method was called, but that seemed dumb.
For the record, the referential integrity change is to make it so that you can delete tables that have foreign keys and data is still referenced by child tables (which happens when there is existing data left in the db after a test run).
CREATE TABLE magical_creatures(
CREATE TABLE unicorns(
FOREIGN KEY(magical_creature_id) REFERENCES magical_creatures(id)
insert into magical_creatures(id) values (1);
insert into unicorns(magical_creature_id) values (1);
drop table magical_creatures; --<< this should raise an error (and does in postgres) but does not
If you need a test in order to apply the patch, I'll have to add a dependency on postgres for the test suite. Let me know what you'd like to do.
this seems fine to me, as long as it works in a repository somewhere with this portion of code, its probably to ok to skip the postgres dependency.
i'll merge it now then push a new version, if you could let me know if the github version works fine with a test repo i'll release a new gem.