# Bit String Types
'bit varying(2)' => { data_type => 'varbit', size => 2 },
'varbit(2)' => { data_type => 'varbit', size => 2 },
+ 'bit varying' => { data_type => 'varbit' },
'varbit' => { data_type => 'varbit' },
bit => { data_type => 'bit', size => 1 },
'bit(3)' => { data_type => 'bit', size => 3 },
# Datetime Types
date => { data_type => 'date' },
interval => { data_type => 'interval' },
+ 'interval(0)' => { data_type => 'interval', size => 0 },
'interval(2)' => { data_type => 'interval', size => 2 },
time => { data_type => 'time' },
+ 'time(0)' => { data_type => 'time', size => 0 },
'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(0) without time zone' => { data_type => 'time', size => 0 },
'time with time zone' => { data_type => 'time with time zone' },
+ 'time(0) with time zone' => { data_type => 'time with time zone', size => 0 },
'time(2) with time zone' => { data_type => 'time with time zone', size => 2 },
timestamp => { data_type => 'timestamp' },
'timestamp default now()' => { data_type => 'timestamp',
default_value => \'current_timestamp',
original => { default_value => \'now()' } },
+ 'timestamp(0)' => { data_type => 'timestamp', size => 0 },
'timestamp(2)' => { data_type => 'timestamp', size => 2 },
'timestamp without time zone' => { data_type => 'timestamp' },
+ 'timestamp(0) without time zone' => { data_type => 'timestamp', size => 0 },
'timestamp(2) without time zone' => { data_type => 'timestamp', size => 2 },
'timestamp with time zone' => { data_type => 'timestamp with time zone' },
+ 'timestamp(0) with time zone' => { data_type => 'timestamp with time zone', size => 0 },
'timestamp(2) with time zone' => { data_type => 'timestamp with time zone', size => 2 },
# Blob Types
)
},
q{
+ CREATE TYPE "dbicsl.test".pg_loader_test_enum2 AS ENUM ('wibble','wobble')
+ },
+ q{
CREATE TABLE "dbicsl.test".pg_loader_test7 (
id SERIAL PRIMARY KEY,
- value VARCHAR(100),
+ value "dbicsl.test".pg_loader_test_enum2,
six_id INTEGER UNIQUE REFERENCES "dbicsl.test".pg_loader_test6 (id)
)
},
'DROP VIEW pg_loader_test11',
],
drop => [ qw/pg_loader_test1 pg_loader_test2 pg_loader_test9 pg_loader_test10 pg_loader_test12/ ],
- count => 10 + 30 * 2,
+ count => 11 + 33 * 2, # regular + multi-schema * 2
run => sub {
my ($schema, $monikers, $classes) = @_;
lives_and {
ok $rsrc = $test_schema->source('PgLoaderTest7');
+ my $col_info = $rsrc->column_info('value');
+ is $col_info->{data_type}, 'enum',
+ 'enum column in schema name with dot';
+ is $col_info->{extra}{custom_type_name}, '"dbicsl.test".pg_loader_test_enum2',
+ 'original data type for enum in schema name with dot';
+ is_deeply $col_info->{extra}{list}, [qw(wibble wobble)],
+ 'value list for for enum in schema name with dot';
} 'got source for table in schema name with dot';
%uniqs = try { $rsrc->unique_constraints };
}
# test that views are marked as such
- isa_ok $schema->resultset($monikers->{pg_loader_test11})->result_source, 'DBIx::Class::ResultSource::View',
- 'views have table_class set correctly';
+ my $view_source = $schema->resultset($monikers->{pg_loader_test11})->result_source;
+ isa_ok $view_source, 'DBIx::Class::ResultSource::View',
+ 'view result source';
+
+ like $view_source->view_definition,
+ qr/\A \s* select\b .* \bfrom \s+ pg_loader_test1 \s* \z/imsx,
+ 'view definition';
is_deeply
{ $schema->source($monikers->{pg_loader_test12})->unique_constraints },