31 lines
837 B
PHP
31 lines
837 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('reservations', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedInteger('x');
|
|
$table->unsignedInteger('y');
|
|
$table->unsignedInteger('w');
|
|
$table->unsignedInteger('h');
|
|
$table->string('status')->default('held');
|
|
$table->unsignedBigInteger('user_id')->nullable();
|
|
$table->dateTime('reserved_until')->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->index(['x', 'y']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('reservations');
|
|
}
|
|
};
|