From 81165d7300f3eecfa50a71fb3fe5b63d39fb65e0 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sun, 14 Mar 2021 13:44:55 +0100 Subject: [PATCH] Fix migration scripts --- docs/migration.sql | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/migration.sql b/docs/migration.sql index 605c6de..dd8262a 100644 --- a/docs/migration.sql +++ b/docs/migration.sql @@ -1,6 +1,10 @@ -- Conversations messages table -alter table comunic_conversations_messages rename column time_insert to time_sent; -alter table comunic_conversations_messages modify message TEXT; +ALTER TABLE `comunic_conversations_messages` +CHANGE `time_insert` `time_sent` int(11) NULL AFTER `user_id`; + +ALTER TABLE `comunic_conversations_messages` +CHANGE `message` `message` text COLLATE 'utf8mb4_general_ci' NULL AFTER `time_sent`; + alter table comunic_conversations_messages add column file_path varchar(255) default null, add column file_size int default null, @@ -12,7 +16,10 @@ alter table comunic_conversations_messages drop column image_path; -- Conversations members table ALTER TABLE `comunic_conversations_users` RENAME TO `comunic_conversations_members` ; -ALTER TABLE comunic_conversations_members rename column time_add to added_on; + +ALTER TABLE `comunic_conversations_members` +CHANGE `time_add` `added_on` int(11) NULL AFTER `user_id`; + alter table comunic_conversations_members drop column saw_last_message; alter table comunic_conversations_members add column is_admin int default 1, @@ -21,7 +28,10 @@ alter table comunic_conversations_members -- Conversations list table alter table comunic_conversations_list drop column user_id; -alter table comunic_conversations_list rename column last_active to last_activity; + +ALTER TABLE `comunic_conversations_list` +CHANGE `last_active` `last_activity` int(11) NULL AFTER `name`; + alter table comunic_conversations_list add column color varchar(6), add column logo varchar(255),