From eb48d616a8252cbca6d828663dcae4bfcf96e6ec Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Fri, 8 Jan 2021 10:03:19 +0100 Subject: [PATCH] Table Migration --- .../2021_01_07_183923_create_rooms_table.php | 2 ++ .../2021_01_07_184250_create_devices_table.php | 12 ++++++++++++ 2 files changed, 14 insertions(+) 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 546fbfa..c5b1c8c 100644 --- a/database/migrations/2021_01_07_183923_create_rooms_table.php +++ b/database/migrations/2021_01_07_183923_create_rooms_table.php @@ -16,6 +16,8 @@ class CreateRoomsTable extends Migration Schema::create('rooms', function (Blueprint $table) { $table->id(); $table->string('name')->unique(); + $table->int('owner_id'); //TODO: Foregin key to user Table + $table->boolval('default'); $table->timestamps(); }); } 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 e743c72..7fb35be 100644 --- a/database/migrations/2021_01_07_184250_create_devices_table.php +++ b/database/migrations/2021_01_07_184250_create_devices_table.php @@ -15,6 +15,18 @@ class CreateDevicesTable extends Migration { Schema::create('devices', function (Blueprint $table) { $table->id(); + $table->int('room_id'); //TODO: Foregin key to Room Table + $table->string('type'); + $table->string('token'); + $table->datetime('heartbeat') + $table->string('mac'); + $table->string('firmware_hash'); + $table->string('ip_address'); + $table->string('sleep_time'); + $table->string('owner_id'); //TODO: Foregin key to user Table + $table->boolval('approved'); + $table->string('icon'); + $table->string('command'); $table->string('name')->unique(); $table->string('description')->nullable(); $table->timestamps();