- Stephen Bennett <stephen@freenode.net>
- Stephen Clouse <stephenclouse@gmail.com>
- SymKat <symkat@symkat.com>
+- Tina Müller <tinita@cpan.org>
- Vincent Bachelier <geistteufel@yahoo.fr>
- Wallace Reis <wreis@cpan.org>
- Ying Zhang <zyolive@yahoo.com>
via alter_field to a column in Postgres Producer
* Added a working mechanism for naming foreign keys in the PostgreSQL producer
* Fix PostgreSQL ignoring default values with specified data type
+* Fix PostgreSQL parser support for (N)::int defaults (patch by Tina Müller)
* Fix possible name duplication in SQLlite producer
* Oracle does not accept ON DELETE/UPDATE RESTRICT (though it is the actual default)
fix by not adding the ON DELETE/UPDATE clause at all
use Test::SQL::Translator qw(maybe_plan);
BEGIN {
- maybe_plan(134, 'SQL::Translator::Parser::PostgreSQL');
+ maybe_plan(140, 'SQL::Translator::Parser::PostgreSQL');
SQL::Translator::Parser::PostgreSQL->import('parse');
}
f_id integer NOT NULL,
f_varchar varchar(25),
f_int smallint,
+ f_smallint smallint default (0)::smallint,
primary key (f_id),
check (f_int between 1 and 5)
);
is( $t2->name, 't_test2', 'Table t_test2 exists' );
my @t2_fields = $t2->get_fields;
-is( scalar @t2_fields, 3, '3 fields in t_test2' );
+is( scalar @t2_fields, 4, '4 fields in t_test2' );
my $t2_f1 = shift @t2_fields;
is( $t2_f1->name, 'f_id', 'First field is "f_id"' );
is( $t2_f3->default_value, undef, 'Default value is undefined' );
is( $t2_f3->is_primary_key, 0, 'Field is not PK' );
+my $t2_f4 = shift @t2_fields;
+is( $t2_f4->name, 'f_smallint', 'Fourth field is "f_smallint"' );
+is( $t2_f4->data_type, 'integer', 'Field is an integer' );
+is( $t2_f4->is_nullable, 1, 'Field can be null' );
+is( $t2_f4->size, 5, 'Size is "5"' );
+is( $t2_f4->default_value, 0, 'Default value is 0' );
+is( $t2_f4->is_primary_key, 0, 'Field is not PK' );
+
+
my @t2_constraints = $t2->get_constraints;
is( scalar @t2_constraints, 3, "Three constraints on table" );