From: Rafael Kitover Date: Thu, 22 Apr 2010 00:45:43 +0000 (-0400) Subject: revert 45a380dc2d68e828de4011b99f0c3739db5b0707 X-Git-Tag: 0.07000~56 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f19ef97a87c61eab5e67c0225a62e73d5a9f99b;p=dbsrgits%2FDBIx-Class-Schema-Loader.git revert 45a380dc2d68e828de4011b99f0c3739db5b0707 --- diff --git a/Changes b/Changes index f6da418..8f58d78 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,5 @@ 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() - support CamelCase table names - rewrite datetime default functions as \'CURRENT_TIMESTAMP' where possible (except for Sybase ASE) to ease cross-deployment diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 5e83da5..e6a2c92 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -163,6 +163,7 @@ 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 546e072..283805d 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -604,8 +604,8 @@ sub test_schema { is $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{on_update}, 'CASCADE', "on_update => 'CASCADE' 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'); + 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}{cascade_delete}), 'belongs_to does not have cascade_delete');