-
Notifications
You must be signed in to change notification settings - Fork 96
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
Migrations Using change() method: undefined method `each' for nil:NilClass #26
Comments
one tricky thing about supporting regardless though, hairtrigger should definitely be fixed so it doesn't blow up when it encounters a |
Using
Not sure I understand you here, what does it need to know that it is missing?
Yes, initially I thought I could just say: # up
create_trigger.on(:users).after(:insert) do "..." end
# down
drop_trigger.on(:users).after(:insert) But I have to provide class AddTriger < ActiveRecord::Migration
def up
create_trigger("bs").on(:users).after(:insert) do
"select 1"
end
end
def down
drop_trigger("bs", :users)
end
end Exception:
Why do you have to read the migration files? Also, for triggers created "manually" (say via |
As currently implemented, In hindsight, perhaps
Yeah that example seems like it should work, I'll see what's up with that.
Two reasons:
Isn't that the correct behavior though? Typically schema.rb would be applied to an empty database. In the same vein, schema.rb doesn't try to drop tables or indexes before it creates them (afaik). |
By default the DB is recreated each time test are run, which makes sense unless you're using something like DatabaseCleaner.
As for the problem with
Can't this be figured out via DB calls like |
Good point, I typically just do Independent of this bug (or even HairTrigger), if you don't care about supporting other dbs, one thing you might consider is
Absolutely, in fact that's where the My initial motivator in writing HairTrigger was so I could add triggers to canvas-lms, which at the time supported sqlite, mysql and postgres. If the migrations and schema.rb just had inferred raw But yeah, regardless, HairTrigger should add the appropriate |
Looks like the s-expression checking doesn't look for
change
, this causes aNoMethodError
on the next line.Additionally the rescue block returns
nil
, which results in anotherNoMethodError
in the caller.The text was updated successfully, but these errors were encountered: