1 package SQL::Translator::Object::Table;
3 use MooseX::Types::Moose qw(HashRef Str);
4 use MooseX::AttributeHelpers;
5 use SQL::Translator::Types qw(Column Constraint Index Schema);
6 use SQL::Translator::Object::Schema;
7 extends 'SQL::Translator::Object';
16 metaclass => 'Collection::Hash',
18 isa => HashRef[Column],
20 exists => 'exists_column',
23 # set => 'set_column',
25 curries => { set => { add_column => sub { my ($self, $body, $column) = @_; $self->$body($column->name, $column); } } },
26 default => sub { {} },
31 metaclass => 'Collection::Hash',
33 isa => HashRef[Index],
35 exists => 'exists_index',
40 curries => { set => { add_index => sub { my ($self, $body, $index) = @_; $self->$body($index->name, $index); } } },
41 default => sub { {} },
45 has 'constraints' => (
46 metaclass => 'Collection::Hash',
48 isa => HashRef[Constraint],
50 exists => 'exists_constraint',
51 keys => 'constraint_ids',
52 get => 'get_constraint',
53 set => 'set_constraint',
55 default => sub { {} },
64 default => sub { SQL::Translator::Object::Schema->new }
68 __PACKAGE__->meta()->make_immutable;