From: Justin Hunter Date: Wed, 13 Jan 2010 00:50:29 +0000 (-0800) Subject: add an around remove_trigger to make sure trigger actually exists X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd2708f4c70d2b2f41bfd39411cb1a79d9583d94;p=dbsrgits%2FSQL-Translator-2.0-ish.git add an around remove_trigger to make sure trigger actually exists --- diff --git a/lib/SQL/Translator/Object/Schema.pm b/lib/SQL/Translator/Object/Schema.pm index 4f02431..0a954f2 100644 --- a/lib/SQL/Translator/Object/Schema.pm +++ b/lib/SQL/Translator/Object/Schema.pm @@ -112,6 +112,12 @@ class SQL::Translator::Object::Schema extends SQL::Translator::Object { $self->$orig($name); } + around remove_trigger(Trigger|Str $trigger) { + my $name = is_Trigger($trigger) ? $trigger->name : $trigger; + die "Can't drop non-existant trigger " . $name unless $self->exists_trigger($name); + $self->$orig($name); + } + method order { } method perform_action_when { } method database_events { }