From 3df7a02d8198e7a0a0af5459c4c3d2192177b27f Mon Sep 17 00:00:00 2001 From: Mason James Date: Tue, 27 Oct 2020 07:41:03 +1300 Subject: [PATCH] Bug 18050: move aqbudgetperiods table before aqbudgets, to fix sql error 00:02:16.310 koha_1 | DBD::mysql::st execute failed: Can't create table `koha_kohadev`.`aqbudgets` (errno: 150 "Foreign key constraint is incorrectly formed") at /usr/share/perl5/DBIx/RunSQL.pm line 278, <$args{...}> line 1. 00:02:16.310 koha_1 | Something went wrong loading file /kohadevbox/koha/installer/data/mysql/kohastructure.sql ([SQL ERROR]: CREATE TABLE `aqbudgets` ( -- information related to Funds Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/kohastructure.sql | 37 +++++++++++++------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 45d7b03af92..0ed6bc202e2 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2899,6 +2899,24 @@ CREATE TABLE `aqbasketgroups` ( CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `aqbudgetperiods` +-- + +DROP TABLE IF EXISTS `aqbudgetperiods`; +CREATE TABLE `aqbudgetperiods` ( -- information related to Budgets + `budget_period_id` int(11) NOT NULL auto_increment, -- primary key and unique number assigned by Koha + `budget_period_startdate` date NOT NULL, -- date when the budget starts + `budget_period_enddate` date NOT NULL, -- date when the budget ends + `budget_period_active` tinyint(1) default '0', -- whether this budget is active or not (1 for yes, 0 for no) + `budget_period_description` LONGTEXT, -- description assigned to this budget + `budget_period_total` decimal(28,6), -- total amount available in this budget + `budget_period_locked` tinyint(1) default NULL, -- whether this budget is locked or not (1 for yes, 0 for no) + `sort1_authcat` varchar(10) default NULL, -- statistical category for this budget + `sort2_authcat` varchar(10) default NULL, -- second statistical category for this budget + PRIMARY KEY (`budget_period_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `aqbudgets` -- @@ -2946,25 +2964,6 @@ CREATE TABLE aqbudgetborrowers ( ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --- --- Table structure for table `aqbudgetperiods` --- - - -DROP TABLE IF EXISTS `aqbudgetperiods`; -CREATE TABLE `aqbudgetperiods` ( -- information related to Budgets - `budget_period_id` int(11) NOT NULL auto_increment, -- primary key and unique number assigned by Koha - `budget_period_startdate` date NOT NULL, -- date when the budget starts - `budget_period_enddate` date NOT NULL, -- date when the budget ends - `budget_period_active` tinyint(1) default '0', -- whether this budget is active or not (1 for yes, 0 for no) - `budget_period_description` LONGTEXT, -- description assigned to this budget - `budget_period_total` decimal(28,6), -- total amount available in this budget - `budget_period_locked` tinyint(1) default NULL, -- whether this budget is locked or not (1 for yes, 0 for no) - `sort1_authcat` varchar(10) default NULL, -- statistical category for this budget - `sort2_authcat` varchar(10) default NULL, -- second statistical category for this budget - PRIMARY KEY (`budget_period_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -- -- Table structure for table `aqbudgets_planning` -- -- 2.29.1