use MooseX::Types::Moose qw(Any ArrayRef HashRef Str);
has '_comments' => (
- metaclass => 'Collection::Array',
+ traits => ['Array'],
is => 'rw',
isa => ArrayRef,
- provides => {
- push => 'add_comment',
- pop => 'remove_last_comment',
+ handles => {
+ add_comment => 'push',
+ remove_last_comment => 'pop',
},
default => sub { [] },
auto_deref => 1,
);
has '_options' => (
- metaclass => 'Collection::Array',
+ traits => ['Array'],
is => 'rw',
isa => ArrayRef,
- provides => {
- push => 'add_option',
- pop => 'remove_last_option',
+ handles => {
+ add_option => 'push',
+ remove_last_option => 'pop',
},
default => sub { [] },
auto_deref => 1,
);
has '_extra' => (
- metaclass => 'Collection::Hash',
+ traits => ['Hash'],
is => 'rw',
isa => HashRef,
- provides => {
- exists => 'exists_extra',
- keys => 'extra_ids',
- values => 'get_extras',
- get => 'get_extra',
- set => 'add_extra',
+ handles => {
+ exists_extra => 'exists',
+ extra_ids => 'keys',
+ get_extras => 'values',
+ get_extra => 'get',
+ add_extra => 'set',
},
default => sub { {} },
auto_deref => 1,
use MooseX::Declare;
class SQL::Translator::Object::Table extends SQL::Translator::Object {
use MooseX::Types::Moose qw(Any Bool HashRef Str);
- use MooseX::AttributeHelpers;
use MooseX::MultiMethods;
use SQL::Translator::Types qw(Column Constraint Index Schema Sequence);
);
has 'columns' => (
- metaclass => 'Collection::Hash',
+ traits => ['Hash'],
is => 'rw',
isa => HashRef[Column],
- provides => {
- exists => 'exists_column',
- keys => 'column_ids',
- values => 'get_columns',
- get => 'get_column',
- set => 'add_column',
+ handles => {
+ exists_column => 'exists',
+ column_ids => 'keys',
+ get_columns => 'values',
+ get_column => 'get',
+ add_column => 'set',
},
default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
);
has 'indexes' => (
- metaclass => 'Collection::Hash',
+ traits => ['Hash'],
is => 'rw',
isa => HashRef[Index],
- provides => {
- exists => 'exists_index',
- keys => 'index_ids',
- values => 'get_indices',
- get => 'get_index',
- set => 'add_index',
+ handles => {
+ exists_index => 'exists',
+ index_ids => 'keys',
+ get_indices => 'values',
+ get_index => 'get',
+ add_index => 'set',
},
default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
);
has 'constraints' => (
- metaclass => 'Collection::Hash',
+ traits => ['Hash'],
is => 'rw',
isa => HashRef[Constraint],
- provides => {
- exists => 'exists_constraint',
- keys => 'constraint_ids',
- values => 'get_constraints',
- get => 'get_constraint',
- set => 'add_constraint',
+ handles => {
+ exists_constraint => 'exists',
+ constraint_ids => 'keys',
+ get_constraints => 'values',
+ get_constraint => 'get',
+ add_constraint => 'set',
},
default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
);
has 'sequences' => (
- metaclass => 'Collection::Hash',
+ traits => ['Hash'],
is => 'rw',
isa => HashRef[Sequence],
- provides => {
- exists => 'exists_sequence',
- keys => 'sequence_ids',
- values => 'get_sequences',
- get => 'get_sequence',
- set => 'add_sequence',
+ handles => {
+ exists_sequence => 'exists',
+ sequence_ids => 'keys',
+ get_sequences => 'values',
+ get_sequence => 'get',
+ add_sequence => 'set',
},
default => sub { my %hash = (); tie %hash, 'Tie::IxHash'; return \%hash },
);