From f76aaf2e2ac9bfa2156f2cdc38a772f5d859e0c7 Mon Sep 17 00:00:00 2001 From: cp6 Date: Thu, 3 Mar 2022 14:51:47 +1100 Subject: [PATCH] Updated migrations for unique Updated migrations for unique --- database/migrations/2022_02_03_035702_create_labels_table.php | 2 +- .../2022_02_08_010323_create_labels_assigned_table.php | 4 ++-- database/migrations/2022_02_21_001233_create_ips_table.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2022_02_03_035702_create_labels_table.php b/database/migrations/2022_02_03_035702_create_labels_table.php index 270318b..8facfc9 100644 --- a/database/migrations/2022_02_03_035702_create_labels_table.php +++ b/database/migrations/2022_02_03_035702_create_labels_table.php @@ -15,7 +15,7 @@ class CreateLabelsTable extends Migration { Schema::create('labels', function (Blueprint $table) { $table->char('id', 8)->primary()->default(null); - $table->string('label'); + $table->string('label')->unique(); $table->timestamps(); }); } 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 e0a4da8..fc33240 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,8 @@ class CreateLabelsAssignedTable extends Migration public function up() { Schema::create('labels_assigned', function (Blueprint $table) { - $table->char('label_id', 8); - $table->char('service_id', 8); + $table->char('label_id', 8)->unique(); + $table->char('service_id', 8)->unique(); }); } diff --git a/database/migrations/2022_02_21_001233_create_ips_table.php b/database/migrations/2022_02_21_001233_create_ips_table.php index 5dac351..6b0e468 100644 --- a/database/migrations/2022_02_21_001233_create_ips_table.php +++ b/database/migrations/2022_02_21_001233_create_ips_table.php @@ -10,7 +10,7 @@ class CreateIPsTable extends Migration { Schema::create('ips', function (Blueprint $table) { $table->char('id', 8)->unique(); - $table->char('service_id', 8); + $table->char('service_id', 8)->unique(); $table->string('address'); $table->tinyInteger('is_ipv4')->default(1); $table->tinyInteger('active')->default(1);