2 class SQL::Translator::Object::Schema extends SQL::Translator::Object {
3 use MooseX::Types::Moose qw(HashRef Maybe Str);
4 use MooseX::AttributeHelpers;
5 use SQL::Translator::Types qw(Procedure Table Trigger View);
15 metaclass => 'Collection::Hash',
17 isa => HashRef[Table],
19 exists => 'exists_table',
21 values => 'get_tables',
25 default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
29 metaclass => 'Collection::Hash',
33 exists => 'exists_view',
35 values => 'get_views',
39 default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
43 metaclass => 'Collection::Hash',
45 isa => HashRef[Procedure],
47 exists => 'exists_procedure',
48 keys => 'procedure_ids',
49 values => 'get_procedures',
50 get => 'get_procedure',
51 set => 'add_procedure',
53 default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
57 metaclass => 'Collection::Hash',
59 isa => HashRef[Trigger],
61 exists => 'exists_trigger',
62 keys => 'trigger_ids',
63 values => 'get_triggers',
67 default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
70 around add_table(Table $table) { $self->$orig($table->name, $table) }
71 around add_view(View $view) { $self->$orig($view->name, $view) }
72 around add_procedure(Procedure $procedure) { $self->$orig($procedure->name, $procedure) }
73 around add_trigger(Trigger $trigger) { $self->$orig($trigger->name, $trigger) }
78 method perform_action_when { }
79 method database_events { }