From: Ken Youens-Clark Date: Tue, 12 Aug 2003 21:59:10 +0000 (+0000) Subject: Changed to look at different constraints as NOT NULLs are now allowed as X-Git-Tag: v0.04~344 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b714ee539988dca3581fbc59149c54cf5d8b701;p=dbsrgits%2FSQL-Translator.git Changed to look at different constraints as NOT NULLs are now allowed as table constraints. --- diff --git a/t/14postgres-parser.t b/t/14postgres-parser.t index 8036f55..534f572 100644 --- a/t/14postgres-parser.t +++ b/t/14postgres-parser.t @@ -146,23 +146,23 @@ isa_ok( $fk_ref2, 'SQL::Translator::Schema::Constraint', 'FK' ); is( $fk_ref2->reference_table, 't_test2', 'FK is to "t_test2" table' ); my @t1_constraints = $t1->get_constraints; -is( scalar @t1_constraints, 4, '4 constraints on t_test1' ); +is( scalar @t1_constraints, 7, '7 constraints on t_test1' ); my $c1 = $t1_constraints[0]; is( $c1->type, PRIMARY_KEY, 'First constraint is PK' ); is( join(',', $c1->fields), 'f_serial', 'Constraint is on field "f_serial"' ); -my $c2 = $t1_constraints[1]; +my $c2 = $t1_constraints[4]; is( $c2->type, FOREIGN_KEY, 'Second constraint is foreign key' ); is( join(',', $c2->fields), 'f_fk1', 'Constraint is on field "f_fk1"' ); is( $c2->reference_table, 't_test2', 'Constraint is to table "t_test2"' ); is( join(',', $c2->reference_fields), 'f_id', 'Constraint is to field "f_id"' ); -my $c3 = $t1_constraints[2]; +my $c3 = $t1_constraints[5]; is( $c3->type, UNIQUE, 'Third constraint is unique' ); is( join(',', $c3->fields), 'f_varchar', 'Constraint is on field "f_varchar"' ); -my $c4 = $t1_constraints[3]; +my $c4 = $t1_constraints[6]; is( $c4->type, FOREIGN_KEY, 'Fourth constraint is foreign key' ); is( join(',', $c4->fields), 'f_fk2', 'Constraint is on field "f_fk2"' ); is( $c4->reference_table, 't_test2', 'Constraint is to table "t_test2"' );