From 0829560b4978b2161bed713ccad8697b80c4af74 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 4 May 2022 12:39:02 +0100 Subject: [PATCH] Bug 23681: DBIC Rebuild Signed-off-by: Katrin Fischer --- Koha/Schema/Result/BorrowerDebarment.pm | 34 ++++++++++++++++--------- Koha/Schema/Result/DebarmentType.pm | 16 +++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Koha/Schema/Result/BorrowerDebarment.pm b/Koha/Schema/Result/BorrowerDebarment.pm index 4f1921b5dd..7c27d56d30 100644 --- a/Koha/Schema/Result/BorrowerDebarment.pm +++ b/Koha/Schema/Result/BorrowerDebarment.pm @@ -49,12 +49,12 @@ expiration date of the restriction =head2 type - data_type: 'enum' - default_value: 'MANUAL' - extra: {list => ["SUSPENSION","OVERDUES","MANUAL","DISCHARGE"]} + data_type: 'varchar' + is_foreign_key: 1 is_nullable: 0 + size: 50 -type of restriction +type of restriction, FK to debarment_types.code =head2 comment @@ -97,12 +97,7 @@ __PACKAGE__->add_columns( "expiration", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "type", - { - data_type => "enum", - default_value => "MANUAL", - extra => { list => ["SUSPENSION", "OVERDUES", "MANUAL", "DISCHARGE"] }, - is_nullable => 0, - }, + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 50 }, "comment", { data_type => "mediumtext", is_nullable => 1 }, "manager_id", @@ -151,9 +146,24 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 type + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "type", + "Koha::Schema::Result::DebarmentType", + { code => "type" }, + { is_deferrable => 1, on_delete => "NO ACTION", on_update => "CASCADE" }, +); + -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vQL2xYGB5GI//2l4FdIR9w +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-04 11:05:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bxRDwUTv9cZVpDfNDatosQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/DebarmentType.pm b/Koha/Schema/Result/DebarmentType.pm index ace5fa7592..0f83c3c92b 100644 --- a/Koha/Schema/Result/DebarmentType.pm +++ b/Koha/Schema/Result/DebarmentType.pm @@ -40,13 +40,7 @@ __PACKAGE__->table("debarment_types"); default_value: 0 is_nullable: 0 -=head2 default_value - - data_type: 'tinyint' - default_value: 0 - is_nullable: 0 - -=head2 can_be_added_manually +=head2 is_default data_type: 'tinyint' default_value: 0 @@ -61,9 +55,7 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0 }, "is_system", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, - "default_value", - { data_type => "tinyint", default_value => 0, is_nullable => 0 }, - "can_be_added_manually", + "is_default", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); @@ -97,8 +89,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-03 12:20:02 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VBzvGmNZebCYqcjaR7ETPg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-04 11:05:19 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cRSViJItfpT3mxCX82/9eQ sub koha_object_class { 'Koha::RestrictionType'; -- 2.30.2