Skip to content

Commit c8a78c6

Browse files
committed
Apply unique key after assigning all of the values
1 parent 2532a73 commit c8a78c6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

database/migrations/2020_04_10_141024_store_node_tokens_as_encrypted_value.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public function up()
2323
});
2424

2525
Schema::table('nodes', function (Blueprint $table) {
26-
$table->char('uuid', 36)->after('id')->unique();
27-
$table->char('daemon_token_id', 16)->after('upload_size')->unique();
26+
$table->char('uuid', 36)->after('id');
27+
$table->char('daemon_token_id', 16)->after('upload_size');
2828
$table->renameColumn('daemonSecret', 'daemon_token');
2929
});
3030

@@ -45,6 +45,11 @@ public function up()
4545
]);
4646
}
4747
});
48+
49+
Schema::table('nodes', function (Blueprint $table) {
50+
$table->unique(['uuid']);
51+
$table->unique(['daemon_token_id']);
52+
});
4853
}
4954

5055
/**

0 commit comments

Comments
 (0)