remove is_deferrable from default rel options to maintain principle of least surprise...
Matt S Trout [Wed, 21 Apr 2010 13:08:53 +0000 (14:08 +0100)]
Changes
lib/DBIx/Class/Schema/Loader/RelBuilder.pm
t/lib/dbixcsl_common_tests.pm

diff --git a/Changes b/Changes
index 9c53032..7f318b3 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
 Revision history for Perl extension DBIx::Class::Schema::Loader
 
+        - remove is_deferrable from default rel options to maintain
+          principle of least surprise when round-tripping to deploy()
         - rewrite datetime default functions as \'CURRENT_TIMESTAMP' where
           possible (except for Sybase ASE) to ease cross-deployment
         - use column_info instead of select to get Oracle column list (RT#42281)
index bbc424d..a6f4ebe 100644 (file)
@@ -163,7 +163,6 @@ sub _default_relationship_attrs { +{
     belongs_to => {
         on_delete => 'CASCADE',
         on_update => 'CASCADE',
-        is_deferrable => 1,
     },
 } }
 
index 676e58e..66c9ac7 100644 (file)
@@ -595,8 +595,8 @@ sub test_schema {
         is $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{on_update}, 'CASCADE',
             "on_update => 'CASCADE' on belongs_to by default";
 
-        is $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{is_deferrable}, 1,
-            "is_deferrable => 1 on belongs_to by default";
+        ok ((not exists $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{is_deferrable}),
+            'belongs_to does not have is_deferrable');
 
         ok ((not exists $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{cascade_delete}),
             'belongs_to does not have cascade_delete');