From 1f781934411ee5fd8a240ba2e3572ae1444d8e51 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 21 Jun 2021 16:41:54 +0100 Subject: [PATCH] Bug 22435: Update DBIC Schema's Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/AccountOffset.pm | 38 ++++++------- Koha/Schema/Result/AccountOffsetType.pm | 76 ------------------------- 2 files changed, 17 insertions(+), 97 deletions(-) delete mode 100644 Koha/Schema/Result/AccountOffsetType.pm diff --git a/Koha/Schema/Result/AccountOffset.pm b/Koha/Schema/Result/AccountOffset.pm index 0bde09394c..1b1e4bea09 100644 --- a/Koha/Schema/Result/AccountOffset.pm +++ b/Koha/Schema/Result/AccountOffset.pm @@ -49,10 +49,9 @@ The id of the accountline that decreased the patron's balance =head2 type - data_type: 'varchar' - is_foreign_key: 1 + data_type: 'enum' + extra: {list => ["CREATE","APPLY","VOID","OVERDUE_INCREASE","OVERDUE_DECREASE"]} is_nullable: 0 - size: 16 The type of offset this is @@ -81,7 +80,19 @@ __PACKAGE__->add_columns( "debit_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "type", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 16 }, + { + data_type => "enum", + extra => { + list => [ + "CREATE", + "APPLY", + "VOID", + "OVERDUE_INCREASE", + "OVERDUE_DECREASE", + ], + }, + is_nullable => 0, + }, "amount", { data_type => "decimal", is_nullable => 0, size => [26, 6] }, "created_on", @@ -147,24 +158,9 @@ __PACKAGE__->belongs_to( }, ); -=head2 type - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "type", - "Koha::Schema::Result::AccountOffsetType", - { type => "type" }, - { is_deferrable => 1, on_delete => "CASCADE", 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:d6cqxL2VddjOmUqe3nLptw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-06-21 15:27:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zCeE/SWvdz898zlfcvfRGg sub koha_object_class { 'Koha::Account::Offset'; diff --git a/Koha/Schema/Result/AccountOffsetType.pm b/Koha/Schema/Result/AccountOffsetType.pm deleted file mode 100644 index f046b81197..0000000000 --- a/Koha/Schema/Result/AccountOffsetType.pm +++ /dev/null @@ -1,76 +0,0 @@ -use utf8; -package Koha::Schema::Result::AccountOffsetType; - -# Created by DBIx::Class::Schema::Loader -# DO NOT MODIFY THE FIRST PART OF THIS FILE - -=head1 NAME - -Koha::Schema::Result::AccountOffsetType - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("account_offset_types"); - -=head1 ACCESSORS - -=head2 type - - data_type: 'varchar' - is_nullable: 0 - size: 16 - -The type of offset this is - -=cut - -__PACKAGE__->add_columns( - "type", - { data_type => "varchar", is_nullable => 0, size => 16 }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("type"); - -=head1 RELATIONS - -=head2 account_offsets - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "account_offsets", - "Koha::Schema::Result::AccountOffset", - { "foreign.type" => "self.type" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - - -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HGUopAaOUF8FcmqQjIrRiw - - -# You can replace this text with custom code or comments, and it will be preserved on regeneration -1; -- 2.20.1