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

Update database structure

This commit is contained in:
Pierre HUBERT 2021-04-11 15:02:01 +02:00
parent 4eb6794628
commit 1b3037e020
2 changed files with 27 additions and 13 deletions

View File

@ -41,23 +41,29 @@ CREATE TABLE `commentaires` (
DROP TABLE IF EXISTS `comunic_clients`;
CREATE TABLE `comunic_clients` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`domain` VARCHAR(45) NULL COMMENT 'Use to check Referer & define Access-Control-Allow-Origin',
`comment` VARCHAR(45) NULL COMMENT 'Information about the client',
`default_expiration_time` INT DEFAULT 2592000 COMMENT '2592000 = 1 month',
PRIMARY KEY (`ID`));
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`domain` varchar(45) DEFAULT NULL COMMENT 'Use to check Referer & define Access-Control-Allow-Origin',
`comment` varchar(45) DEFAULT NULL COMMENT 'Information about the client',
`default_expiration_time` int DEFAULT '2592000' COMMENT '2592000 = 1 month',
`firebase_token` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
DROP TABLE IF EXISTS `comunic_user_access_tokens`;
CREATE TABLE `comunic_user_access_tokens` (
`id` INT NOT NULL AUTO_INCREMENT,
`client_id` INT NOT NULL,
`user_id` INT NOT NULL,
`token` VARCHAR(255) NOT NULL,
`last_refresh` INT NOT NULL,
`timeout` INT NOT NULL,
PRIMARY KEY (`id`));
`id` int NOT NULL AUTO_INCREMENT,
`client_id` int NOT NULL,
`token` varchar(255) NOT NULL,
`user_id` int DEFAULT NULL,
`last_refresh` int NOT NULL,
`timeout` int NOT NULL,
`push_notifications_token` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
DROP TABLE IF EXISTS `comunic_conversations_list`;
CREATE TABLE `comunic_conversations_list` (

View File

@ -3,3 +3,11 @@ ALTER TABLE `utilisateurs`
ADD COLUMN `allow_notif_conv` INT NULL DEFAULT 1 AFTER `delete_likes_after`;
ALTER TABLE `utilisateurs`
ADD COLUMN `allow_notif_sound` INT NULL DEFAULT 1 AFTER `allow_notif_conv`;
-- Clients table
ALTER TABLE `comunic_clients`
ADD COLUMN `firebase_token` VARCHAR(255) NULL AFTER `default_expiration_time`;
-- Tokens table
ALTER TABLE `comunic_user_access_tokens`
ADD COLUMN `push_notifications_token` TEXT NULL AFTER `timeout`;