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',
24 curries => { set => { add_column => sub { my ($self, $body, $column) = @_; $self->$body($column->name, $column); } } },
25 default => sub { {} },
30 metaclass => 'Collection::Hash',
32 isa => HashRef[Index],
34 exists => 'exists_index',
38 curries => { set => { add_index => sub { my ($self, $body, $index) = @_; $self->$body($index->name, $index); } } },
39 default => sub { {} },
43 has 'constraints' => (
44 metaclass => 'Collection::Hash',
46 isa => HashRef[Constraint],
48 exists => 'exists_constraint',
49 keys => 'constraint_ids',
50 get => 'get_constraint',
52 curries => { set => { add_constraint => sub { my ($self, $body, $constraint) = @_; $self->$body($constraint->name, $constraint); } } },
53 default => sub { {} },
58 __PACKAGE__->meta()->make_immutable;