From b7ce9b74026f0ad26071983fe6c14a1eec0ae147 Mon Sep 17 00:00:00 2001 From: cp6 Date: Sat, 5 Mar 2022 01:00:21 +1100 Subject: [PATCH] Updated labels_assigned migration for unique key index Updated labels_assigned migration for unique key index --- .../2022_02_08_010323_create_labels_assigned_table.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/database/migrations/2022_02_08_010323_create_labels_assigned_table.php b/database/migrations/2022_02_08_010323_create_labels_assigned_table.php index fc33240..e332741 100644 --- a/database/migrations/2022_02_08_010323_create_labels_assigned_table.php +++ b/database/migrations/2022_02_08_010323_create_labels_assigned_table.php @@ -14,8 +14,9 @@ class CreateLabelsAssignedTable extends Migration public function up() { Schema::create('labels_assigned', function (Blueprint $table) { - $table->char('label_id', 8)->unique(); - $table->char('service_id', 8)->unique(); + $table->char('label_id', 8); + $table->char('service_id', 8); + $table->unique(['label_id','service_id'], 'uni'); }); }