my($proto, $href) = @_;
my $schema = proto->new( map {
my(@columns);
- while (@{$tables{$_}{'columns'}}) {
- my($name,$type,$null,$length)=splice @{$tables{$_}{'columns'}}, 0, 4;
- push @columns, new DBIx::DBSchema::Column ( $name,$type,$null,$length );
+ while ( @{$href->{$_}{'columns'}} ) {
+ push @columns, DBIx::DBSchema::Column->new(
+ splice @{$href->{$_}{'columns'}}, 0, 4
+ );
}
DBIx::DBSchema::Table->new(
$_,
- $tables{$_}{'primary_key'},
- DBIx::DBSchema::ColGroup::Unique->new($tables{$_}{'unique'}),
- DBIx::DBSchema::ColGroup::Index->new($tables{$_}{'index'}),
+ $href->{$_}{'primary_key'},
+ DBIx::DBSchema::ColGroup::Unique->new($href->{$_}{'unique'}),
+ DBIx::DBSchema::ColGroup::Index->new($href->{$_}{'index'}),
@columns,
);
- } (keys %tables) );
+ } (keys %{$href}) );
}
# private subroutines