From 1319133125f6038202bd332b08cc44ab12c8bd76 Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Sun, 17 Sep 2023 10:08:10 +0200 Subject: [PATCH] Unique constraint for config keys --- ...16_234050_require_single_key_in_config.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 database/migrations/2023_09_16_234050_require_single_key_in_config.php diff --git a/database/migrations/2023_09_16_234050_require_single_key_in_config.php b/database/migrations/2023_09_16_234050_require_single_key_in_config.php new file mode 100644 index 00000000000..196e4fdfcd1 --- /dev/null +++ b/database/migrations/2023_09_16_234050_require_single_key_in_config.php @@ -0,0 +1,27 @@ +unique('key'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('configs', function (Blueprint $table) { + $table->dropUnique(['key']); + }); + } +};