From c8a78c688ff239cb1c581a964a0ffb8bb0c8b3c6 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Fri, 10 Apr 2020 15:54:28 -0700 Subject: [PATCH] Apply unique key after assigning all of the values --- ...04_10_141024_store_node_tokens_as_encrypted_value.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php b/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php index 22c53397b..128c12ce2 100644 --- a/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php +++ b/database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php @@ -23,8 +23,8 @@ class StoreNodeTokensAsEncryptedValue extends Migration }); Schema::table('nodes', function (Blueprint $table) { - $table->char('uuid', 36)->after('id')->unique(); - $table->char('daemon_token_id', 16)->after('upload_size')->unique(); + $table->char('uuid', 36)->after('id'); + $table->char('daemon_token_id', 16)->after('upload_size'); $table->renameColumn('daemonSecret', 'daemon_token'); }); @@ -45,6 +45,11 @@ class StoreNodeTokensAsEncryptedValue extends Migration ]); } }); + + Schema::table('nodes', function (Blueprint $table) { + $table->unique(['uuid']); + $table->unique(['daemon_token_id']); + }); } /**