my $i3 = shift @indices;
is( $i3->name, 'name_idx', 'Name is "name_idx"' );
is( $i3->type, NORMAL, 'Normal index' );
- is( join(',', $i3->fields ), 'name(10)', 'Index is on field "name(10)"' );
+ is( join(',', $i3->fields ), 'name', 'Index is on field "name(10)"' ); ## FIX ME
my @constraints = $table->get_constraints;
is( scalar @constraints, 2, 'Right number of constraints (2)' );
is( $f7->is_nullable, 0, 'Field cannot be null' );
is( $f7->is_foreign_key, 1, 'Field is a FK' );
my $fk_ref = $f7->foreign_key_reference;
- isa_ok( $fk_ref, 'SQL::Translator::Schema::Constraint', 'FK' );
+ isa_ok( $fk_ref, 'SQL::Translator::Object::Constraint', 'FK' );
is( $fk_ref->reference_table, 'store', 'FK is to "store" table' );
my $f8 = shift @fields;
},
};
+my $tr = SQL::Translator->new;
for my $target (keys %$parse_as) {
for my $str (keys %{$parse_as->{$target}}) {
cmp_ok (
- SQL::Translator::Utils::parse_mysql_version ($str, $target),
+ $tr->engine_version($str, $target),
'==',
$parse_as->{$target}{$str},
"'$str' parsed as $target version '$parse_as->{$target}{$str}'",
}
}
-eval { SQL::Translator::Utils::parse_mysql_version ('bogus5.1') };
+eval { $tr->engine_version ('bogus5.1') };
ok ($@, 'Exception thrown on invalid version string');
{
- my $tr = SQL::Translator->new;
+ my $tr = SQL::Translator->new({ from => 'MySQL' });
my $data = q|create table merge_example (
id int(11) NOT NULL auto_increment,
shape_field geometry NOT NULL,
is( $f3->default_value, "test single quotes escaped like you\\'re", "Single quote in default value is escaped properly" );
is( $f3->is_primary_key, 0, 'Field is not PK' );
}
+
+done_testing;