ldc-supportweb/database/schema/mysql-schema.dump

267 lines
15 KiB
Text
Raw Normal View History

2022-05-24 10:43:06 +02:00
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `files`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `files` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`uri` varchar(2000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type` smallint(6) NOT NULL,
`category` smallint(6) NOT NULL,
`parent_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`parent_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `files_parent_type_parent_id_index` (`parent_type`,`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `logs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `logs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`entry` text COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
`parent_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`parent_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `logs_user_id_foreign` (`user_id`),
KEY `logs_parent_type_parent_id_index` (`parent_type`,`parent_id`),
CONSTRAINT `logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `macro_activities`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `macro_activities` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`start` datetime NOT NULL COMMENT 'La date de début de l''activité.',
`end` datetime NOT NULL COMMENT 'La date de fin de l''activité.',
`activity` smallint(5) unsigned NOT NULL COMMENT 'Enum MacroSchedule/Activity',
`load` smallint(5) unsigned NOT NULL COMMENT 'Le nombre d''hommes qui vont être mobilisé pour la tâche',
`comment` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Commentaire sur la tâche, (255 chars max)',
`project_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `macro_activities_project_id_foreign` (`project_id`),
CONSTRAINT `macro_activities_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `macro_markers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `macro_markers` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Le libellé du marqueur.',
`marker` datetime NOT NULL COMMENT 'Le point dans le temps du marqueur.',
`project_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `macro_markers_project_id_foreign` (`project_id`),
CONSTRAINT `macro_markers_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `messages` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`ticket_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`message` text COLLATE utf8mb4_unicode_ci NOT NULL,
`file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `messages_ticket_id_foreign` (`ticket_id`),
KEY `messages_user_id_foreign` (`user_id`),
CONSTRAINT `messages_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`),
CONSTRAINT `messages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `project_site`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `project_site` (
`project_id` bigint(20) unsigned NOT NULL,
`site_id` bigint(20) unsigned NOT NULL,
UNIQUE KEY `project_site_project_id_site_id_unique` (`project_id`,`site_id`),
KEY `project_site_site_id_foreign` (`site_id`),
CONSTRAINT `project_site_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
CONSTRAINT `project_site_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `projects`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `projects` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Enum ProjectStatus',
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`todo` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `schedules`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `schedules` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`date` date NOT NULL,
`slot` smallint(6) NOT NULL,
`activity` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`id_lie` bigint(20) DEFAULT NULL,
`model_lie` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_day_slot_unique` (`user_id`,`date`,`slot`),
CONSTRAINT `schedules_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `site_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `site_user` (
`site_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
UNIQUE KEY `site_user_site_id_user_id_unique` (`site_id`,`user_id`),
KEY `project_user_user_id_foreign` (`user_id`),
CONSTRAINT `project_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
CONSTRAINT `site_user_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `sites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sites` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`todo` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `subscriptions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `subscriptions` (
`ticket_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`ticket_id`,`user_id`),
KEY `subscriptions_user_id_foreign` (`user_id`),
CONSTRAINT `subscriptions_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`),
CONSTRAINT `subscriptions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `tickets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tickets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_by` bigint(20) unsigned NOT NULL,
`site_id` bigint(20) unsigned NOT NULL,
`type` int(11) NOT NULL,
`text` text COLLATE utf8mb4_unicode_ci NOT NULL,
`file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`file2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` int(11) NOT NULL DEFAULT 1,
`is_internal` tinyint(4) NOT NULL DEFAULT 0,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tickets_created_by_foreign` (`created_by`),
KEY `tickets_project_id_foreign` (`site_id`),
CONSTRAINT `tickets_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
CONSTRAINT `tickets_site_id_foreign` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`role` int(11) NOT NULL DEFAULT 2,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1);
INSERT INTO `migrations` VALUES (2,'2020_11_13_152248_create_projects',1);
INSERT INTO `migrations` VALUES (3,'2020_11_13_152321_create_tickets',1);
INSERT INTO `migrations` VALUES (4,'2020_11_17_140637_update_users',1);
INSERT INTO `migrations` VALUES (5,'2020_11_25_104931_create_messages',2);
INSERT INTO `migrations` VALUES (6,'2020_11_25_141438_alter_tickets',2);
INSERT INTO `migrations` VALUES (7,'2020_11_26_132557_create_subscriptions',3);
INSERT INTO `migrations` VALUES (8,'2021_04_21_132132_update_tickets_status_with_enum_status',4);
INSERT INTO `migrations` VALUES (9,'2021_04_21_132140_update_tickets_status_with_enum_status2',5);
INSERT INTO `migrations` VALUES (10,'2021_04_21_132140_update_tickets_status_with_enum_status3',6);
INSERT INTO `migrations` VALUES (11,'2021_06_17_173912_create_project_user_table',7);
INSERT INTO `migrations` VALUES (12,'2021_06_28_163754_add_soft_delete_on_users',8);
INSERT INTO `migrations` VALUES (13,'2021_06_28_163755_add_soft_delete_on_projects',9);
INSERT INTO `migrations` VALUES (14,'2021_07_23_111336_rename_projects_table_into_sites_table',10);
INSERT INTO `migrations` VALUES (15,'2021_07_23_150120_create_projects_table',11);
INSERT INTO `migrations` VALUES (16,'2021_07_23_152102_create_project_site_table',12);
INSERT INTO `migrations` VALUES (17,'2021_07_23_152810_create_logs_table',13);
INSERT INTO `migrations` VALUES (18,'2021_07_23_153446_create_files_table',14);
INSERT INTO `migrations` VALUES (19,'2021_07_27_144557_add_todo_on_sites_table',15);
INSERT INTO `migrations` VALUES (20,'2021_08_01_140823_create_password_resets_table',16);
INSERT INTO `migrations` VALUES (21,'2021_10_01_090053_create_week_plannings_table',17);
INSERT INTO `migrations` VALUES (22,'2021_12_03_195755_create_schedules_table',18);
INSERT INTO `migrations` VALUES (23,'2022_02_23_121545_add_is_internal_on_tickets_table',19);
INSERT INTO `migrations` VALUES (24,'2022_03_08_101614_migrate_schedules_to_eight_slots_per_day',20);
INSERT INTO `migrations` VALUES (25,'2022_03_15_164122_drop_week_plannings_table',21);
INSERT INTO `migrations` VALUES (26,'2022_04_26_095605_create_markers_table',22);
INSERT INTO `migrations` VALUES (27,'2022_04_26_095636_create_activities_table',23);
INSERT INTO `migrations` VALUES (28,'2022_04_26_102155_change_status_on_projects_table',24);