2 class SQL::Translator::Object::Trigger extends SQL::Translator::Object {
3 use MooseX::Types::Moose qw(Any ArrayRef HashRef Str);
4 use MooseX::MultiMethods;
5 use SQL::Translator::Types qw(Column Schema Table);
28 isa => HashRef[Column],
30 exists_column => 'exists',
32 get_columns => 'values',
35 clear_columns => 'clear',
37 default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
44 # trigger => sub { my ($self, $new, $old) = @_; $self->table($self->schema->get_table($new)) },
52 has 'perform_action_when' => (
58 has '_database_events' => (
62 _database_events => 'elements',
63 add_database_event => 'push',
64 remove_last_database_option => 'pop',
66 default => sub { [] },
70 around add_column(Column $column) { $self->$orig($column->name, $column) }
72 multi method database_events(Str $database_event) { $self->add_database_event($database_event); $self->database_events }
73 multi method database_events(ArrayRef $database_events) { $self->add_database_event($_) for @$database_events; $self->database_events }
74 multi method database_events { $self->_database_events }