-#!/usr/bin/perl
-# vim: set ft=perl:
-
use strict;
+use warnings;
use Test::More;
use SQL::Translator;
use SQL::Translator::Constants qw(:sqlt_types :sqlt_constants);
-use Test::SQL::Translator qw(maybe_plan);
-
-BEGIN {
- maybe_plan(120, 'SQL::Translator::Parser::DDL::PostgreSQL');
-# SQL::Translator::Parser::PostgreSQL->import('parse');
-}
my $t = SQL::Translator->new( trace => 0, from => 'PostgreSQL' );
my $sql = q[
alter table only t_test1 add constraint c_u1 unique (f_varchar);
alter table t_test1 add constraint "c_fk2" foreign key (f_fk2)
- references t_test2 (f_id) on update no action on delete cascade;
+ references t_test2 (f_id) match simple
+ on update no action on delete cascade deferrable;
+
alter table t_test1 drop column f_dropped restrict;
my $f11 = shift @t1_fields;
is( $f11->name, 'f_timestamp', 'Eleventh field is "f_timestamp"' );
-is( $f11->data_type, 'timestamp', 'Field is a timestamp' );
+is( $f11->data_type, 'timestamp with time zone', 'Field is a timestamp with time zone' );
is( $f11->is_nullable, 1, 'Field can be null' );
is( $f11->size, 0, 'Size is "0"' );
is( $f11->default_value, undef, 'Default value is "undef"' );
is( exists $schema->get_table('products_1')->extra()->{'temporary'}, "", "Table is NOT temporary");
is( $schema->get_table('products_2')->extra('temporary'), 1,"Table is TEMP");
is( $schema->get_table('products_3')->extra('temporary'), 1,"Table is TEMPORARY");
+
+done_testing;