Skip to content

Commit 41f238a

Browse files
author
LordTuxn
committed
fix few references for table creation
1 parent d234db4 commit 41f238a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main/java/com/alpsbte/plotsystem/core/database/DatabaseConnection.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -336,18 +336,18 @@ public static List<String> getTables() {
336336
"(" +
337337
" `id` int NOT NULL AUTO_INCREMENT ," +
338338
" `api_key` varchar(32) NOT NULL ," +
339-
" `created_at` timestamp NOT NULL ," +
339+
" `created_at` timestamp NOT NULL DEFAULT current_timestamp()," +
340340
"PRIMARY KEY (`id`)" +
341341
");",
342342

343343
// Build-Teams
344344
"CREATE TABLE IF NOT EXISTS `plotsystem_buildteams` (" +
345345
"`id` INT(11) NOT NULL AUTO_INCREMENT," +
346346
"`name` VARCHAR(45) NOT NULL COLLATE 'utf8mb4_general_ci'," +
347-
"`api_key_id` VARCHAR(32) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci'," +
347+
"`api_key_id` INT(11) NULL DEFAULT NULL," +
348348
"PRIMARY KEY (`id`) USING BTREE," +
349-
"INDEX `FK_132` (`api_key_id`) USING BTREE," +
350-
"CONSTRAINT `FK_130` FOREIGN KEY (`api_key_id`) REFERENCES `plotsystem_test`.`api_keys` (`api_key`) ON UPDATE RESTRICT ON DELETE RESTRICT" +
349+
"KEY `FK_132` (`api_key_id`)," +
350+
"CONSTRAINT `FK_130` FOREIGN KEY `FK_132` (`api_key_id`) REFERENCES `plotsystem_api_keys` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT" +
351351
")" +
352352
"COLLATE='utf8mb4_general_ci'" +
353353
"ENGINE=InnoDB" +
@@ -359,10 +359,10 @@ public static List<String> getTables() {
359359
"`country_id` INT(11) NOT NULL," +
360360
"`buildteam_id` INT(11) NOT NULL," +
361361
"PRIMARY KEY (`id`) USING BTREE," +
362-
"INDEX `FK_115` (`buildteam_id`) USING BTREE," +
363-
"INDEX `FK_118` (`country_id`) USING BTREE," +
364-
"CONSTRAINT `FK_113` FOREIGN KEY (`buildteam_id`) REFERENCES `plotsystem_test`.`plotsystem_buildteams` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT," +
365-
"CONSTRAINT `FK_116` FOREIGN KEY (`country_id`) REFERENCES `plotsystem_test`.`plotsystem_countries` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT" +
362+
"KEY `FK_115` (`buildteam_id`)," +
363+
"KEY `FK_118` (`country_id`)," +
364+
"CONSTRAINT `FK_113` FOREIGN KEY `FK_115` (`buildteam_id`) REFERENCES `plotsystem_buildteams` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT," +
365+
"CONSTRAINT `FK_116` FOREIGN KEY `FK_118` (`country_id`) REFERENCES `plotsystem_countries` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT" +
366366
")" +
367367
"COLLATE='utf8mb4_general_ci'" +
368368
"ENGINE=InnoDB" +
@@ -374,10 +374,10 @@ public static List<String> getTables() {
374374
"`builder_uuid` VARCHAR(36) NOT NULL COLLATE 'utf8mb4_general_ci'," +
375375
"`buildteam_id` INT(11) NOT NULL," +
376376
"PRIMARY KEY (`id`) USING BTREE," +
377-
"INDEX `FK_138` (`builder_uuid`) USING BTREE," +
378-
"INDEX `FK_141` (`buildteam_id`) USING BTREE," +
379-
"CONSTRAINT `FK_136` FOREIGN KEY (`builder_uuid`) REFERENCES `plotsystem_test`.`plotsystem_builders` (`uuid`) ON UPDATE RESTRICT ON DELETE RESTRICT," +
380-
"CONSTRAINT `FK_139` FOREIGN KEY (`buildteam_id`) REFERENCES `plotsystem_test`.`plotsystem_buildteams` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT" +
377+
"KEY `FK_138` (`builder_uuid`)," +
378+
"KEY `FK_141` (`buildteam_id`)," +
379+
"CONSTRAINT `FK_136` FOREIGN KEY `FK_138` (`builder_uuid`) REFERENCES `plotsystem_builders` (`uuid`) ON UPDATE RESTRICT ON DELETE RESTRICT," +
380+
"CONSTRAINT `FK_139` FOREIGN KEY `FK_141` (`buildteam_id`) REFERENCES `plotsystem_buildteams` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT" +
381381
")" +
382382
"COLLATE='utf8mb4_general_ci'" +
383383
"ENGINE=InnoDB" +

0 commit comments

Comments
 (0)