Checkpoint: Implémentation des fonctionnalités de communication : formulaire de contact avec choix email/canal, canaux de discussion intégrés (page Mes Échanges), demandes de mise en relation avec gestion admin des canaux, navigation mise à jour dans DashboardLayout, bouton Demande de mise en relation sur fiche établissement. Migration DB : tables canaux_discussion, membres_canal, messages_canal, demandes_mise_en_relation.
This commit is contained in:
52
drizzle/0004_empty_energizer.sql
Normal file
52
drizzle/0004_empty_energizer.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
CREATE TABLE `canaux_discussion` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`titre` varchar(255) NOT NULL,
|
||||
`description` text,
|
||||
`type` enum('contact_referent','mise_en_relation_public','mise_en_relation_prive') NOT NULL,
|
||||
`visibilite` enum('public','prive') NOT NULL DEFAULT 'prive',
|
||||
`etablissementId` int,
|
||||
`demandeContactId` int,
|
||||
`demandeMiseEnRelationId` int,
|
||||
`creePar` int NOT NULL,
|
||||
`statut` enum('ouvert','ferme') NOT NULL DEFAULT 'ouvert',
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `canaux_discussion_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `demandes_mise_en_relation` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`demandeurId` int NOT NULL,
|
||||
`demandeurNom` varchar(255) NOT NULL,
|
||||
`demandeurEmail` varchar(320),
|
||||
`etablissementDemandeurId` int,
|
||||
`sujet` varchar(500) NOT NULL,
|
||||
`message` text NOT NULL,
|
||||
`statut` enum('en_attente','traite','ferme') NOT NULL DEFAULT 'en_attente',
|
||||
`canalId` int,
|
||||
`traitePar` int,
|
||||
`traiteAt` timestamp,
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `demandes_mise_en_relation_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `membres_canaux_discussion` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`canalId` int NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`role` enum('membre','animateur') NOT NULL DEFAULT 'membre',
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
CONSTRAINT `membres_canaux_discussion_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `messages_canaux` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`canalId` int NOT NULL,
|
||||
`auteurId` int NOT NULL,
|
||||
`auteurNom` varchar(255) NOT NULL,
|
||||
`contenu` text NOT NULL,
|
||||
`lu` boolean NOT NULL DEFAULT false,
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
CONSTRAINT `messages_canaux_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
Reference in New Issue
Block a user