[Bast-commits] r4214 - in DBIx-Class/0.08/trunk: lib/SQL/Translator/Parser/DBIx t t/lib/DBICTest/Schema

ash at dev.catalyst.perl.org ash at dev.catalyst.perl.org
Mon Mar 17 21:56:47 GMT 2008


Author: ash
Date: 2008-03-17 21:56:47 +0000 (Mon, 17 Mar 2008)
New Revision: 4214

Modified:
   DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm
   DBIx-Class/0.08/trunk/t/86sqlt.t
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/TwoKeys.pm
Log:
Fix test to reflect correct default state for deferrable constraints in SQL::T

Modified: DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm	2008-03-17 21:46:07 UTC (rev 4213)
+++ DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm	2008-03-17 21:56:47 UTC (rev 4214)
@@ -185,7 +185,7 @@
                                     reference_table  => $rel_table,
                                     on_delete        => $on_delete,
                                     on_update        => $on_update,
-                                    defined $is_deferrable ? ( deferrable => $is_deferrable ) : (),
+                                    (defined $is_deferrable ? ( deferrable => $is_deferrable ) : ()),
                   );
                     
                   my $index = $table->add_index(

Modified: DBIx-Class/0.08/trunk/t/86sqlt.t
===================================================================
--- DBIx-Class/0.08/trunk/t/86sqlt.t	2008-03-17 21:46:07 UTC (rev 4213)
+++ DBIx-Class/0.08/trunk/t/86sqlt.t	2008-03-17 21:56:47 UTC (rev 4214)
@@ -48,7 +48,7 @@
       'display' => 'twokeys->artist',
       'selftable' => 'twokeys', 'foreigntable' => 'artist', 
       'selfcols'  => ['artist'], 'foreigncols' => ['artistid'],
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],
 
@@ -58,14 +58,14 @@
       'display' => 'fourkeys_to_twokeys->twokeys',
       'selftable' => 'fourkeys_to_twokeys', 'foreigntable' => 'twokeys', 
       'selfcols'  => ['t_artist', 't_cd'], 'foreigncols' => ['artist', 'cd'], 
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
     {
       'display' => 'fourkeys_to_twokeys->fourkeys',
       'selftable' => 'fourkeys_to_twokeys', 'foreigntable' => 'fourkeys', 
       'selfcols'  => [qw(f_foo f_bar f_hello f_goodbye)],
       'foreigncols' => [qw(foo bar hello goodbye)], 
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],
 
@@ -75,13 +75,13 @@
       'display' => 'cd_to_producer->cd',
       'selftable' => 'cd_to_producer', 'foreigntable' => 'cd', 
       'selfcols'  => ['cd'], 'foreigncols' => ['cdid'],
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
     {
       'display' => 'cd_to_producer->producer',
       'selftable' => 'cd_to_producer', 'foreigntable' => 'producer', 
       'selfcols'  => ['producer'], 'foreigncols' => ['producerid'],
-      on_delete => '', on_update => '', deferrable => 0,
+      on_delete => '', on_update => '', deferrable => 1,
     },
   ],
 
@@ -91,13 +91,13 @@
       'display' => 'self_ref_alias->self_ref for self_ref',
       'selftable' => 'self_ref_alias', 'foreigntable' => 'self_ref', 
       'selfcols'  => ['self_ref'], 'foreigncols' => ['id'],
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
     {
       'display' => 'self_ref_alias->self_ref for alias',
       'selftable' => 'self_ref_alias', 'foreigntable' => 'self_ref', 
       'selfcols'  => ['alias'], 'foreigncols' => ['id'],
-      on_delete => '', on_update => '', deferrable => 0,
+      on_delete => '', on_update => '', deferrable => 1,
     },
   ],
 
@@ -117,13 +117,13 @@
       'display' => 'artist_undirected_map->artist for id1',
       'selftable' => 'artist_undirected_map', 'foreigntable' => 'artist', 
       'selfcols'  => ['id1'], 'foreigncols' => ['artistid'],
-      on_delete => 'CASCADE', on_update => '', deferrable => 0,
+      on_delete => 'CASCADE', on_update => '', deferrable => 1,
     },
     {
       'display' => 'artist_undirected_map->artist for id2',
       'selftable' => 'artist_undirected_map', 'foreigntable' => 'artist', 
       'selfcols'  => ['id2'], 'foreigncols' => ['artistid'],
-      on_delete => 'CASCADE', on_update => '', deferrable => 0,
+      on_delete => 'CASCADE', on_update => '', deferrable => 1,
     },
   ],
 
@@ -133,7 +133,7 @@
       'display' => 'track->cd',
       'selftable' => 'track', 'foreigntable' => 'cd', 
       'selfcols'  => ['cd'], 'foreigncols' => ['cdid'],
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],
 
@@ -143,7 +143,7 @@
       'display' => 'treelike->treelike for parent',
       'selftable' => 'treelike', 'foreigntable' => 'treelike', 
       'selfcols'  => ['parent'], 'foreigncols' => ['id'],
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],
 
@@ -153,7 +153,7 @@
       'display' => 'twokeytreelike->twokeytreelike for parent1,parent2',
       'selftable' => 'twokeytreelike', 'foreigntable' => 'twokeytreelike', 
       'selfcols'  => ['parent1', 'parent2'], 'foreigncols' => ['id1','id2'],
-      on_delete => '', on_update => '', deferrable => 0,
+      on_delete => '', on_update => '', deferrable => 1,
     },
   ],
 
@@ -163,7 +163,7 @@
       'display' => 'tags->cd',
       'selftable' => 'tags', 'foreigntable' => 'cd', 
       'selfcols'  => ['cd'], 'foreigncols' => ['cdid'],
-      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 0,
+      on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1,
     },
   ],
 
@@ -173,7 +173,7 @@
       'display' => 'bookmark->link',
       'selftable' => 'bookmark', 'foreigntable' => 'link', 
       'selfcols'  => ['link'], 'foreigncols' => ['id'],
-      on_delete => '', on_update => '', deferrable => 0,
+      on_delete => '', on_update => '', deferrable => 1,
     },
   ],
   # ForceForeign
@@ -182,7 +182,7 @@
       'display' => 'forceforeign->artist',
       'selftable' => 'forceforeign', 'foreigntable' => 'artist', 
       'selfcols'  => ['artist'], 'foreigncols' => ['artist_id'], 
-      on_delete => '', on_update => '', deferrable => 0,
+      on_delete => '', on_update => '', deferrable => 1,
     },
   ],
 

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/TwoKeys.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/TwoKeys.pm	2008-03-17 21:46:07 UTC (rev 4213)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/TwoKeys.pm	2008-03-17 21:56:47 UTC (rev 4214)
@@ -11,7 +11,7 @@
 __PACKAGE__->set_primary_key(qw/artist cd/);
 
 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' );
+__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0 } );
 
 __PACKAGE__->has_many(
   'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', {




More information about the Bast-commits mailing list