From ff66171ee289b5352c1633ef74f79d3d335ff241 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 11 Oct 2019 12:33:55 +0100 Subject: [PATCH] Bug 23049: (follow-up) VARCHAR(80) + ac -> account MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine QUEUNE Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- Koha/Account/DebitType.pm | 2 +- Koha/Schema/Result/Accountline.pm | 8 ++++---- Koha/Schema/Result/Branch.pm | 12 ++++++------ .../data/mysql/atomicupdate/bug_23049_debit.perl | 12 ++++++------ installer/data/mysql/kohastructure.sql | 12 ++++++------ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Koha/Account/DebitType.pm b/Koha/Account/DebitType.pm index 6324ec57cb..123dce1926 100644 --- a/Koha/Account/DebitType.pm +++ b/Koha/Account/DebitType.pm @@ -68,7 +68,7 @@ sub _library_limits { =cut sub _type { - return 'AccountDebitType'; + return 'AccountDebitTypesBranch'; } 1; diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm index 48b3dca958..a30290dcab 100644 --- a/Koha/Schema/Result/Accountline.pm +++ b/Koha/Schema/Result/Accountline.pm @@ -74,7 +74,7 @@ __PACKAGE__->table("accountlines"); data_type: 'varchar' is_foreign_key: 1 is_nullable: 1 - size: 64 + size: 80 =head2 status @@ -151,7 +151,7 @@ __PACKAGE__->add_columns( "accounttype", { data_type => "varchar", is_nullable => 1, size => 80 }, "debit_type_code", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 64 }, + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 }, "status", { data_type => "varchar", is_nullable => 1, size => 16 }, "payment_type", @@ -342,8 +342,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-08 11:15:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1Vgkg0JR7RqmkniOmUoUhQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WZ2Mcd5gwQc69yDSEsJHGA sub koha_objects_class { 'Koha::Account::Lines'; diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index fa9679eb2e..579edb8e39 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -211,17 +211,17 @@ __PACKAGE__->set_primary_key("branchcode"); =head1 RELATIONS -=head2 ac_debit_types_branches +=head2 account_debit_types_branches Type: has_many -Related object: L +Related object: L =cut __PACKAGE__->has_many( - "ac_debit_types_branches", - "Koha::Schema::Result::AcDebitTypesBranch", + "account_debit_types_branches", + "Koha::Schema::Result::AccountDebitTypesBranch", { "foreign.branchcode" => "self.branchcode" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -692,8 +692,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-09-26 15:59:23 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IiEBfDpMBAi9cv7OqevVRQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HCQKMSgKhVKtDSrvs1IeRg __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 } diff --git a/installer/data/mysql/atomicupdate/bug_23049_debit.perl b/installer/data/mysql/atomicupdate/bug_23049_debit.perl index 8e250af5e6..4b190521a2 100644 --- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl +++ b/installer/data/mysql/atomicupdate/bug_23049_debit.perl @@ -5,7 +5,7 @@ if ( CheckVersion($DBversion) ) { $dbh->do( qq{ CREATE TABLE IF NOT EXISTS account_debit_types ( - code varchar(64) NOT NULL, + code varchar(80) NOT NULL, description varchar(200) NULL, can_be_added_manually tinyint(4) NOT NULL DEFAULT 1, default_amount decimal(28, 6) NULL, @@ -15,11 +15,11 @@ if ( CheckVersion($DBversion) ) { } ); - # Adding ac_debit_types_branches + # Adding account_debit_types_branches $dbh->do( qq{ - CREATE TABLE IF NOT EXISTS ac_debit_types_branches ( - debit_type_code VARCHAR(64), + CREATE TABLE IF NOT EXISTS account_debit_types_branches ( + debit_type_code VARCHAR(80), branchcode VARCHAR(10), FOREIGN KEY (debit_type_code) REFERENCES account_debit_types(code) ON DELETE CASCADE, FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE @@ -93,7 +93,7 @@ if ( CheckVersion($DBversion) ) { is_system ) SELECT - SUBSTR(authorised_value, 1, 64), + SUBSTR(authorised_value, 1, 80), lib, authorised_value, 1, @@ -111,7 +111,7 @@ if ( CheckVersion($DBversion) ) { qq{ ALTER IGNORE TABLE accountlines ADD - debit_type_code varchar(64) DEFAULT NULL + debit_type_code varchar(80) DEFAULT NULL AFTER accounttype } diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3b0bffc0d8..67b087e8f9 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2627,7 +2627,7 @@ CREATE TABLE `cash_registers` ( DROP TABLE IF EXISTS `account_debit_types`; CREATE TABLE `account_debit_types` ( - `code` varchar(64) NOT NULL, + `code` varchar(80) NOT NULL, `description` varchar(200) DEFAULT NULL, `can_be_added_manually` tinyint(4) NOT NULL DEFAULT 1, `default_amount` decimal(28,6) DEFAULT NULL, @@ -2636,12 +2636,12 @@ CREATE TABLE `account_debit_types` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- --- Table structure for table `ac_debit_types_branches` +-- Table structure for table `account_debit_types_branches` -- -DROP TABLE IF EXISTS `ac_debit_types_branches`; -CREATE TABLE `ac_debit_types_branches` ( - `debit_type_code` VARCHAR(64), +DROP TABLE IF EXISTS `account_debit_types_branches`; +CREATE TABLE `account_debit_types_branches` ( + `debit_type_code` VARCHAR(80), `branchcode` VARCHAR(10), FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE, FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE @@ -2661,7 +2661,7 @@ CREATE TABLE `accountlines` ( `amount` decimal(28,6) default NULL, `description` LONGTEXT, `accounttype` varchar(80) default NULL, - `debit_type_code` varchar(64) default NULL, + `debit_type_code` varchar(80) default NULL, `status` varchar(16) default NULL, `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE `amountoutstanding` decimal(28,6) default NULL, -- 2.39.2