Yeah, the GUI was being goofy. Looked at the code, grabbed the default function names and deleted them. Now everything is up/down in the migration beautifully. (And, since this is an alter, rather than a create, I drop the triggers explicitly and then drop the functions.)
Thanks for all the help. I think I get how all of this goes together a bit better now and understand the migration DSL a bit better too. As always, this is an excellent tool and the support here is fantastic. On Sep 24, 2:24 pm, cult hero <[email protected]> wrote: > Ahhh. Okay. > > It looks like the GUI app I'm using (Navicat Lite) to peek at > PostgreSQL isn't showing the functions. I presumed that, but when I > look at the functions under the database, I don't see them anywhere. I > guess I'll have to have a look for the function another way. > > On Sep 24, 12:58 pm, Jeremy Evans <[email protected]> wrote: > > > > > On Sep 24, 11:28 am, cult hero <[email protected]> wrote: > > > > 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.) > > > In PostgreSQL, you create a function that returns trigger, and then > > set the trigger on the table to call that function. So the pgt_* > > methods add both the trigger and the function. The trigger is dropped > > automatically when you drop the table, but the function is not, which > > is why it has to be dropped manually. Because the function has to be > > dropped manually, you need to give it a name when you create so you > > can reference that name when dropping it. > > > sequel_postgresql_triggers is not a very long extension, only about > > 140 lines of which about have are blank or > > comments:http://github.com/jeremyevans/sequel_postgresql_triggers/blob/master/... > > > 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.
