diff --git a/app/Util/MigrationHelper.php b/app/Util/MigrationHelper.php index bf2870a..70ae284 100644 --- a/app/Util/MigrationHelper.php +++ b/app/Util/MigrationHelper.php @@ -112,6 +112,12 @@ class MigrationHelper $this->table->dropIndex($indexName); return $this; } + public function dropUnique(int $number) + { + $uniqueName = $this->getUniqueName($number); + $this->table->dropUnique($uniqueName); + return $this; + } private function getIndexName(int $number) { diff --git a/database/migrations/2023_10_10_183900_dropunique_password_setting_tokens_table.php b/database/migrations/2023_10_10_183900_dropunique_password_setting_tokens_table.php new file mode 100644 index 0000000..7f6f263 --- /dev/null +++ b/database/migrations/2023_10_10_183900_dropunique_password_setting_tokens_table.php @@ -0,0 +1,29 @@ +dropUnique("password_setting_tokens_user_id_unique"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('password_setting_tokens', function (Blueprint $table) { + $table->uuid(ColumnName::USER_ID)->unique()->change(); + }); + } +}; diff --git a/database/migrations/2023_10_10_192200_dropunique_email_change_tokens_table.php b/database/migrations/2023_10_10_192200_dropunique_email_change_tokens_table.php new file mode 100644 index 0000000..25beb02 --- /dev/null +++ b/database/migrations/2023_10_10_192200_dropunique_email_change_tokens_table.php @@ -0,0 +1,29 @@ +dropUnique("email_change_tokens_user_id_unique"); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('email_change_tokens', function (Blueprint $table) { + $table->uuid(ColumnName::USER_ID)->unique()->change(); + }); + } +};