<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('restaurant_tables', function (Blueprint $table) {
            $table->integer('pos_x')->default(0)->after('status');
            $table->integer('pos_y')->default(0)->after('pos_x');
            $table->integer('width')->default(120)->after('pos_y');
            $table->integer('height')->default(120)->after('width');
            $table->string('shape')->default('square')->after('height'); // square, circle
        });
    }

    public function down(): void
    {
        Schema::table('restaurant_tables', function (Blueprint $table) {
            $table->dropColumn(['pos_x', 'pos_y', 'width', 'height', 'shape']);
        });
    }
};
