set the schema on a trigger when it is added
Justin Hunter [Tue, 1 Dec 2009 22:46:01 +0000 (14:46 -0800)]
lib/SQL/Translator/Object/Schema.pm

index 7b48900..446c553 100644 (file)
@@ -89,7 +89,10 @@ class SQL::Translator::Object::Schema extends SQL::Translator::Object {
     }
 
     around add_procedure(Procedure $procedure does coerce) { $self->$orig($procedure->name, $procedure) }
-    around add_trigger(Trigger $trigger does coerce) { $self->$orig($trigger->name, $trigger) }
+    around add_trigger(Trigger $trigger does coerce) {
+        $trigger->schema($self);
+        $self->$orig($trigger->name, $trigger);;
+    }
 
     method is_valid { return $self->get_tables ? 1 : undef }