<?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('station_prices', function (Blueprint $table): void {
            $table->unsignedMediumInteger('price_pence')
                ->comment('Price in pence × 100, e.g. 15990 = 159.90p')
                ->change();
        });

        Schema::table('station_prices_current', function (Blueprint $table): void {
            $table->unsignedMediumInteger('price_pence')
                ->comment('Price in pence × 100, e.g. 15990 = 159.90p')
                ->change();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('station_prices', function (Blueprint $table): void {
            $table->unsignedSmallInteger('price_pence')
                ->comment('Price in pence × 100')
                ->change();
        });

        Schema::table('station_prices_current', function (Blueprint $table): void {
            $table->unsignedSmallInteger('price_pence')
                ->comment('Price in pence × 100, e.g. 15990 = 159.90p')
                ->change();
        });
    }
};
