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

Update database structure

This commit is contained in:
Pierre HUBERT 2021-02-14 16:18:13 +01:00
parent 45c0b4d7cc
commit dcceee5048
2 changed files with 37 additions and 26 deletions

View File

@ -195,37 +195,41 @@ CREATE TABLE `texte` (
PRIMARY KEY (`ID`) PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `utilisateurs`; DROP TABLE IF EXISTS `utilisateurs`;
CREATE TABLE `utilisateurs` ( CREATE TABLE `utilisateurs` (
`ID` int(11) NOT NULL AUTO_INCREMENT, `ID` int NOT NULL AUTO_INCREMENT,
`nom` varchar(255) NOT NULL, `nom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`prenom` varchar(255) NOT NULL, `prenom` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`date_creation` datetime NOT NULL, `date_creation` datetime NOT NULL,
`mail` varchar(255) NOT NULL, `mail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`password` varchar(255) NOT NULL, `password` varchar(255) CHARACTER SET latin1 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`public` int(11) NOT NULL DEFAULT '0', `public` int NOT NULL DEFAULT '0',
`pageouverte` int(11) NOT NULL DEFAULT '0', `pageouverte` int NOT NULL DEFAULT '0',
`question1` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, `question1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`reponse1` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, `reponse1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`question2` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, `question2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`reponse2` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, `reponse2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`bloquecommentaire` int(11) NOT NULL DEFAULT '0', `bloquecommentaire` int NOT NULL DEFAULT '0',
`last_activity` int(11) NOT NULL DEFAULT '1', `last_activity` int NOT NULL DEFAULT '1',
`autoriser_post_amis` int(11) NOT NULL DEFAULT '1', `autoriser_post_amis` int NOT NULL DEFAULT '1',
`autorise_mail` int(11) NOT NULL DEFAULT '1', `autorise_mail` int NOT NULL DEFAULT '1',
`sous_repertoire` varchar(255) DEFAULT NULL, `sous_repertoire` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`site_web` varchar(255) NOT NULL DEFAULT '', `site_web` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '',
`liste_amis_publique` varchar(1) NOT NULL DEFAULT '1', `liste_amis_publique` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '1',
`public_note` varchar(255) DEFAULT NULL, `public_note` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`password_reset_token` varchar(255) DEFAULT NULL, `password_reset_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`password_reset_token_time_create` int(11) DEFAULT NULL, `password_reset_token_time_create` int DEFAULT NULL,
`lang` varchar(4) DEFAULT 'en', `lang` varchar(4) CHARACTER SET latin1 COLLATE utf8mb4_0900_ai_ci DEFAULT 'en',
`account_image_path` varchar(255) NOT NULL DEFAULT '', `account_image_path` varchar(255) NOT NULL DEFAULT '',
`account_image_visibility` varchar(45) NOT NULL DEFAULT 'everyone', `account_image_visibility` varchar(45) NOT NULL DEFAULT 'everyone',
`delete_account_after` int DEFAULT '0',
`delete_notifications_after` int DEFAULT '7776000',
`delete_comments_after` int DEFAULT '0',
`delete_posts_after` int DEFAULT '0',
`delete_conversation_messages_after` int DEFAULT '0',
`delete_likes_after` int DEFAULT '0',
PRIMARY KEY (`ID`) PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `comunic_custom_emojis`; DROP TABLE IF EXISTS `comunic_custom_emojis`;
CREATE TABLE `comunic_custom_emojis` ( CREATE TABLE `comunic_custom_emojis` (

View File

@ -1 +1,8 @@
-- Nothing yet -- Update users table
ALTER TABLE `utilisateurs`
ADD COLUMN `delete_account_after` INT NULL DEFAULT 0 AFTER `account_image_visibility`,
ADD COLUMN `delete_notifications_after` INT NULL DEFAULT 7776000 AFTER `delete_account_after`,
ADD COLUMN `delete_comments_after` INT NULL DEFAULT 0 AFTER `delete_notifications_after`,
ADD COLUMN `delete_posts_after` INT NULL DEFAULT 0 AFTER `delete_comments_after`,
ADD COLUMN `delete_conversation_messages_after` INT NULL DEFAULT 0 AFTER `delete_posts_after`,
ADD COLUMN `delete_likes_after` INT NULL DEFAULT 0 AFTER `delete_conversation_messages_after`;