1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-12-26 05:28:50 +00:00

Update conversation members table

This commit is contained in:
Pierre HUBERT 2021-03-02 16:52:50 +01:00
parent 13b9db1e4c
commit bea7be58ae
2 changed files with 20 additions and 10 deletions

View File

@ -88,17 +88,19 @@ CREATE TABLE `comunic_conversations_messages` (
DROP TABLE IF EXISTS `comunic_conversations_users`;
CREATE TABLE `comunic_conversations_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`conv_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`time_add` int(11) DEFAULT NULL,
`following` int(1) DEFAULT '0',
`saw_last_message` int(1) DEFAULT NULL,
DROP TABLE IF EXISTS `comunic_conversations_members`;
CREATE TABLE `comunic_conversations_members` (
`id` int NOT NULL AUTO_INCREMENT,
`conv_id` int DEFAULT NULL,
`user_id` int DEFAULT NULL,
`added_on` int DEFAULT NULL,
`following` int DEFAULT '0',
`is_admin` int DEFAULT '1',
`last_message_seen` int DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_groups`;
CREATE TABLE `comunic_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,

View File

@ -1,4 +1,4 @@
-- Conversations table
-- 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
@ -8,4 +8,12 @@ alter table comunic_conversations_messages
add column file_thumbnail varchar(255) default null,
add column file_type varchar(128) default null;
update comunic_conversations_messages set filepath = image_path, file_size = 10, file_type = "image/png", file_name = "image.png" where image_path is not null and id >= 1;
alter table comunic_conversations_messages drop column image_path;
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 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;