<?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::table('locations', function (Blueprint $t) {
            $t->string('place_name', 255)->nullable()->after('display_name');
            $t->index('place_name', 'locations_place_name_idx');
        });
    }

    public function down(): void
    {
        Schema::table('locations', function (Blueprint $t) {
            $t->dropIndex('locations_place_name_idx');
            $t->dropColumn('place_name');
        });
    }
};
