You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

48 lines
1.1 KiB

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class Init extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(
'rooms',
function (Blueprint $table) {
$table->id();
$table->integer('number');
$table->string('name')->nullable();
$table->text('description')->nullable();
$table->integer('max_occupancy');
}
);
Schema::create(
'bookings',
function (Blueprint $table) {
$table->id();
$table->foreignId('room_id')->constrained('rooms');
$table->string('guest_name');
$table->date('date');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('bookings');
Schema::drop('rooms');
}
}