[Bast-commits] r4911 - in DBIx-Class/0.08/trunk/t: . lib
lib/DBICTest/Schema
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Thu Oct 9 12:47:39 BST 2008
Author: ribasushi
Date: 2008-10-09 12:47:39 +0100 (Thu, 09 Oct 2008)
New Revision: 4911
Modified:
DBIx-Class/0.08/trunk/t/64db.t
DBIx-Class/0.08/trunk/t/71mysql.t
DBIx-Class/0.08/trunk/t/746mssql.t
DBIx-Class/0.08/trunk/t/74mssql.t
DBIx-Class/0.08/trunk/t/93nobindvars.t
DBIx-Class/0.08/trunk/t/98savepoints.t
DBIx-Class/0.08/trunk/t/bindtype_columns.t
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artist.pm
DBIx-Class/0.08/trunk/t/lib/sqlite.sql
Log:
Add new column with a default to Artist, adjust tests as necessary (no functional changes)
Modified: DBIx-Class/0.08/trunk/t/64db.t
===================================================================
--- DBIx-Class/0.08/trunk/t/64db.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/64db.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -39,9 +39,9 @@
# I know this is gross but SQLite reports the size differently from release
# to release. At least this way the test still passes.
-delete $type_info->{artistid}{size};
-delete $type_info->{name}{size};
+delete $type_info->{$_}{size} for keys %$type_info;
+
my $test_type_info = {
'artistid' => {
'data_type' => 'INTEGER',
@@ -51,6 +51,10 @@
'data_type' => 'varchar',
'is_nullable' => 0,
},
+ 'rank' => {
+ 'data_type' => 'integer',
+ 'is_nullable' => 0,
+ },
};
is_deeply($type_info, $test_type_info, 'columns_info_for - column data types');
Modified: DBIx-Class/0.08/trunk/t/71mysql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/71mysql.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/71mysql.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -21,7 +21,7 @@
$dbh->do("DROP TABLE IF EXISTS artist;");
-$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10));");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
#'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', '');
@@ -60,6 +60,12 @@
'size' => 255,
'default_value' => undef,
},
+ 'rank' => {
+ 'data_type' => 'INT',
+ 'is_nullable' => 0,
+ 'size' => 11,
+ 'default_value' => 13,
+ },
'charfield' => {
'data_type' => 'CHAR',
'is_nullable' => 1,
Modified: DBIx-Class/0.08/trunk/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/746mssql.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/746mssql.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -25,6 +25,7 @@
CREATE TABLE artist (
artistid INT IDENTITY NOT NULL,
name VARCHAR(255),
+ rank INT NOT NULL DEFAULT '13',
charfield CHAR(10) NULL,
primary key(artistid)
)
Modified: DBIx-Class/0.08/trunk/t/74mssql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/74mssql.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/74mssql.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -29,7 +29,7 @@
$dbh->do("IF OBJECT_ID('cd', 'U') IS NOT NULL
DROP TABLE cd");
-$dbh->do("CREATE TABLE artist (artistid INT IDENTITY PRIMARY KEY, name VARCHAR(255));");
+$dbh->do("CREATE TABLE artist (artistid INT IDENTITY PRIMARY KEY, name VARCHAR(255), rank INT DEFAULT '13');");
$dbh->do("CREATE TABLE cd (cdid INT IDENTITY PRIMARY KEY, artist INT, title VARCHAR(100), year VARCHAR(100), genreid INT NULL);");
# Just to test compat shim, Auto is in Core
$schema->class('Artist')->load_components('PK::Auto::MSSQL');
Modified: DBIx-Class/0.08/trunk/t/93nobindvars.t
===================================================================
--- DBIx-Class/0.08/trunk/t/93nobindvars.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/93nobindvars.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -40,7 +40,7 @@
$dbh->do("DROP TABLE IF EXISTS artist;");
-$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10));");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
$schema->class('Artist')->load_components('PK::Auto');
Modified: DBIx-Class/0.08/trunk/t/98savepoints.t
===================================================================
--- DBIx-Class/0.08/trunk/t/98savepoints.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/98savepoints.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -11,11 +11,11 @@
if (exists $ENV{DBICTEST_PG_DSN}) {
($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
- $create_sql = "CREATE TABLE artist (artistid serial PRIMARY KEY, name VARCHAR(100), charfield CHAR(10))";
+ $create_sql = "CREATE TABLE artist (artistid serial PRIMARY KEY, name VARCHAR(100), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10))";
} elsif (exists $ENV{DBICTEST_MYSQL_DSN}) {
($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/};
- $create_sql = "CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10)) ENGINE=InnoDB";
+ $create_sql = "CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10)) ENGINE=InnoDB";
} else {
plan skip_all => 'Set DBICTEST_(PG|MYSQL)_DSN _USER and _PASS if you want to run savepoint tests';
}
Modified: DBIx-Class/0.08/trunk/t/bindtype_columns.t
===================================================================
--- DBIx-Class/0.08/trunk/t/bindtype_columns.t 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/bindtype_columns.t 2008-10-09 11:47:39 UTC (rev 4911)
@@ -24,7 +24,8 @@
(
artistid serial NOT NULL PRIMARY KEY,
media bytea NOT NULL,
- name varchar NULL
+ name varchar NULL,
+ rank integer NOT NULL DEFAULT '13'
);
],{ RaiseError => 1, PrintError => 1 });
}
Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artist.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artist.pm 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artist.pm 2008-10-09 11:47:39 UTC (rev 4911)
@@ -19,6 +19,10 @@
size => 100,
is_nullable => 1,
},
+ rank => {
+ data_type => 'integer',
+ default_value => 13,
+ },
);
__PACKAGE__->set_primary_key('artistid');
Modified: DBIx-Class/0.08/trunk/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/sqlite.sql 2008-10-09 11:19:28 UTC (rev 4910)
+++ DBIx-Class/0.08/trunk/t/lib/sqlite.sql 2008-10-09 11:47:39 UTC (rev 4911)
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
--- Created on Thu Oct 9 13:12:46 2008
+-- Created on Thu Oct 9 13:44:56 2008
--
BEGIN TRANSACTION;
@@ -10,7 +10,8 @@
--
CREATE TABLE artist (
artistid INTEGER PRIMARY KEY NOT NULL,
- name varchar(100)
+ name varchar(100),
+ rank integer NOT NULL DEFAULT '13'
);
More information about the Bast-commits
mailing list