-
Notifications
You must be signed in to change notification settings - Fork 97
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
hair trigger should drop raw triggers before creating in schema.rb #27
Comments
@sshaw can you provide a little more info on how you're getting duplicate trigger errors from the I've got a vanilla Rails app and have been testing it under MySQL, Postgres and SQLite. Some findings:
Any info you can provide would be helpful (which rake command you run, other gems that might be affecting things, database you're using, etc.) |
Yes, I had trouble reproducing it too... Let me have a look at the app that was causing the problem, I'll get back to you. |
It turns out that some code I had added to deal with triggers before I found your gem was causing the problem. Sorry for the runaround... 🙊 |
haha, no worries. thanks for all the other good info and pointers 👍 |
Spawned from discussion #26 ... in schema.rb, although
create_trigger
will drop the existing trigger first (if it exists), that is not the case for rawexecute "CREATE TRIGGER..."
calls that it does. Because of this, if you have any triggers that don't correspond to acreate_trigger
in a migration, schema.rb cannot be used to update an existing test database (à larake db:test:prepare
), only an empty one.For any adapter-specific
execute "CREATE TRIGGER..."
calls, HairTrigger should first do aDROP TRIGGER IF EXISTS
callThe text was updated successfully, but these errors were encountered: