1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-26 07:19:22 +00:00
comunicapiv3/docs/migration.sql

43 lines
1.7 KiB
MySQL
Raw Normal View History

2021-03-02 15:52:50 +00:00
-- Conversations messages table
2021-03-14 12:44:55 +00:00
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`;
2021-03-02 15:46:41 +00:00
alter table comunic_conversations_messages
2021-03-04 16:09:52 +00:00
add column file_path varchar(255) default null,
2021-03-02 15:46:41 +00:00
add column file_size int default null,
add column file_name varchar(255) default null,
add column file_thumbnail varchar(255) default null,
add column file_type varchar(128) default null;
2021-03-04 16:09:52 +00:00
update comunic_conversations_messages set file_path = image_path, file_size = 10, file_type = "image/png", file_name = "image.png" where image_path is not null and id >= 1;
2021-03-02 15:52:50 +00:00
alter table comunic_conversations_messages drop column image_path;
-- Conversations members table
ALTER TABLE `comunic_conversations_users` RENAME TO `comunic_conversations_members` ;
2021-03-14 12:44:55 +00:00
ALTER TABLE `comunic_conversations_members`
CHANGE `time_add` `added_on` int(11) NULL AFTER `user_id`;
2021-03-02 15:52:50 +00:00
alter table comunic_conversations_members drop column saw_last_message;
alter table comunic_conversations_members
add column is_admin int default 1,
add column last_message_seen int default 0,
add column last_access int default 0;
2021-03-02 16:01:27 +00:00
-- Conversations list table
alter table comunic_conversations_list drop column user_id;
2021-03-14 12:44:55 +00:00
ALTER TABLE `comunic_conversations_list`
CHANGE `last_active` `last_activity` int(11) NULL AFTER `name`;
2021-03-02 16:01:27 +00:00
alter table comunic_conversations_list
add column color varchar(6),
2021-03-05 13:20:50 +00:00
add column logo varchar(255),
2021-03-12 21:20:25 +00:00
add group_id int;
-- Fix character encoding for messages
ALTER TABLE comunic_conversations_messages
CHANGE COLUMN `message` `message` TEXT CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci' NULL DEFAULT NULL ;