From 7e5176d5f300885b7fdf68d3350e14371c21de32 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Fri, 8 Jan 2021 10:05:32 +0100 Subject: [PATCH] Migration Tweeks #1 --- .../migrations/2021_01_07_183923_create_rooms_table.php | 2 +- .../migrations/2021_01_07_184250_create_devices_table.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database/migrations/2021_01_07_183923_create_rooms_table.php b/database/migrations/2021_01_07_183923_create_rooms_table.php index c5b1c8c..f516447 100644 --- a/database/migrations/2021_01_07_183923_create_rooms_table.php +++ b/database/migrations/2021_01_07_183923_create_rooms_table.php @@ -14,7 +14,7 @@ class CreateRoomsTable extends Migration public function up() { Schema::create('rooms', function (Blueprint $table) { - $table->id(); + $table->id()->unique(); $table->string('name')->unique(); $table->int('owner_id'); //TODO: Foregin key to user Table $table->boolval('default'); diff --git a/database/migrations/2021_01_07_184250_create_devices_table.php b/database/migrations/2021_01_07_184250_create_devices_table.php index 7fb35be..a6b5ffc 100644 --- a/database/migrations/2021_01_07_184250_create_devices_table.php +++ b/database/migrations/2021_01_07_184250_create_devices_table.php @@ -14,14 +14,14 @@ class CreateDevicesTable extends Migration public function up() { Schema::create('devices', function (Blueprint $table) { - $table->id(); + $table->id()->unique(); $table->int('room_id'); //TODO: Foregin key to Room Table $table->string('type'); - $table->string('token'); + $table->string('token')->unique(); $table->datetime('heartbeat') $table->string('mac'); $table->string('firmware_hash'); - $table->string('ip_address'); + $table->string('ip_address')->unique(); $table->string('sleep_time'); $table->string('owner_id'); //TODO: Foregin key to user Table $table->boolval('approved');