1+ /* M!999999\- enable the sandbox mode */
12/* !40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */ ;
23/* !40103 SET TIME_ZONE='+00:00' */ ;
34/* !40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */ ;
67/* !40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */ ;
78DROP TABLE IF EXISTS ` action_measure` ;
89/* !40101 SET @saved_cs_client = @@character_set_client */ ;
9- /* !40101 SET character_set_client = utf8 */ ;
10+ /* !40101 SET character_set_client = utf8mb4 */ ;
1011CREATE TABLE `action_measure ` (
1112 ` action_id` int (10 ) unsigned NOT NULL ,
1213 ` measure_id` int (10 ) unsigned NOT NULL ,
@@ -18,7 +19,7 @@ CREATE TABLE `action_measure` (
1819/* !40101 SET character_set_client = @saved_cs_client */ ;
1920DROP TABLE IF EXISTS ` action_user` ;
2021/* !40101 SET @saved_cs_client = @@character_set_client */ ;
21- /* !40101 SET character_set_client = utf8 */ ;
22+ /* !40101 SET character_set_client = utf8mb4 */ ;
2223CREATE TABLE `action_user ` (
2324 ` action_id` int (10 ) unsigned NOT NULL ,
2425 ` user_id` bigint (20 ) unsigned NOT NULL ,
@@ -30,11 +31,11 @@ CREATE TABLE `action_user` (
3031/* !40101 SET character_set_client = @saved_cs_client */ ;
3132DROP TABLE IF EXISTS ` actions` ;
3233/* !40101 SET @saved_cs_client = @@character_set_client */ ;
33- /* !40101 SET character_set_client = utf8 */ ;
34+ /* !40101 SET character_set_client = utf8mb4 */ ;
3435CREATE TABLE `actions ` (
3536 ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
3637 ` reference` varchar (32 ) DEFAULT NULL ,
37- ` type` varchar ( 32 ) DEFAULT NULL ,
38+ ` type` int ( 11 ) NOT NULL ,
3839 ` criticity` int (11 ) NOT NULL ,
3940 ` status` int (11 ) NOT NULL ,
4041 ` scope` varchar (32 ) DEFAULT NULL ,
@@ -55,7 +56,7 @@ CREATE TABLE `actions` (
5556/* !40101 SET character_set_client = @saved_cs_client */ ;
5657DROP TABLE IF EXISTS ` attributes` ;
5758/* !40101 SET @saved_cs_client = @@character_set_client */ ;
58- /* !40101 SET character_set_client = utf8 */ ;
59+ /* !40101 SET character_set_client = utf8mb4 */ ;
5960CREATE TABLE `attributes ` (
6061 ` id` bigint (20 ) unsigned NOT NULL AUTO_INCREMENT,
6162 ` name` varchar (255 ) NOT NULL ,
@@ -66,9 +67,25 @@ CREATE TABLE `attributes` (
6667 UNIQUE KEY ` tags_name_unique` (` name` )
6768) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
6869/* !40101 SET character_set_client = @saved_cs_client */ ;
70+ DROP TABLE IF EXISTS ` audit_logs` ;
71+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
72+ /* !40101 SET character_set_client = utf8mb4 */ ;
73+ CREATE TABLE `audit_logs ` (
74+ ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
75+ ` description` text NOT NULL ,
76+ ` subject_id` int (10 ) unsigned DEFAULT NULL ,
77+ ` subject_type` varchar (255 ) DEFAULT NULL ,
78+ ` user_id` int (10 ) unsigned DEFAULT NULL ,
79+ ` properties` text DEFAULT NULL ,
80+ ` host` varchar (45 ) DEFAULT NULL ,
81+ ` created_at` timestamp NULL DEFAULT NULL ,
82+ ` updated_at` timestamp NULL DEFAULT NULL ,
83+ PRIMARY KEY (` id` )
84+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
85+ /* !40101 SET character_set_client = @saved_cs_client */ ;
6986DROP TABLE IF EXISTS ` control_measure` ;
7087/* !40101 SET @saved_cs_client = @@character_set_client */ ;
71- /* !40101 SET character_set_client = utf8 */ ;
88+ /* !40101 SET character_set_client = utf8mb4 */ ;
7289CREATE TABLE `control_measure ` (
7390 ` control_id` int (10 ) unsigned NOT NULL ,
7491 ` measure_id` int (10 ) unsigned NOT NULL ,
@@ -80,7 +97,7 @@ CREATE TABLE `control_measure` (
8097/* !40101 SET character_set_client = @saved_cs_client */ ;
8198DROP TABLE IF EXISTS ` control_user` ;
8299/* !40101 SET @saved_cs_client = @@character_set_client */ ;
83- /* !40101 SET character_set_client = utf8 */ ;
100+ /* !40101 SET character_set_client = utf8mb4 */ ;
84101CREATE TABLE `control_user ` (
85102 ` control_id` int (10 ) unsigned NOT NULL ,
86103 ` user_id` bigint (20 ) unsigned NOT NULL ,
@@ -90,9 +107,21 @@ CREATE TABLE `control_user` (
90107 CONSTRAINT ` user_id_fk_304958543` FOREIGN KEY (` user_id` ) REFERENCES ` users` (` id` ) ON DELETE CASCADE ON UPDATE NO ACTION
91108) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
92109/* !40101 SET character_set_client = @saved_cs_client */ ;
110+ DROP TABLE IF EXISTS ` control_user_group` ;
111+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
112+ /* !40101 SET character_set_client = utf8mb4 */ ;
113+ CREATE TABLE `control_user_group ` (
114+ ` control_id` int (10 ) unsigned NOT NULL ,
115+ ` user_group_id` int (10 ) unsigned NOT NULL ,
116+ KEY ` control_user_group_control_id_foreign` (` control_id` ),
117+ KEY ` control_user_group_user_group_id_foreign` (` user_group_id` ),
118+ CONSTRAINT ` control_user_group_control_id_foreign` FOREIGN KEY (` control_id` ) REFERENCES ` controls` (` id` ),
119+ CONSTRAINT ` control_user_group_user_group_id_foreign` FOREIGN KEY (` user_group_id` ) REFERENCES ` user_groups` (` id` )
120+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
121+ /* !40101 SET character_set_client = @saved_cs_client */ ;
93122DROP TABLE IF EXISTS ` controls` ;
94123/* !40101 SET @saved_cs_client = @@character_set_client */ ;
95- /* !40101 SET character_set_client = utf8 */ ;
124+ /* !40101 SET character_set_client = utf8mb4 */ ;
96125CREATE TABLE `controls ` (
97126 ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
98127 ` name` varchar (255 ) NOT NULL ,
@@ -112,7 +141,6 @@ CREATE TABLE `controls` (
112141 ` next_id` int (10 ) unsigned DEFAULT NULL ,
113142 ` standard` varchar (255 ) DEFAULT NULL ,
114143 ` attributes` varchar (1024 ) DEFAULT NULL ,
115- ` site` varchar (255 ) DEFAULT NULL ,
116144 ` scope` varchar (32 ) DEFAULT NULL ,
117145 ` status` int (11 ) NOT NULL DEFAULT 0 ,
118146 PRIMARY KEY (` id` ),
@@ -122,7 +150,7 @@ CREATE TABLE `controls` (
122150/* !40101 SET character_set_client = @saved_cs_client */ ;
123151DROP TABLE IF EXISTS ` documents` ;
124152/* !40101 SET @saved_cs_client = @@character_set_client */ ;
125- /* !40101 SET character_set_client = utf8 */ ;
153+ /* !40101 SET character_set_client = utf8mb4 */ ;
126154CREATE TABLE `documents ` (
127155 ` id` bigint (20 ) unsigned NOT NULL AUTO_INCREMENT,
128156 ` control_id` int (10 ) unsigned NOT NULL ,
@@ -139,7 +167,7 @@ CREATE TABLE `documents` (
139167/* !40101 SET character_set_client = @saved_cs_client */ ;
140168DROP TABLE IF EXISTS ` domains` ;
141169/* !40101 SET @saved_cs_client = @@character_set_client */ ;
142- /* !40101 SET character_set_client = utf8 */ ;
170+ /* !40101 SET character_set_client = utf8mb4 */ ;
143171CREATE TABLE `domains ` (
144172 ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
145173 ` framework` varchar (255 ) DEFAULT NULL ,
@@ -152,7 +180,7 @@ CREATE TABLE `domains` (
152180/* !40101 SET character_set_client = @saved_cs_client */ ;
153181DROP TABLE IF EXISTS ` measures` ;
154182/* !40101 SET @saved_cs_client = @@character_set_client */ ;
155- /* !40101 SET character_set_client = utf8 */ ;
183+ /* !40101 SET character_set_client = utf8mb4 */ ;
156184CREATE TABLE `measures ` (
157185 ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
158186 ` domain_id` int (10 ) unsigned NOT NULL ,
@@ -175,7 +203,7 @@ CREATE TABLE `measures` (
175203/* !40101 SET character_set_client = @saved_cs_client */ ;
176204DROP TABLE IF EXISTS ` migrations` ;
177205/* !40101 SET @saved_cs_client = @@character_set_client */ ;
178- /* !40101 SET character_set_client = utf8 */ ;
206+ /* !40101 SET character_set_client = utf8mb4 */ ;
179207CREATE TABLE `migrations ` (
180208 ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
181209 ` migration` varchar (255 ) NOT NULL ,
@@ -185,7 +213,7 @@ CREATE TABLE `migrations` (
185213/* !40101 SET character_set_client = @saved_cs_client */ ;
186214DROP TABLE IF EXISTS ` oauth_access_tokens` ;
187215/* !40101 SET @saved_cs_client = @@character_set_client */ ;
188- /* !40101 SET character_set_client = utf8 */ ;
216+ /* !40101 SET character_set_client = utf8mb4 */ ;
189217CREATE TABLE `oauth_access_tokens ` (
190218 ` id` varchar (100 ) NOT NULL ,
191219 ` user_id` bigint (20 ) unsigned DEFAULT NULL ,
@@ -202,7 +230,7 @@ CREATE TABLE `oauth_access_tokens` (
202230/* !40101 SET character_set_client = @saved_cs_client */ ;
203231DROP TABLE IF EXISTS ` oauth_auth_codes` ;
204232/* !40101 SET @saved_cs_client = @@character_set_client */ ;
205- /* !40101 SET character_set_client = utf8 */ ;
233+ /* !40101 SET character_set_client = utf8mb4 */ ;
206234CREATE TABLE `oauth_auth_codes ` (
207235 ` id` varchar (100 ) NOT NULL ,
208236 ` user_id` bigint (20 ) unsigned NOT NULL ,
@@ -216,7 +244,7 @@ CREATE TABLE `oauth_auth_codes` (
216244/* !40101 SET character_set_client = @saved_cs_client */ ;
217245DROP TABLE IF EXISTS ` oauth_clients` ;
218246/* !40101 SET @saved_cs_client = @@character_set_client */ ;
219- /* !40101 SET character_set_client = utf8 */ ;
247+ /* !40101 SET character_set_client = utf8mb4 */ ;
220248CREATE TABLE `oauth_clients ` (
221249 ` id` bigint (20 ) unsigned NOT NULL AUTO_INCREMENT,
222250 ` user_id` bigint (20 ) unsigned DEFAULT NULL ,
@@ -235,7 +263,7 @@ CREATE TABLE `oauth_clients` (
235263/* !40101 SET character_set_client = @saved_cs_client */ ;
236264DROP TABLE IF EXISTS ` oauth_personal_access_clients` ;
237265/* !40101 SET @saved_cs_client = @@character_set_client */ ;
238- /* !40101 SET character_set_client = utf8 */ ;
266+ /* !40101 SET character_set_client = utf8mb4 */ ;
239267CREATE TABLE `oauth_personal_access_clients ` (
240268 ` id` bigint (20 ) unsigned NOT NULL AUTO_INCREMENT,
241269 ` client_id` bigint (20 ) unsigned NOT NULL ,
@@ -246,7 +274,7 @@ CREATE TABLE `oauth_personal_access_clients` (
246274/* !40101 SET character_set_client = @saved_cs_client */ ;
247275DROP TABLE IF EXISTS ` oauth_refresh_tokens` ;
248276/* !40101 SET @saved_cs_client = @@character_set_client */ ;
249- /* !40101 SET character_set_client = utf8 */ ;
277+ /* !40101 SET character_set_client = utf8mb4 */ ;
250278CREATE TABLE `oauth_refresh_tokens ` (
251279 ` id` varchar (100 ) NOT NULL ,
252280 ` access_token_id` varchar (100 ) NOT NULL ,
@@ -258,7 +286,7 @@ CREATE TABLE `oauth_refresh_tokens` (
258286/* !40101 SET character_set_client = @saved_cs_client */ ;
259287DROP TABLE IF EXISTS ` password_resets` ;
260288/* !40101 SET @saved_cs_client = @@character_set_client */ ;
261- /* !40101 SET character_set_client = utf8 */ ;
289+ /* !40101 SET character_set_client = utf8mb4 */ ;
262290CREATE TABLE `password_resets ` (
263291 ` email` varchar (255 ) NOT NULL ,
264292 ` token` varchar (255 ) NOT NULL ,
@@ -268,7 +296,7 @@ CREATE TABLE `password_resets` (
268296/* !40101 SET character_set_client = @saved_cs_client */ ;
269297DROP TABLE IF EXISTS ` personal_access_tokens` ;
270298/* !40101 SET @saved_cs_client = @@character_set_client */ ;
271- /* !40101 SET character_set_client = utf8 */ ;
299+ /* !40101 SET character_set_client = utf8mb4 */ ;
272300CREATE TABLE `personal_access_tokens ` (
273301 ` id` bigint (20 ) unsigned NOT NULL AUTO_INCREMENT,
274302 ` tokenable_type` varchar (255 ) NOT NULL ,
@@ -285,9 +313,33 @@ CREATE TABLE `personal_access_tokens` (
285313 KEY ` personal_access_tokens_tokenable_type_tokenable_id_index` (` tokenable_type` ,` tokenable_id` )
286314) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
287315/* !40101 SET character_set_client = @saved_cs_client */ ;
316+ DROP TABLE IF EXISTS ` user_groups` ;
317+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
318+ /* !40101 SET character_set_client = utf8mb4 */ ;
319+ CREATE TABLE `user_groups ` (
320+ ` id` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
321+ ` name` varchar (255 ) NOT NULL ,
322+ ` description` text DEFAULT NULL ,
323+ ` created_at` timestamp NULL DEFAULT NULL ,
324+ ` updated_at` timestamp NULL DEFAULT NULL ,
325+ PRIMARY KEY (` id` )
326+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
327+ /* !40101 SET character_set_client = @saved_cs_client */ ;
328+ DROP TABLE IF EXISTS ` user_user_group` ;
329+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
330+ /* !40101 SET character_set_client = utf8mb4 */ ;
331+ CREATE TABLE `user_user_group ` (
332+ ` user_id` bigint (20 ) unsigned NOT NULL ,
333+ ` user_group_id` int (10 ) unsigned NOT NULL ,
334+ KEY ` user_user_group_user_id_foreign` (` user_id` ),
335+ KEY ` user_user_group_user_group_id_foreign` (` user_group_id` ),
336+ CONSTRAINT ` user_user_group_user_group_id_foreign` FOREIGN KEY (` user_group_id` ) REFERENCES ` user_groups` (` id` ),
337+ CONSTRAINT ` user_user_group_user_id_foreign` FOREIGN KEY (` user_id` ) REFERENCES ` users` (` id` )
338+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4 COLLATE= utf8mb4_unicode_ci;
339+ /* !40101 SET character_set_client = @saved_cs_client */ ;
288340DROP TABLE IF EXISTS ` users` ;
289341/* !40101 SET @saved_cs_client = @@character_set_client */ ;
290- /* !40101 SET character_set_client = utf8 */ ;
342+ /* !40101 SET character_set_client = utf8mb4 */ ;
291343CREATE TABLE `users ` (
292344 ` id` bigint (20 ) unsigned NOT NULL AUTO_INCREMENT,
293345 ` login` varchar (255 ) NOT NULL ,
@@ -314,6 +366,7 @@ CREATE TABLE `users` (
314366/* !40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */ ;
315367/* !40111 SET SQL_NOTES=@OLD_SQL_NOTES */ ;
316368
369+ /* M!999999\- enable the sandbox mode */
317370INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (1 ,' 2014_10_12_000000_create_users_table' ,1 );
318371INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (2 ,' 2014_10_12_100000_create_password_resets_table' ,1 );
319372INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (3 ,' 2019_07_28_175941_create_domains_table' ,1 );
@@ -343,3 +396,7 @@ INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (54,'2016_06_01_000
343396INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (55 ,' 2016_06_01_000004_create_oauth_clients_table' ,2 );
344397INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (56 ,' 2016_06_01_000005_create_oauth_personal_access_clients_table' ,2 );
345398INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (61 ,' 2024_11_06_123808_add_actions' ,3 );
399+ INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (62 ,' 2025_02_04_064646_create_audit_logs_table' ,4 );
400+ INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (63 ,' 2025_02_05_121035_cleanup' ,4 );
401+ INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (64 ,' 2025_04_29_123908_add_user_group' ,4 );
402+ INSERT INTO ` migrations` (` id` , ` migration` , ` batch` ) VALUES (65 ,' 2025_05_27_152856_change_actions' ,4 );
0 commit comments