Already changed source_name keys in deploy_depends_on to use the new
[dbsrgits/DBIx-Class-ResultSource-MultipleTableInheritance.git] / t / 02view_def.t
1 use strict;
2 use warnings;
3 use lib 't/lib';
4 use File::Temp;
5 use Test::More qw(no_plan);
6 use Test::Exception;
7 use Devel::Dwarn;
8
9 BEGIN {
10     use_ok 'MTITest';
11     $ENV{DBIC_TRACE} = 1;
12 }
13
14 dies_ok { MTITest->source('Foo')->view_definition }
15 "Can't generate view def without connected schema";
16
17 #my $schema = MTITest->connect('dbi:SQLite::memory:');
18
19 my $schema = MTITest->connect( 'dbi:Pg:dbname=mti', 'postgres', '' );
20 diag(DwarnS $schema);
21
22 #diag("MTITest view definition: ", $schema->resultset('Bar')->result_source->view_definition);
23 my $dir = "t/sql";    # tempdir(CLEANUP => 0);
24
25 $schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir );
26 $schema->deploy( { add_drop_table => 1, add_drop_view => 1 } );
27
28 #diag DwarnS $schema->source($_)->view_definition for qw(Foo Bar);
29 #diag DwarnS $schema->source($_) for qw(Foo Bar);