-
Notifications
You must be signed in to change notification settings - Fork 94
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
Referential Integrity causes foreign key errors with creation of fixtures #43
Comments
@DaveWhitmer Hmm - that issue should be fixed though, so this shouldn't be necessary anymore. Which Citus version are you testing against? |
Should be 7.5, but have not even gotten to that stage. Simply installed the gem in preparation for the move to Citus and my test suite started failing as described above. Remove the gem and the test suite passes. Dug into it and found that it was the fixture creation with the referential integrity as described above. Forked the gem added that monkey patch to it and everything passed. |
Ah, this is caused by https://github.com/citusdata/activerecord-multi-tenant/blob/master/lib/activerecord-multi-tenant/referential_integrity.rb which wasn't removed yet even though this was fixed in Citus. Given that this has been supported since Citus 6.2 I'd be inclined to simply remove that monkey patch. Since you already forked the gem, could you try just removing that monkey patch from it, and see if that also makes things pass? (to confirm the patch is the issue) |
Yes. Commenting out the entirety of the referential_integrity.rb file causes my local test environment to pass as I would expect. |
Adding the gem caused my test suite to fail due to foreign key index violations with fixture creations.
Simple fix is just to change referential_integrity.rb to:
Not sure if there are any unintended consequences...
The text was updated successfully, but these errors were encountered: