From 7d6fc1ec20f4f01497226bc6ee72849005c4d9e4 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 (cherry picked from commit 3df7a02d8198e7a0a0af5459c4c3d2192177b27f) Signed-off-by: Lucas Gass (cherry picked from commit 694f5ee9d8b21532c04598498e10f9f6c7e542c0) Signed-off-by: Aleisha Amohia (cherry picked from commit 3c488266373ab3be3c96e0966bd0c29f6d41d9f4) Signed-off-by: Victor Grousset/tuxayo --- 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 1eb270c379..60d1886e79 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2826,6 +2826,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` -- @@ -2873,25 +2891,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.39.5