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-02-13 12:24:07 +01:00
parent effd170ee9
commit 510f46910f
2 changed files with 21 additions and 49 deletions

View File

@ -39,56 +39,24 @@ CREATE TABLE `commentaires` (
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_api_limit_count`;
CREATE TABLE `comunic_api_limit_count` (
`ip` varchar(15) NOT NULL,
`time_start` int(11) DEFAULT NULL,
`action` varchar(45) DEFAULT NULL,
`count` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_client`;
CREATE TABLE `comunic_client` (
`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 GENERATED ALWAYS AS (2592000) COMMENT '2592000 = 1 month',
PRIMARY KEY (`ID`));
DROP TABLE IF EXISTS `comunic_api_services_tokens`;
CREATE TABLE `comunic_api_services_tokens` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time_insert` int(11) DEFAULT NULL,
`service_name` varchar(255) NOT NULL,
`token` varchar(255) NOT NULL,
`client_domain` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_api_users_tokens`;
CREATE TABLE `comunic_api_users_tokens` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`service_id` int(11) NOT NULL,
`token1` varchar(255) NOT NULL,
`token2` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_calls`;
CREATE TABLE `comunic_calls` (
DROP TABLE IF EXISTS `comunic_user_access_token`;
CREATE TABLE `comunic_user_access_token` (
`id` INT NOT NULL AUTO_INCREMENT,
`conversation_id` INT NULL,
`last_active` INT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `comunic_calls_members`;
CREATE TABLE `comunic_calls_members` (
`id` INT NOT NULL AUTO_INCREMENT,
`call_id` INT NOT NULL,
`user_id` INT NULL,
`user_call_id` VARCHAR(200) NULL,
`status` TINYINT DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
`client_id` INT NOT NULL,
`token` VARCHAR(255) NOT NULL,
`last_refresh` INT NOT NULL,
`timeout` INT NOT NULL,
PRIMARY KEY (`id`));
DROP TABLE IF EXISTS `comunic_conversations_list`;
CREATE TABLE `comunic_conversations_list` (

View File

@ -1,2 +1,6 @@
-- Remove deprecated columns
ALTER TABLE texte DROP COLUMN idvideo;
-- Remove deprecated tables
DROP TABLE IF EXISTS `comunic_api_limit_count`;
DROP TABLE IF EXISTS `comunic_api_users_tokens`;
DROP TABLE IF EXISTS `comunic_api_services_tokens`;
DROP TABLE IF EXISTS `comunic_calls_members`;
DROP TABLE IF EXISTS `comunic_calls`;