Foregin Keys
This commit is contained in:
parent
27e9ef9f27
commit
e38421ca2f
@ -19,6 +19,7 @@ class CreateRoomsTable extends Migration
|
||||
$table->int('owner_id'); //TODO: Foregin key to user Table
|
||||
$table->boolval('default');
|
||||
$table->timestamps();
|
||||
$table->forgein('owner_id')->references('user_id')->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,10 @@ class CreateDevicesTable extends Migration
|
||||
$table->string('ip_address')->unique();
|
||||
$table->string('firmware_hash');
|
||||
$table->string('sleep_time');
|
||||
$table->datetime('heartbeat')
|
||||
$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