I am trying to use psql triggers in my rails app. So i tried using this migration where execution of psql triggers are supposedly easly -- class AddTriggersToProducts < ActiveRecord::Migration def self.up table :products execute %q{ create trigger trig1 before insert on products for each row begin price = price + 5 end;
}
end
def self.down execute 'DROP TRIGGER trig1' end end But this didnt change anything... I dont know where to write the procedure or function if i am gonna use one here...