From: Matt S Trout Date: Wed, 21 Apr 2010 13:08:53 +0000 (+0100) Subject: remove is_deferrable from default rel options to maintain principle of least surprise... X-Git-Tag: 0.07000~58 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45a380dc2d68e828de4011b99f0c3739db5b0707;p=dbsrgits%2FDBIx-Class-Schema-Loader.git remove is_deferrable from default rel options to maintain principle of least surprise when roundtripping via deploy() --- diff --git a/Changes b/Changes index 9c53032..7f318b3 100644 --- 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) diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index bbc424d..a6f4ebe 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -163,7 +163,6 @@ sub _default_relationship_attrs { +{ belongs_to => { on_delete => 'CASCADE', on_update => 'CASCADE', - is_deferrable => 1, }, } } diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 676e58e..66c9ac7 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -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');