use MooseX::Types::Moose qw(Any Bool HashRef Str);
use MooseX::MultiMethods;
use SQL::Translator::Types qw(Column Constraint Index Schema Sequence);
+ use SQL::Translator::Object::Column;
use SQL::Translator::Object::Constraint;
clean;
die "Can't drop non-existant constraint " . $name unless $self->exists_constraint($name);
$self->$orig($name);
}
+
+ around BUILDARGS(ClassName $self: @args) {
+ my $args = $self->$orig(@args);
+
+ my $fields = delete $args->{fields};
+
+ tie %{$args->{columns}}, 'Tie::IxHash';
+ $args->{columns}{$_} = SQL::Translator::Object::Column->new( name => $_ ) for @$fields;
+
+ return $args;
+ }
}