[Bast-commits] r5083 - in DBIx-Class/0.08/trunk/t: . lib lib/DBICTest/Schema

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sun Nov 9 15:29:34 GMT 2008


Author: ribasushi
Date: 2008-11-09 15:29:34 +0000 (Sun, 09 Nov 2008)
New Revision: 5083

Modified:
   DBIx-Class/0.08/trunk/t/66relationship.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/86sqlt.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/DBICTest/Schema/CD.pm
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Event.pm
   DBIx-Class/0.08/trunk/t/lib/sqlite.sql
Log:
Some testdb changes and alignment, preparing for test refactor branch

Modified: DBIx-Class/0.08/trunk/t/66relationship.t
===================================================================
--- DBIx-Class/0.08/trunk/t/66relationship.t	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/66relationship.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -128,8 +128,8 @@
 is($newartist->name, 'Random Boy Band Two', 'find_or_new_related new artist record with id');
 is($newartist->id, 200, 'find_or_new_related new artist id set');
 
-SKIP: {
-  skip "relationship checking needs fixing", 1;
+TODO: {
+  local $TODO = "relationship checking needs fixing";
   # try to add a bogus relationship using the wrong cols
   eval {
       DBICTest::Schema::Artist->add_relationship(

Modified: DBIx-Class/0.08/trunk/t/71mysql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/71mysql.t	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/71mysql.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -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), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
 
 #'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', '');
 
@@ -57,7 +57,7 @@
     'name' => {
         'data_type' => 'VARCHAR',
         'is_nullable' => 1,
-        'size' => 255,
+        'size' => 100,
         'default_value' => undef,
     },
     'rank' => {

Modified: DBIx-Class/0.08/trunk/t/746mssql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/746mssql.t	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/746mssql.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -24,7 +24,7 @@
     $dbh->do(<<'');
 CREATE TABLE artist (
    artistid INT IDENTITY NOT NULL,
-   name VARCHAR(255),
+   name VARCHAR(100),
    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-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/74mssql.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -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), rank INT DEFAULT '13');");
+$dbh->do("CREATE TABLE artist (artistid INT IDENTITY PRIMARY KEY, name VARCHAR(100), rank INT DEFAULT '13', charfield CHAR(10) NULL);");
 $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/86sqlt.t
===================================================================
--- DBIx-Class/0.08/trunk/t/86sqlt.t	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/86sqlt.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -126,7 +126,7 @@
       'name' => 'cd_fk_artist', 'index_name' => 'cd_idx_artist',
       'selftable' => 'cd', 'foreigntable' => 'artist', 
       'selfcols'  => ['artist'], 'foreigncols' => ['artistid'],
-      on_delete => '', on_update => 'SET NULL', deferrable => 1,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],
 

Modified: DBIx-Class/0.08/trunk/t/93nobindvars.t
===================================================================
--- DBIx-Class/0.08/trunk/t/93nobindvars.t	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/93nobindvars.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -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), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), 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-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/98savepoints.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -15,7 +15,7 @@
 } 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), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10)) ENGINE=InnoDB";
+  $create_sql = "CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), 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-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/bindtype_columns.t	2008-11-09 15:29:34 UTC (rev 5083)
@@ -22,10 +22,11 @@
     $dbh->do(qq[
         CREATE TABLE artist
         (
-            artistid        serial  NOT NULL    PRIMARY KEY,
-            media           bytea   NOT NULL,
-            name            varchar NULL,
-            rank            integer NOT NULL    DEFAULT '13'
+            artistid        serial       NOT NULL   PRIMARY KEY,
+            media           bytea        NOT NULL,
+            name            varchar(100) NULL,
+            rank            integer NOT  NULL       DEFAULT '13',
+            charfield       char(10)     NULL
         );
     ],{ 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-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artist.pm	2008-11-09 15:29:34 UTC (rev 5083)
@@ -23,6 +23,11 @@
     data_type => 'integer',
     default_value => 13,
   },
+  charfield => {
+    data_type => 'char',
+    size => 10,
+    is_nullable => 1,
+  },
 );
 __PACKAGE__->set_primary_key('artistid');
 

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm	2008-11-09 15:29:34 UTC (rev 5083)
@@ -30,8 +30,6 @@
 
 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, { 
     is_deferrable => 1, 
-    on_delete => undef,
-    on_update => 'SET NULL',
 });
 
 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
@@ -55,7 +53,12 @@
 
 __PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
     { 'foreign.genreid' => 'self.genreid' },
-    { join_type => 'left' },
+    {
+        join_type => 'left',
+        on_delete => 'SET NULL',
+        on_update => 'CASCADE',
+
+    },
 );
 
 #__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Event.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Event.pm	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Event.pm	2008-11-09 15:29:34 UTC (rev 5083)
@@ -14,7 +14,7 @@
   created_on => { data_type => 'timestamp' },
   varchar_date => { data_type => 'varchar', inflate_date => 1, size => 20, is_nullable => 1 },
   varchar_datetime => { data_type => 'varchar', inflate_datetime => 1, size => 20, is_nullable => 1 },
-  skip_inflation => { data_type => 'datetime', inflate_datetime => 0, size => 20, is_nullable => 1 },
+  skip_inflation => { data_type => 'datetime', inflate_datetime => 0, is_nullable => 1 },
 );
 
 __PACKAGE__->set_primary_key('id');

Modified: DBIx-Class/0.08/trunk/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/sqlite.sql	2008-11-09 15:27:40 UTC (rev 5082)
+++ DBIx-Class/0.08/trunk/t/lib/sqlite.sql	2008-11-09 15:29:34 UTC (rev 5083)
@@ -1,6 +1,6 @@
 -- 
 -- Created by SQL::Translator::Producer::SQLite
--- Created on Sun Nov  2 15:27:04 2008
+-- Created on Sun Nov  9 16:28:17 2008
 -- 
 BEGIN TRANSACTION;
 
@@ -11,7 +11,8 @@
 CREATE TABLE artist (
   artistid INTEGER PRIMARY KEY NOT NULL,
   name varchar(100),
-  rank integer NOT NULL DEFAULT '13'
+  rank integer NOT NULL DEFAULT '13',
+  charfield char(10)
 );
 
 
@@ -118,7 +119,7 @@
   created_on timestamp NOT NULL,
   varchar_date varchar(20),
   varchar_datetime varchar(20),
-  skip_inflation datetime(20)
+  skip_inflation datetime
 );
 
 




More information about the Bast-commits mailing list