better type info for Pg: sets sequence for serials, handles numerics without precision
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 12pg_common.t
index fb31fb7..157decf 100644 (file)
@@ -16,51 +16,51 @@ my $tester = dbixcsl_common_tests->new(
     user        => $user,
     password    => $password,
     data_types  => {
-       'bigint'    => { size => undef, data_type => 'bigint' },
-       'int8'      => { size => undef, data_type => 'bigint' },
-       'bigserial' => { size => undef, data_type => 'bigint', is_auto_increment => 1 },
-       'serial8'   => { size => undef, data_type => 'bigint', is_auto_increment => 1 },
-       'bit'       => { size => undef, data_type => 'bit' },
-       'boolean'   => { size => undef, data_type => 'boolean' },
-       'bool'      => { size => undef, data_type => 'boolean' },
-       'box'       => { size => undef, data_type => 'box' },
-       'bytea'     => { size => undef, data_type => 'bytea' },
-       'cidr'      => { size => undef, data_type => 'cidr' },
-       'circle'    => { size => undef, data_type => 'circle' },
-       'date'      => { size => undef, data_type => 'date' },
-       'double precision' => { size => undef, data_type => 'double precision' },
-       'float8'      => { size => undef, data_type => 'double precision' },
-       'inet'        => { size => undef, data_type => 'inet' },
-       'integer'     => { size => undef, data_type => 'integer' },
-       'int'         => { size => undef, data_type => 'integer' },
-       'int4'        => { size => undef, data_type => 'integer' },
-       'interval'    => { size => undef, data_type => 'interval' },
+       'bigint'    => { data_type => 'bigint' },
+       'int8'      => { data_type => 'bigint' },
+       'bigserial' => { data_type => 'bigint', is_auto_increment => 1 },
+       'serial8'   => { data_type => 'bigint', is_auto_increment => 1 },
+       'bit'       => { data_type => 'bit' },
+       'boolean'   => { data_type => 'boolean' },
+       'bool'      => { data_type => 'boolean' },
+       'box'       => { data_type => 'box' },
+       'bytea'     => { data_type => 'bytea' },
+       'cidr'      => { data_type => 'cidr' },
+       'circle'    => { data_type => 'circle' },
+       'date'      => { data_type => 'date' },
+       'double precision' => { data_type => 'double precision' },
+       'float8'      => { data_type => 'double precision' },
+       'inet'        => { data_type => 'inet' },
+       'integer'     => { data_type => 'integer' },
+       'int'         => { data_type => 'integer' },
+       'int4'        => { data_type => 'integer' },
+       'interval'    => { data_type => 'interval' },
        'interval(2)' => { size => 2, data_type => 'interval' },
-       'line'        => { size => undef, data_type => 'line' },
-       'lseg'        => { size => undef, data_type => 'lseg' },
-       'macaddr'     => { size => undef, data_type => 'macaddr' },
-       'money'       => { size => undef, data_type => 'money' },
-       'path'        => { size => undef, data_type => 'path' },
-       'point'       => { size => undef, data_type => 'point' },
-       'polygon'     => { size => undef, data_type => 'polygon' },
-       'real'        => { size => undef, data_type => 'real' },
-       'float4'      => { size => undef, data_type => 'real' },
-       'smallint'    => { size => undef, data_type => 'smallint' },
-       'int2'        => { size => undef, data_type => 'smallint' },
-       'serial'      => { size => undef, data_type => 'integer', is_auto_increment => 1 },
-       'serial4'     => { size => undef, data_type => 'integer', is_auto_increment => 1 },
-       'text'        => { size => undef, data_type => 'text' },
-       'time'        => { size => undef, data_type => 'time without time zone' },
+       'line'        => { data_type => 'line' },
+       'lseg'        => { data_type => 'lseg' },
+       'macaddr'     => { data_type => 'macaddr' },
+       'money'       => { data_type => 'money' },
+       'path'        => { data_type => 'path' },
+       'point'       => { data_type => 'point' },
+       'polygon'     => { data_type => 'polygon' },
+       'real'        => { data_type => 'real' },
+       'float4'      => { data_type => 'real' },
+       'smallint'    => { data_type => 'smallint' },
+       'int2'        => { data_type => 'smallint' },
+       'serial'      => { data_type => 'integer', is_auto_increment => 1 },
+       'serial4'     => { data_type => 'integer', is_auto_increment => 1 },
+       'text'        => { data_type => 'text' },
+       'time'        => { data_type => 'time without time zone' },
        'time(2)'     => { size => 2, data_type => 'time without time zone' },
-       'time without time zone'         => { size => undef, data_type => 'time without time zone' },
+       'time without time zone'         => { data_type => 'time without time zone' },
        'time(2) without time zone'      => { size => 2, data_type => 'time without time zone' },
-       'time with time zone'            => { size => undef, data_type => 'time with time zone' },
+       'time with time zone'            => { data_type => 'time with time zone' },
        'time(2) with time zone'         => { size => 2, data_type => 'time with time zone' },
-       'timestamp'                      => { size => undef, data_type => 'timestamp without time zone' },
+       'timestamp'                      => { data_type => 'timestamp without time zone' },
        'timestamp(2)'                   => { size => 2, data_type => 'timestamp without time zone' },
-       'timestamp without time zone'    => { size => undef, data_type => 'timestamp without time zone' },
+       'timestamp without time zone'    => { data_type => 'timestamp without time zone' },
        'timestamp(2) without time zone' => { size => 2, data_type => 'timestamp without time zone' },
-       'timestamp with time zone'       => { size => undef, data_type => 'timestamp with time zone' },
+       'timestamp with time zone'       => { data_type => 'timestamp with time zone' },
        'timestamp(2) with time zone'    => { size => 2, data_type => 'timestamp with time zone' },
        'bit varying(2)'                 => { size => 2, data_type => 'bit varying' },
        'varbit(2)'                      => { size => 2, data_type => 'bit varying' },
@@ -70,9 +70,11 @@ my $tester = dbixcsl_common_tests->new(
        'char(2)'                        => { size => 2, data_type => 'character' },
        'numeric(6, 3)'                  => { size => [6,3], data_type => 'numeric' },
        'decimal(6, 3)'                  => { size => [6,3], data_type => 'numeric' },
-        'float(24)'                      => { size => undef, data_type => 'real' },
-        'float(53)'                      => { size => undef, data_type => 'double precision' },
-        'float'                          => { size => undef, data_type => 'double precision' },
+        'numeric'                        => { data_type => 'numeric' },
+        'decimal'                        => { data_type => 'numeric' },
+        'float(24)'                      => { data_type => 'real' },
+        'float(53)'                      => { data_type => 'double precision' },
+        'float'                          => { data_type => 'double precision' },
     },
     extra       => {
         create => [