Gahhh! You know what's ridiculously annoying? I did just this last night and simply forgot the "require" at the top. That seemed to be the way to do it but... yeah.
While this is working perfectly now, in your example you use the following: pgt_created_at(:gifts, :inserted_at, :function_name=>:inserted_at) And... drop_function(:inserted_at) Shouldn't that be: pgt_created_at(:gifts, :inserted_at, :trigger_name=>:inserted_at) And... drop_trigger(:gifts, :inserted_at) Or am I missing something? (Again.) On Sep 24, 9:01 am, Jeremy Evans <[email protected]> wrote: > On Sep 23, 11:35 pm, cult hero <[email protected]> wrote: > > > This works like a charm. Thanks. > > > How do I incorporate these into a migration? I've been messing with it > > but nothing in the documentation seems obvious. Is there a "proper" > > way to use methods in Sequel::Postgres::DatabaseMethods (since I'll > > need to drop the trigger in the .down method)? > > They are just database instance methods. They add triggers to > columns, so if you are adding them the same time as the table, you > would call them after the create_table call in up. The only changes > to down would be dropping the functions created, so you'll want to > specify the :function_name option. If the table/column already exists > and you aren't dropping it, make sure you pass the :trigger_name > option as well, so you can drop the created trigger with drop_trigger. > > You can see an example of usage > here:http://github.com/jeremyevans/giftsmas/blob/master/migrate/001_setup_... > > Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
