Table Migration

This commit is contained in:
Václav Španinger 2021-01-08 10:03:19 +01:00
parent 498a71fc71
commit eb48d616a8
2 changed files with 14 additions and 0 deletions

View File

@ -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();
});
}

View File

@ -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();