<?php

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

/**
 * `invoice_prefix` was a pure data-entry field on the till — nothing ever read
 * it (invoice numbering is DocumentNumberService's year-scoped sequences), so
 * it was dropped from every till form. Removing the column closes the loop.
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('tills', function (Blueprint $table) {
            $table->dropColumn('invoice_prefix');
        });
    }

    public function down(): void
    {
        Schema::table('tills', function (Blueprint $table) {
            $table->string('invoice_prefix', 10)->nullable()->after('name');
        });
    }
};
