From ad2c338f6a06cf8b9e45594ebd73aa95758263a7 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 21 Jul 2016 17:36:32 +0200 Subject: [PATCH] Re-format 'Migration.md' --- Migration.md | 53 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/Migration.md b/Migration.md index a0d53ad..28a8f78 100644 --- a/Migration.md +++ b/Migration.md @@ -1,35 +1,36 @@ # Migration - * `v1.x.x` to `v2.x.x` - * The MySQL schema has been changed from charset `utf8` to charset `utf8mb4` and from collation `utf8_general_ci` to collation `utf8mb4_unicode_ci`. Use the statements below to update the database schema: +## From `v1.x.x` to `v2.x.x` - ```sql - ALTER TABLE `users` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; - ALTER TABLE `users_confirmations` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + * The MySQL schema has been changed from charset `utf8` to charset `utf8mb4` and from collation `utf8_general_ci` to collation `utf8mb4_unicode_ci`. Use the statements below to update the database schema: - -- ALTER DATABASE `` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + ```sql + ALTER TABLE `users` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + ALTER TABLE `users_confirmations` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; - ALTER TABLE `users` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - ALTER TABLE `users_confirmations` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - ALTER TABLE `users_remembered` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - ALTER TABLE `users_resets` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - ALTER TABLE `users_throttling` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + -- ALTER DATABASE `` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; - ALTER TABLE `users` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; - ALTER TABLE `users` CHANGE `username` `username` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL; + ALTER TABLE `users` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + ALTER TABLE `users_confirmations` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + ALTER TABLE `users_remembered` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + ALTER TABLE `users_resets` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + ALTER TABLE `users_throttling` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - ALTER TABLE `users_confirmations` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; + ALTER TABLE `users` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; + ALTER TABLE `users` CHANGE `username` `username` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL; - ALTER TABLE `users_throttling` CHANGE `action_type` `action_type` ENUM('login','register','confirm_email') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; + ALTER TABLE `users_confirmations` CHANGE `email` `email` VARCHAR(249) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; - REPAIR TABLE users; - OPTIMIZE TABLE users; - REPAIR TABLE users_confirmations; - OPTIMIZE TABLE users_confirmations; - REPAIR TABLE users_remembered; - OPTIMIZE TABLE users_remembered; - REPAIR TABLE users_resets; - OPTIMIZE TABLE users_resets; - REPAIR TABLE users_throttling; - OPTIMIZE TABLE users_throttling; - ``` + ALTER TABLE `users_throttling` CHANGE `action_type` `action_type` ENUM('login','register','confirm_email') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; + + REPAIR TABLE users; + OPTIMIZE TABLE users; + REPAIR TABLE users_confirmations; + OPTIMIZE TABLE users_confirmations; + REPAIR TABLE users_remembered; + OPTIMIZE TABLE users_remembered; + REPAIR TABLE users_resets; + OPTIMIZE TABLE users_resets; + REPAIR TABLE users_throttling; + OPTIMIZE TABLE users_throttling; + ```