From 622d569143091f9569b4d1c9241b998220be91aa Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 14 Jan 2015 09:54:40 +0100 Subject: [PATCH] Bug 13577: Add the utf8_unicode_ci COLLATE to all tables Bug 11944 added the COLLATE=utf8_unicode_ci to all DB tables. But some new tables have been created between the write of the patch set and the push to master. So these new tables don't have the correct collate. Test plan: 0/ Reproduce the error: mysql> create database koha_test CHARACTER SET utf8 COLLATE utf8_unicode_ci; mysql koha_test < installer/data/mysql/kohastructure.sql It will boom with: ERROR 1005 (HY000) at line 3493: Can't create table `koha_test`.`items_search_fields` (errno: 150 "Foreign key constraint is incorrectly formed") 1/ Apply the patch, destroy the DB and recreate it: mysql> create database koha_test CHARACTER SET utf8 COLLATE utf8_unicode_ci; mysql> drop database koha_test; mysql koha_test < installer/data/mysql/kohastructure.sql All tables should be inserted without any error. --- installer/data/mysql/kohastructure.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index facde44..82868e7 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -371,7 +371,7 @@ CREATE TABLE borrower_sync ( PRIMARY KEY (borrowersyncid), KEY borrowernumber (borrowernumber), CONSTRAINT borrower_sync_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- @@ -3014,7 +3014,7 @@ CREATE TABLE aqcontacts ( PRIMARY KEY (id), CONSTRAINT booksellerid_aqcontacts_fk FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1; -- -- Table structure for table 'aqcontract' @@ -3483,7 +3483,7 @@ CREATE TABLE IF NOT EXISTS columns_settings ( cannot_be_toggled int(1) NOT NULL DEFAULT 0, is_hidden int(1) NOT NULL DEFAULT 0, PRIMARY KEY(module, page, tablename, columnname) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Table structure for table 'items_search_fields' @@ -3500,7 +3500,7 @@ CREATE TABLE items_search_fields ( CONSTRAINT items_search_fields_authorised_values_category FOREIGN KEY (authorised_values_category) REFERENCES authorised_values (category) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -- 2.1.0