utf8 -> utf8mb4

This commit is contained in:
Aleksander Machniak 2021-10-26 11:55:50 +02:00
parent d9cd895321
commit 6ffc15cded
11 changed files with 67 additions and 14 deletions

View file

@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `calendars` (
INDEX `user_name_idx` (`user_id`, `name`), INDEX `user_name_idx` (`user_id`, `name`),
CONSTRAINT `fk_calendars_user_id` FOREIGN KEY (`user_id`) CONSTRAINT `fk_calendars_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `events` ( CREATE TABLE IF NOT EXISTS `events` (
`event_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `event_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `events` (
INDEX `calendar_notify_idx` (`calendar_id`,`notifyat`), INDEX `calendar_notify_idx` (`calendar_id`,`notifyat`),
CONSTRAINT `fk_events_calendar_id` FOREIGN KEY (`calendar_id`) CONSTRAINT `fk_events_calendar_id` FOREIGN KEY (`calendar_id`)
REFERENCES `calendars`(`calendar_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `calendars`(`calendar_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `attachments` ( CREATE TABLE IF NOT EXISTS `attachments` (
`attachment_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `attachment_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS `attachments` (
PRIMARY KEY(`attachment_id`), PRIMARY KEY(`attachment_id`),
CONSTRAINT `fk_attachments_event_id` FOREIGN KEY (`event_id`) CONSTRAINT `fk_attachments_event_id` FOREIGN KEY (`event_id`)
REFERENCES `events`(`event_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `events`(`event_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `itipinvitations` ( CREATE TABLE IF NOT EXISTS `itipinvitations` (
`token` VARCHAR(64) NOT NULL, `token` VARCHAR(64) NOT NULL,
@ -79,6 +79,6 @@ CREATE TABLE IF NOT EXISTS `itipinvitations` (
INDEX `uid_idx` (`user_id`,`event_uid`), INDEX `uid_idx` (`user_id`,`event_uid`),
CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`) CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPLACE INTO `system` (`name`, `value`) VALUES ('calendar-database-version', '2015022700'); REPLACE INTO `system` (`name`, `value`) VALUES ('calendar-database-version', '2021102600');

View file

@ -0,0 +1,24 @@
-- changing table format and dropping foreign keys is needed for some versions of MySQL
ALTER TABLE `calendars` DROP FOREIGN KEY `fk_calendars_user_id`;
ALTER TABLE `events` DROP FOREIGN KEY`fk_events_calendar_id`;
ALTER TABLE `attachments` DROP FOREIGN KEY`fk_attachments_event_id`;
ALTER TABLE `itipinvitations` DROP FOREIGN KEY`fk_itipinvitations_user_id`;
ALTER TABLE `calendars` ROW_FORMAT=DYNAMIC;
ALTER TABLE `events` ROW_FORMAT=DYNAMIC;
ALTER TABLE `attachments` ROW_FORMAT=DYNAMIC;
ALTER TABLE `itipinvitations` ROW_FORMAT=DYNAMIC;
ALTER TABLE `calendars` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `events` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `attachments` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `itipinvitations` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `calendars` ADD CONSTRAINT `fk_calendars_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `events` ADD CONSTRAINT `fk_events_calendar_id` FOREIGN KEY (`calendar_id`)
REFERENCES `calendars`(`calendar_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `attachments` ADD CONSTRAINT `fk_attachments_event_id` FOREIGN KEY (`event_id`)
REFERENCES `events`(`event_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `itipinvitations` ADD CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

View file

@ -104,4 +104,4 @@ CREATE TABLE itipinvitations (
CREATE INDEX itipinvitations_user_id_event_uid_idx ON itipinvitations (user_id, event_uid); CREATE INDEX itipinvitations_user_id_event_uid_idx ON itipinvitations (user_id, event_uid);
INSERT INTO system (name, value) VALUES ('calendar-database-version', '2015022700'); INSERT INTO system (name, value) VALUES ('calendar-database-version', '2021102600');

View file

@ -0,0 +1 @@
-- empty

View file

@ -75,4 +75,4 @@ CREATE TABLE itipinvitations (
CREATE INDEX ix_itipinvitations_uid ON itipinvitations(user_id, event_uid); CREATE INDEX ix_itipinvitations_uid ON itipinvitations(user_id, event_uid);
INSERT INTO system (name, value) VALUES ('calendar-database-version', '2015022700'); INSERT INTO system (name, value) VALUES ('calendar-database-version', '2021102600');

View file

@ -0,0 +1 @@
-- empty

View file

@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS `kolab_alarms` (
PRIMARY KEY(`alarm_id`,`user_id`), PRIMARY KEY(`alarm_id`,`user_id`),
CONSTRAINT `fk_kolab_alarms_user_id` FOREIGN KEY (`user_id`) CONSTRAINT `fk_kolab_alarms_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `itipinvitations` ( CREATE TABLE IF NOT EXISTS `itipinvitations` (
`token` VARCHAR(64) NOT NULL, `token` VARCHAR(64) NOT NULL,
@ -26,6 +26,6 @@ CREATE TABLE IF NOT EXISTS `itipinvitations` (
INDEX `uid_idx` (`event_uid`,`user_id`), INDEX `uid_idx` (`event_uid`,`user_id`),
CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`) CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPLACE INTO `system` (`name`, `value`) VALUES ('calendar-kolab-version', '2014041700'); REPLACE INTO `system` (`name`, `value`) VALUES ('calendar-kolab-version', '2021102600');

View file

@ -0,0 +1,14 @@
-- changing table format and dropping foreign keys is needed for some versions of MySQL
ALTER TABLE `kolab_alarms` DROP FOREIGN KEY `fk_kolab_alarms_user_id`;
ALTER TABLE `itipinvitations` DROP FOREIGN KEY`fk_itipinvitations_user_id`;
ALTER TABLE `kolab_alarms` ROW_FORMAT=DYNAMIC;
ALTER TABLE `itipinvitations` ROW_FORMAT=DYNAMIC;
ALTER TABLE `kolab_alarms` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `itipinvitations` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `kolab_alarms` ADD CONSTRAINT `fk_kolab_alarms_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `itipinvitations` ADD CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

View file

@ -32,7 +32,6 @@ For available configuration options see config.inc.php.dist file.
IMPORTANT IMPORTANT
--------- ---------
This plugin doesn't work with the Classic skin of Roundcube because no This plugin doesn't work with the Classic skin of Roundcube because no
templates are available for that skin. templates are available for that skin.

View file

@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `tasklists` (
KEY `user_id` (`user_id`), KEY `user_id` (`user_id`),
CONSTRAINT `fk_tasklist_user_id` FOREIGN KEY (`user_id`) CONSTRAINT `fk_tasklist_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `tasks` ( CREATE TABLE IF NOT EXISTS `tasks` (
`task_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `task_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@ -46,6 +46,6 @@ CREATE TABLE IF NOT EXISTS `tasks` (
KEY `uid` (`uid`), KEY `uid` (`uid`),
CONSTRAINT `fk_tasks_tasklist_id` FOREIGN KEY (`tasklist_id`) CONSTRAINT `fk_tasks_tasklist_id` FOREIGN KEY (`tasklist_id`)
REFERENCES `tasklists`(`tasklist_id`) ON DELETE CASCADE ON UPDATE CASCADE REFERENCES `tasklists`(`tasklist_id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci */; ) ROW_FORMAT=DYNAMIC ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPLACE INTO `system` (`name`, `value`) VALUES ('tasklist-database-version', '2014051900'); REPLACE INTO `system` (`name`, `value`) VALUES ('tasklist-database-version', '2021102600');

View file

@ -0,0 +1,14 @@
-- changing table format and dropping foreign keys is needed for some versions of MySQL
ALTER TABLE `tasklists` DROP FOREIGN KEY `fk_tasklists_user_id`;
ALTER TABLE `tasks` DROP FOREIGN KEY`fk_tasks_tasklist_id`;
ALTER TABLE `tasklists` ROW_FORMAT=DYNAMIC;
ALTER TABLE `tasks` ROW_FORMAT=DYNAMIC;
ALTER TABLE `tasklists` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `tasks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `tasklists` ADD CONSTRAINT `fk_tasklist_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tasks` ADD CONSTRAINT `fk_tasks_tasklist_id` FOREIGN KEY (`tasklist_id`)
REFERENCES `tasklists`(`tasklist_id`) ON DELETE CASCADE ON UPDATE CASCADE;