diff --git a/README.fr.md b/README.fr.md index 1dbf750c..75fe9cdd 100644 --- a/README.fr.md +++ b/README.fr.md @@ -72,7 +72,7 @@ Pour en savoir plus sur l'utilisation de l'application, consultez la [documentat - **Langages** : PHP, JavaScript - **Framework** : Laravel -- **Base de données** : MySQL, PostgreSQL, SQLite, SQL Server +- **Base de données** : MariaDB, MySQL, PostgreSQL, and SQLite - **Graphiques** : ChartJS ## ⚙️ Installation diff --git a/README.md b/README.md index 58071afc..e2140661 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ To find out more about using the application, please refer to the [user document - **Languages**: PHP, JavaScript - **Framework** : Laravel -- **Database**: MySQL, PostgreSQL, SQLite, SQL Server +- **Database**: MariaDB, MySQL, PostgreSQL, and SQLite - **Graphics**: ChartJS ## ⚙️ Installation diff --git a/database/schema/mysql-schema.sql b/database/schema/mysql-schema.sql new file mode 100644 index 00000000..d0b37565 --- /dev/null +++ b/database/schema/mysql-schema.sql @@ -0,0 +1,295 @@ +/*!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 `attributes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `attributes` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `values` varchar(4096) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `tags_name_unique` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `control_measure`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `control_measure` ( + `control_id` int(10) unsigned NOT NULL, + `measure_id` int(10) unsigned NOT NULL, + KEY `control_measure_control_id_foreign` (`control_id`), + KEY `control_measure_measure_id_foreign` (`measure_id`), + CONSTRAINT `control_measure_control_id_foreign` FOREIGN KEY (`control_id`) REFERENCES `controls` (`id`), + CONSTRAINT `control_measure_measure_id_foreign` FOREIGN KEY (`measure_id`) REFERENCES `measures` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `control_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `control_user` ( + `control_id` int(10) unsigned NOT NULL, + `user_id` bigint(20) unsigned NOT NULL, + KEY `control_id_fk_5920381` (`control_id`), + KEY `user_id_fk_5837573` (`user_id`), + CONSTRAINT `control_id_fk_49294573` FOREIGN KEY (`control_id`) REFERENCES `controls` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT `user_id_fk_304958543` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `controls`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `controls` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `objective` text DEFAULT NULL, + `input` text DEFAULT NULL, + `model` text DEFAULT NULL, + `indicator` text DEFAULT NULL, + `action_plan` longtext DEFAULT NULL, + `periodicity` int(11) DEFAULT NULL, + `plan_date` date NOT NULL, + `realisation_date` date DEFAULT NULL, + `observations` longtext DEFAULT NULL, + `score` int(11) DEFAULT NULL, + `note` int(11) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `next_id` int(10) unsigned DEFAULT NULL, + `standard` varchar(255) DEFAULT NULL, + `attributes` varchar(1024) DEFAULT NULL, + `site` varchar(255) DEFAULT NULL, + `scope` varchar(32) DEFAULT NULL, + `status` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `fk_controls_next_id` (`next_id`), + CONSTRAINT `fk_controls_next_id` FOREIGN KEY (`next_id`) REFERENCES `controls` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `documents`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `documents` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `control_id` int(10) unsigned NOT NULL, + `filename` varchar(255) NOT NULL, + `mimetype` varchar(255) NOT NULL, + `size` int(11) NOT NULL, + `hash` varchar(255) NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `documents_control_id_foreign` (`control_id`), + CONSTRAINT `documents_control_id_foreign` FOREIGN KEY (`control_id`) REFERENCES `controls` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `domains`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `domains` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `framework` varchar(255) DEFAULT NULL, + `title` varchar(255) NOT NULL, + `description` varchar(255) NOT 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 `measures`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `measures` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `domain_id` int(10) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `clause` varchar(255) NOT NULL, + `objective` text DEFAULT NULL, + `input` text DEFAULT NULL, + `model` text DEFAULT NULL, + `indicator` text DEFAULT NULL, + `action_plan` text DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `standard` varchar(255) DEFAULT NULL, + `attributes` varchar(1024) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `measures_clause_unique` (`clause`), + KEY `measures_domain_id_foreign` (`domain_id`), + CONSTRAINT `measures_domain_id_foreign` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`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 */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `migrations` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(255) 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 `oauth_access_tokens`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `oauth_access_tokens` ( + `id` varchar(100) NOT NULL, + `user_id` bigint(20) unsigned DEFAULT NULL, + `client_id` bigint(20) unsigned NOT NULL, + `name` varchar(255) DEFAULT NULL, + `scopes` text DEFAULT NULL, + `revoked` tinyint(1) NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `expires_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `oauth_access_tokens_user_id_index` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `oauth_auth_codes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `oauth_auth_codes` ( + `id` varchar(100) NOT NULL, + `user_id` bigint(20) unsigned NOT NULL, + `client_id` bigint(20) unsigned NOT NULL, + `scopes` text DEFAULT NULL, + `revoked` tinyint(1) NOT NULL, + `expires_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `oauth_auth_codes_user_id_index` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `oauth_clients`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `oauth_clients` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) unsigned DEFAULT NULL, + `name` varchar(255) NOT NULL, + `secret` varchar(100) DEFAULT NULL, + `provider` varchar(255) DEFAULT NULL, + `redirect` text NOT NULL, + `personal_access_client` tinyint(1) NOT NULL, + `password_client` tinyint(1) NOT NULL, + `revoked` tinyint(1) NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `oauth_clients_user_id_index` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `oauth_personal_access_clients`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `oauth_personal_access_clients` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `client_id` bigint(20) unsigned NOT 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 `oauth_refresh_tokens`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `oauth_refresh_tokens` ( + `id` varchar(100) NOT NULL, + `access_token_id` varchar(100) NOT NULL, + `revoked` tinyint(1) NOT NULL, + `expires_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_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 */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `password_resets` ( + `email` varchar(255) NOT NULL, + `token` varchar(255) 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 `personal_access_tokens`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `personal_access_tokens` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `tokenable_type` varchar(255) NOT NULL, + `tokenable_id` bigint(20) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `token` varchar(64) NOT NULL, + `abilities` text DEFAULT NULL, + `last_used_at` timestamp NULL DEFAULT NULL, + `expires_at` timestamp NULL DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `personal_access_tokens_token_unique` (`token`), + KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_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 */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `login` varchar(255) NOT NULL, + `name` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `role` int(11) NOT NULL, + `language` varchar(255) DEFAULT NULL, + `profile_image` int(11) DEFAULT NULL, + `email_verified_at` timestamp NULL DEFAULT NULL, + `password` varchar(255) NOT NULL, + `remember_token` varchar(100) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `users_login_unique` (`login`), + 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` (`id`, `migration`, `batch`) VALUES (1,'2014_10_12_000000_create_users_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'2014_10_12_100000_create_password_resets_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'2019_07_28_175941_create_domains_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2019_08_09_084322_create_measures_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2019_08_09_105245_create_controls_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2019_12_14_000001_create_personal_access_tokens_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2020_04_12_073028_create_documents_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2022_04_23_081110_add_next_control_id',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2022_05_15_030940_control_score_to_int',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2022_12_21_113730_add_user_language',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2023_01_29_114100_add_tags',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2023_01_30_180336_normalization',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2023_03_09_222639_alter_attributes_values',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2023_04_06_202034_alter_attribute_length',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2023_04_19_112145_change_clause_type',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16,'2023_06_18_170340_owner',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2023_08_22_095642_add_scope',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2024_04_15_193546_attributes_values_text',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2024_04_20_192325_add_control_status',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (20,'2024_06_27_123923_add_control_measure_table',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2024_07_02_101657_add_framework_to_domains',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2024_07_05_174735_clause_unique',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2024_10_01_181052_remove_clause',1); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2016_06_01_000001_create_oauth_auth_codes_table',2); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2016_06_01_000002_create_oauth_access_tokens_table',2); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2016_06_01_000003_create_oauth_refresh_tokens_table',2); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2016_06_01_000004_create_oauth_clients_table',2); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (28,'2016_06_01_000005_create_oauth_personal_access_clients_table',2);