From a364bb15a7c7c49017d0a928bbe9e02038231419 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 5 Dec 2017 14:09:23 -0300 Subject: [PATCH] Bug 16735: DBIC Schema files Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- Koha/Schema/Result/Branch.pm | 29 ++---------------------- Koha/Schema/Result/LibraryGroup.pm | 36 +++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 37451a5870..2d0276ff30 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -308,21 +308,6 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 branchrelations - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "branchrelations", - "Koha::Schema::Result::Branchrelation", - { "foreign.branchcode" => "self.branchcode" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - =head2 branchtransfers_frombranches Type: has_many @@ -623,19 +608,9 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 categorycodes - -Type: many_to_many - -Composing rels: L -> categorycode - -=cut - -__PACKAGE__->many_to_many("categorycodes", "branchrelations", "categorycode"); - -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-12-05 14:04:50 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Q87CSY+yexoxL37pfm3kgg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-12-05 14:08:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g+WicMjGntjAgcKrbn4IdQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/LibraryGroup.pm b/Koha/Schema/Result/LibraryGroup.pm index aa1b541299..9e4d53d561 100644 --- a/Koha/Schema/Result/LibraryGroup.pm +++ b/Koha/Schema/Result/LibraryGroup.pm @@ -55,15 +55,16 @@ __PACKAGE__->table("library_groups"); =head2 created_on - data_type: 'datetime' + data_type: 'timestamp' datetime_undef_if_invalid: 1 - is_nullable: 0 + is_nullable: 1 =head2 updated_on - data_type: 'datetime' + data_type: 'timestamp' datetime_undef_if_invalid: 1 - is_nullable: 1 + default_value: current_timestamp + is_nullable: 0 =cut @@ -80,15 +81,16 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 1 }, "created_on", { - data_type => "datetime", + data_type => "timestamp", datetime_undef_if_invalid => 1, - is_nullable => 0, + is_nullable => 1, }, "updated_on", { - data_type => "datetime", + data_type => "timestamp", datetime_undef_if_invalid => 1, - is_nullable => 1, + default_value => \"current_timestamp", + is_nullable => 0, }, ); @@ -104,6 +106,20 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("title", ["title"]); + =head1 RELATIONS =head2 branchcode @@ -162,8 +178,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-12-05 14:04:50 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p4hmm+ciFgPOGlAMvNB6Yw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-09 16:27:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7JN93utlgFEyQhE9BMx1QQ # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.39.5