From: Peter Rabbitson Date: Sun, 21 Sep 2008 22:33:18 +0000 (+0000) Subject: Accomodate postgres being really load on CREATE X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb4526151477c9afe0678b15423b3bb329a476be;p=dbsrgits%2FDBIx-Class-Historic.git Accomodate postgres being really load on CREATE --- diff --git a/t/72pg.t b/t/72pg.t index 0003205..a3336bf 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -47,13 +47,16 @@ SKIP: { my $dbh = $schema->storage->dbh; $schema->source("Artist")->name("testschema.artist"); $schema->source("SequenceTest")->name("testschema.sequence_test"); -$dbh->do("CREATE SCHEMA testschema;"); -$dbh->do("CREATE TABLE testschema.artist (artistid serial PRIMARY KEY, name VARCHAR(100), charfield CHAR(10));"); -$dbh->do("CREATE TABLE testschema.sequence_test (pkid1 integer, pkid2 integer, nonpkid integer, name VARCHAR(100), CONSTRAINT pk PRIMARY KEY(pkid1, pkid2));"); -$dbh->do("CREATE SEQUENCE pkid1_seq START 1 MAXVALUE 999999 MINVALUE 0"); -$dbh->do("CREATE SEQUENCE pkid2_seq START 10 MAXVALUE 999999 MINVALUE 0"); -$dbh->do("CREATE SEQUENCE nonpkid_seq START 20 MAXVALUE 999999 MINVALUE 0"); -ok ( $dbh->do('CREATE TABLE testschema.casecheck (id serial PRIMARY KEY, "name" VARCHAR(1), "NAME" VARCHAR(2), "UC_NAME" VARCHAR(3));'), 'Creation of casecheck table'); +{ + local $SIG{__WARN__} = sub {}; + $dbh->do("CREATE SCHEMA testschema;"); + $dbh->do("CREATE TABLE testschema.artist (artistid serial PRIMARY KEY, name VARCHAR(100), charfield CHAR(10));"); + $dbh->do("CREATE TABLE testschema.sequence_test (pkid1 integer, pkid2 integer, nonpkid integer, name VARCHAR(100), CONSTRAINT pk PRIMARY KEY(pkid1, pkid2));"); + $dbh->do("CREATE SEQUENCE pkid1_seq START 1 MAXVALUE 999999 MINVALUE 0"); + $dbh->do("CREATE SEQUENCE pkid2_seq START 10 MAXVALUE 999999 MINVALUE 0"); + $dbh->do("CREATE SEQUENCE nonpkid_seq START 20 MAXVALUE 999999 MINVALUE 0"); + ok ( $dbh->do('CREATE TABLE testschema.casecheck (id serial PRIMARY KEY, "name" VARCHAR(1), "NAME" VARCHAR(2), "UC_NAME" VARCHAR(3));'), 'Creation of casecheck table'); +} # This is in Core now, but it's here just to test that it doesn't break $schema->class('Artist')->load_components('PK::Auto'); diff --git a/t/98savepoints.t b/t/98savepoints.t index 8e85f20..28b00cf 100644 --- a/t/98savepoints.t +++ b/t/98savepoints.t @@ -30,7 +30,11 @@ $schema->storage->debugobj($stats); $schema->storage->debug(1); -$schema->storage->dbh->do ($create_sql); +{ + local $SIG{__WARN__} = sub {}; + $schema->storage->dbh->do ('DROP TABLE IF EXISTS artist'); + $schema->storage->dbh->do ($create_sql); +} $schema->resultset('Artist')->create({ name => 'foo' }); diff --git a/t/bindtype_columns.t b/t/bindtype_columns.t index 5b83255..8edf7af 100644 --- a/t/bindtype_columns.t +++ b/t/bindtype_columns.t @@ -16,16 +16,18 @@ my $schema = DBICTest::Schema->connection($dsn, $dbuser, $dbpass, { AutoCommit = my $dbh = $schema->storage->dbh; -$dbh->do(qq[ - - CREATE TABLE artist - ( - artistid serial NOT NULL PRIMARY KEY, - media bytea NOT NULL, - name varchar NULL - ); -],{ RaiseError => 1, PrintError => 1 }); - +{ + local $SIG{__WARN__} = sub {}; + $dbh->do('DROP TABLE IF EXISTS artist'); + $dbh->do(qq[ + CREATE TABLE artist + ( + artistid serial NOT NULL PRIMARY KEY, + media bytea NOT NULL, + name varchar NULL + ); + ],{ RaiseError => 1, PrintError => 1 }); +} $schema->class('Artist')->load_components(qw/