[Bast-commits] r4835 - DBIx-Class/0.08/branches/warnfree/t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sun Sep 21 23:33:18 BST 2008
Author: ribasushi
Date: 2008-09-21 23:33:18 +0100 (Sun, 21 Sep 2008)
New Revision: 4835
Modified:
DBIx-Class/0.08/branches/warnfree/t/72pg.t
DBIx-Class/0.08/branches/warnfree/t/98savepoints.t
DBIx-Class/0.08/branches/warnfree/t/bindtype_columns.t
Log:
Accomodate postgres being really load on CREATE
Modified: DBIx-Class/0.08/branches/warnfree/t/72pg.t
===================================================================
--- DBIx-Class/0.08/branches/warnfree/t/72pg.t 2008-09-21 22:31:38 UTC (rev 4834)
+++ DBIx-Class/0.08/branches/warnfree/t/72pg.t 2008-09-21 22:33:18 UTC (rev 4835)
@@ -47,13 +47,16 @@
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');
Modified: DBIx-Class/0.08/branches/warnfree/t/98savepoints.t
===================================================================
--- DBIx-Class/0.08/branches/warnfree/t/98savepoints.t 2008-09-21 22:31:38 UTC (rev 4834)
+++ DBIx-Class/0.08/branches/warnfree/t/98savepoints.t 2008-09-21 22:33:18 UTC (rev 4835)
@@ -30,7 +30,11 @@
$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' });
Modified: DBIx-Class/0.08/branches/warnfree/t/bindtype_columns.t
===================================================================
--- DBIx-Class/0.08/branches/warnfree/t/bindtype_columns.t 2008-09-21 22:31:38 UTC (rev 4834)
+++ DBIx-Class/0.08/branches/warnfree/t/bindtype_columns.t 2008-09-21 22:33:18 UTC (rev 4835)
@@ -16,17 +16,19 @@
my $dbh = $schema->storage->dbh;
-$dbh->do(qq[
+{
+ 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 });
+}
- 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/
PK::Auto
More information about the Bast-commits
mailing list