1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 13:29:21 +00:00

Update conversation messages table

This commit is contained in:
Pierre HUBERT 2021-03-02 16:46:41 +01:00
parent 5d7e568a6d
commit 13b9db1e4c
2 changed files with 22 additions and 7 deletions

View File

@ -73,16 +73,21 @@ CREATE TABLE `comunic_conversations_list` (
DROP TABLE IF EXISTS `comunic_conversations_messages`; DROP TABLE IF EXISTS `comunic_conversations_messages`;
CREATE TABLE `comunic_conversations_messages` ( CREATE TABLE `comunic_conversations_messages` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`conv_id` int(11) DEFAULT NULL, `conv_id` int DEFAULT NULL,
`user_id` int(11) DEFAULT NULL, `user_id` int DEFAULT NULL,
`time_insert` int(11) DEFAULT NULL, `time_sent` int DEFAULT NULL,
`message` varchar(200) DEFAULT NULL, `message` text,
`image_path` varchar(100) DEFAULT NULL, `filepath` varchar(255) DEFAULT NULL,
`file_size` int DEFAULT NULL,
`file_name` varchar(255) DEFAULT NULL,
`file_thumbnail` varchar(255) DEFAULT NULL,
`file_type` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_conversations_users`; DROP TABLE IF EXISTS `comunic_conversations_users`;
CREATE TABLE `comunic_conversations_users` ( CREATE TABLE `comunic_conversations_users` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,

View File

@ -1 +1,11 @@
-- Nothing yet -- Conversations 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
add column filepath varchar(255) default null,
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;
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;