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_tables.rb#L97

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.

Reply via email to