From 6af6440ea9f9de88b497116ec9e07f7000056a93 Mon Sep 17 00:00:00 2001 From: Praneet Date: Thu, 18 Jul 2019 11:54:08 +0530 Subject: [PATCH] Task #63 fix: Updated table charset and collation --- .../administrator/sql/install.mysql.utf8.sql | 8 ++++---- .../administrator/sql/updates/mysql/1.1.1.sql | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 src/components/com_tjdashboard/administrator/sql/updates/mysql/1.1.1.sql diff --git a/src/components/com_tjdashboard/administrator/sql/install.mysql.utf8.sql b/src/components/com_tjdashboard/administrator/sql/install.mysql.utf8.sql index b50242ec..6c62c96e 100644 --- a/src/components/com_tjdashboard/administrator/sql/install.mysql.utf8.sql +++ b/src/components/com_tjdashboard/administrator/sql/install.mysql.utf8.sql @@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS `#__tj_dashboards` ( `dashboard_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `asset_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to the #__assets table.', `access` int(10) UNSIGNED NOT NULL DEFAULT '0', - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `title` varchar(255) NOT NULL DEFAULT '', `description` text NOT NULL, `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', `ordering` int(11) NOT NULL DEFAULT '0', @@ -18,12 +18,12 @@ CREATE TABLE IF NOT EXISTS `#__tj_dashboards` ( PRIMARY KEY (`dashboard_id`), KEY `idx_createdby` (`created_by`), KEY `idx_alias` (`alias`(191)) -) DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__tj_dashboard_widgets` ( `dashboard_widget_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `dashboard_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to the #__tj_dashboard table.', - `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `title` varchar(255) NOT NULL DEFAULT '', `ordering` int(11) NOT NULL DEFAULT '0', `state` tinyint(3) NOT NULL DEFAULT '0', `data_plugin` varchar(255) NOT NULL COMMENT 'Data Source Plugin', @@ -42,5 +42,5 @@ CREATE TABLE IF NOT EXISTS `#__tj_dashboard_widgets` ( FOREIGN KEY (`dashboard_id`) REFERENCES `#__tj_dashboards` (`dashboard_id`), KEY `idx_dashboard_id` (`dashboard_id`), KEY `idx_createdby` (`created_by`) -) DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/src/components/com_tjdashboard/administrator/sql/updates/mysql/1.1.1.sql b/src/components/com_tjdashboard/administrator/sql/updates/mysql/1.1.1.sql new file mode 100644 index 00000000..a15ac7aa --- /dev/null +++ b/src/components/com_tjdashboard/administrator/sql/updates/mysql/1.1.1.sql @@ -0,0 +1,6 @@ +ALTER TABLE `#__tj_dashboards` ENGINE = InnoDB; +ALTER TABLE `#__tj_dashboard_widgets` ENGINE = InnoDB; + +ALTER TABLE `#__tj_dashboards` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `#__tj_dashboard_widgets` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +