X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F12pg_common.t;h=7d4f5ab3a32ddf2d48d45d80888d38f893e460ce;hb=45321edada71a4dbcf47c19ee55af4d08c2ba095;hp=3b626b1cacc0a0932c4ec83bd58a401c38a1c4c9;hpb=9990e58f49603b81e3c1195c0e83595b0333c8df;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/12pg_common.t b/t/12pg_common.t index 3b626b1..7d4f5ab 100644 --- a/t/12pg_common.t +++ b/t/12pg_common.t @@ -15,68 +15,97 @@ my $tester = dbixcsl_common_tests->new( user => $user, password => $password, data_types => { - 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' }, + # http://www.postgresql.org/docs/7.4/interactive/datatype.html + # + # Numeric Types + boolean => { data_type => 'boolean' }, + bool => { data_type => 'boolean' }, + 'bool default false' + => { data_type => 'boolean', default_value => \'false' }, + + bigint => { data_type => 'bigint' }, + int8 => { data_type => 'bigint' }, + bigserial => { data_type => 'bigint', is_auto_increment => 1 }, + serial8 => { data_type => 'bigint', is_auto_increment => 1 }, integer => { data_type => 'integer' }, int => { data_type => 'integer' }, int4 => { data_type => 'integer' }, - interval => { data_type => 'interval' }, - 'interval(2)' => { size => 2, data_type => 'interval' }, - 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' => { data_type => 'time without time zone' }, - 'time(2) without time zone' => { size => 2, data_type => 'time without time zone' }, + smallint => { data_type => 'smallint' }, + int2 => { data_type => 'smallint' }, + + money => { data_type => 'money' }, + + 'double precision' => { data_type => 'double precision' }, + float8 => { data_type => 'double precision' }, + real => { data_type => 'real' }, + float4 => { data_type => 'real' }, + 'float(24)' => { data_type => 'real' }, + 'float(25)' => { data_type => 'double precision' }, + 'float(53)' => { data_type => 'double precision' }, + float => { data_type => 'double precision' }, + + numeric => { data_type => 'numeric' }, + decimal => { data_type => 'numeric' }, + 'numeric(6,3)' => { data_type => 'numeric', size => [6,3] }, + 'decimal(6,3)' => { data_type => 'numeric', size => [6,3] }, + + # Bit String Types + 'bit varying(2)' => { data_type => 'varbit', size => 2 }, + 'varbit(2)' => { data_type => 'varbit', size => 2 }, + 'varbit' => { data_type => 'varbit' }, + bit => { data_type => 'bit', size => 1 }, + 'bit(3)' => { data_type => 'bit', size => 3 }, + + # Network Types + inet => { data_type => 'inet' }, + cidr => { data_type => 'cidr' }, + macaddr => { data_type => 'macaddr' }, + + # Geometric Types + point => { data_type => 'point' }, + line => { data_type => 'line' }, + lseg => { data_type => 'lseg' }, + box => { data_type => 'box' }, + path => { data_type => 'path' }, + polygon => { data_type => 'polygon' }, + circle => { data_type => 'circle' }, + + # Character Types + 'character varying(2)' => { data_type => 'varchar', size => 2 }, + 'varchar(2)' => { data_type => 'varchar', size => 2 }, + 'character(2)' => { data_type => 'char', size => 2 }, + 'char(2)' => { data_type => 'char', size => 2 }, + 'character' => { data_type => 'char', size => 1 }, + 'char' => { data_type => 'char', size => 1 }, + text => { data_type => 'text' }, + # varchar with no size has unlimited size, we rewrite to 'text' + varchar => { data_type => 'text', + original => { data_type => 'varchar' } }, + + # Datetime Types + date => { data_type => 'date' }, + interval => { data_type => 'interval' }, + 'interval(2)' => { data_type => 'interval', size => 2 }, + time => { data_type => 'time' }, + 'time(2)' => { data_type => 'time', size => 2 }, + 'time without time zone' => { data_type => 'time' }, + 'time(2) without time zone' => { data_type => 'time', size => 2 }, 'time with time zone' => { data_type => 'time with time zone' }, - 'time(2) with time zone' => { size => 2, data_type => 'time with time zone' }, - timestamp => { data_type => 'timestamp without time zone' }, + 'time(2) with time zone' => { data_type => 'time with time zone', size => 2 }, + timestamp => { data_type => 'timestamp' }, 'timestamp default current_timestamp' - => { data_type => 'timestamp without time zone', default_value => \'CURRENT_TIMESTAMP' }, - 'timestamp(2)' => { size => 2, 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' }, + => { data_type => 'timestamp', default_value => \'current_timestamp' }, + 'timestamp(2)' => { data_type => 'timestamp', size => 2 }, + 'timestamp without time zone' => { data_type => 'timestamp' }, + 'timestamp(2) without time zone' => { data_type => 'timestamp', size => 2 }, + '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' }, - 'character varying(2)' => { size => 2, data_type => 'character varying' }, - 'varchar(2)' => { size => 2, data_type => 'character varying' }, - 'character(2)' => { size => 2, data_type => 'character' }, - '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' }, - numeric => { data_type => 'numeric' }, - decimal => { data_type => 'numeric' }, - 'float(24)' => { data_type => 'real' }, - 'float(25)' => { data_type => 'double precision' }, - 'float(53)' => { data_type => 'double precision' }, - float => { data_type => 'double precision' }, + 'timestamp(2) with time zone' => { data_type => 'timestamp with time zone', size => 2 }, + + # Blob Types + bytea => { data_type => 'bytea' }, }, extra => { create => [