<?php

use App\Database\Blueprint;
use App\Enums\DbStatusFieldEnum;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('addresses', function (Blueprint $table) {
            $table->id();
            $table->string('postCode')->nullable();
            $table->string('city')->nullable();
            $table->string('street');
            $table->string('note')->nullable();
            $table->string('name')->nullable();
            $table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
            $table->boolean('canSee')->default(true);
            $table->integer('attachable_id')->unsigned()->nullable();
            $table->string('attachable_type')->nullable();
            $table->timestamps();
            $table->softDeletes();
            $table->userIdFields();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('addresses');
    }
};
