Merge branch '3.0' of https://git.steelants.cz/SH/PHP_SMART_HOME_V3 into 3.0
This commit is contained in:
commit
c608b34de4
5
.gitignore
vendored
5
.gitignore
vendored
@ -12,3 +12,8 @@ Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
.idea/
|
||||
|
||||
|
||||
|
||||
|
||||
.vscode
|
||||
|
@ -14,9 +14,12 @@ 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');
|
||||
$table->timestamps();
|
||||
$table->forgein('owner_id')->references('user_id')->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,23 @@ 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('owner_id'); //TODO: Foregin key to user Table
|
||||
$table->string('token')->unique();
|
||||
$table->boolval('approved');
|
||||
$table->string('name')->unique();
|
||||
$table->string('description')->nullable();
|
||||
$table->string('type');
|
||||
$table->string('icon');
|
||||
$table->string('mac_address');
|
||||
$table->string('ip_address')->unique();
|
||||
$table->string('firmware_hash');
|
||||
$table->string('sleep_time');
|
||||
$table->datetime('heartbeat');
|
||||
$table->string('command');
|
||||
$table->forgein('owner_id')->references('user_id')->on('users');
|
||||
$table->forgein('room_id')->references('room_id')->on('rooms');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user