[Bast-commits] r4440 - in DBIx-Class/0.08/branches/replication_dedux/t: . lib lib/DBICTest/Schema

jnapiorkowski at dev.catalyst.perl.org jnapiorkowski at dev.catalyst.perl.org
Fri May 30 17:37:56 BST 2008


Author: jnapiorkowski
Date: 2008-05-30 17:37:56 +0100 (Fri, 30 May 2008)
New Revision: 4440

Modified:
   DBIx-Class/0.08/branches/replication_dedux/t/86sqlt.t
   DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest.pm
   DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest/Schema/TreeLike.pm
   DBIx-Class/0.08/branches/replication_dedux/t/lib/sqlite.sql
Log:
reverted unneeded change to field name in Treelike.pm to parent from parent_fk, updated all underlying tests and related bits as requested by Castaway.

Modified: DBIx-Class/0.08/branches/replication_dedux/t/86sqlt.t
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/t/86sqlt.t	2008-05-30 15:59:13 UTC (rev 4439)
+++ DBIx-Class/0.08/branches/replication_dedux/t/86sqlt.t	2008-05-30 16:37:56 UTC (rev 4440)
@@ -153,9 +153,9 @@
   treelike => [
     {
       'display' => 'treelike->treelike for parent',
-      'name' => 'treelike_fk_parent_fk', 'index_name' => 'treelike_idx_parent_fk',
+      'name' => 'treelike_fk_parent', 'index_name' => 'treelike_idx_parent',
       'selftable' => 'treelike', 'foreigntable' => 'treelike', 
-      'selfcols'  => ['parent_fk'], 'foreigncols' => ['id'],
+      'selfcols'  => ['parent'], 'foreigncols' => ['id'],
       on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],

Modified: DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest/Schema/TreeLike.pm
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest/Schema/TreeLike.pm	2008-05-30 15:59:13 UTC (rev 4439)
+++ DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest/Schema/TreeLike.pm	2008-05-30 16:37:56 UTC (rev 4440)
@@ -6,15 +6,15 @@
 __PACKAGE__->table('treelike');
 __PACKAGE__->add_columns(
   'id' => { data_type => 'integer', is_auto_increment => 1 },
-  'parent_fk' => { data_type => 'integer' , is_nullable=>1},
+  'parent' => { data_type => 'integer' , is_nullable=>1},
   'name' => { data_type => 'varchar',
     size      => 100,
  },
 );
 __PACKAGE__->set_primary_key(qw/id/);
 __PACKAGE__->belongs_to('parent', 'TreeLike',
-                          { 'foreign.id' => 'self.parent_fk' });
-__PACKAGE__->has_many('children', 'TreeLike', { 'foreign.parent_fk' => 'self.id' });
+                          { 'foreign.id' => 'self.parent' });
+__PACKAGE__->has_many('children', 'TreeLike', { 'foreign.parent' => 'self.id' });
 
 ## since this is a self referential table we need to do a post deploy hook and get
 ## some data in while constraints are off

Modified: DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest.pm
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest.pm	2008-05-30 15:59:13 UTC (rev 4439)
+++ DBIx-Class/0.08/branches/replication_dedux/t/lib/DBICTest.pm	2008-05-30 16:37:56 UTC (rev 4440)
@@ -229,7 +229,7 @@
     ]);
     
     $schema->populate('TreeLike', [
-        [ qw/id parent_fk name/ ],
+        [ qw/id parent name/ ],
         [ 1, undef, 'root' ],        
         [ 2, 1, 'foo'  ],
         [ 3, 2, 'bar'  ],

Modified: DBIx-Class/0.08/branches/replication_dedux/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/t/lib/sqlite.sql	2008-05-30 15:59:13 UTC (rev 4439)
+++ DBIx-Class/0.08/branches/replication_dedux/t/lib/sqlite.sql	2008-05-30 16:37:56 UTC (rev 4440)
@@ -151,7 +151,7 @@
 --
 CREATE TABLE treelike (
   id INTEGER PRIMARY KEY NOT NULL,
-  parent_fk integer NULL,
+  parent integer NULL,
   name varchar(100) NOT NULL
 );
 




More information about the Bast-commits mailing list