<?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::create('weekly_pump_prices', function (Blueprint $table) {
            $table->date('date')->primary()->comment('Week starting (Monday) per BEIS publication');
            $table->unsignedSmallInteger('ulsp_pence')->comment('Petrol pump price × 100');
            $table->unsignedSmallInteger('ulsd_pence')->comment('Diesel pump price × 100');
            $table->unsignedSmallInteger('ulsp_duty_pence')->comment('Petrol duty × 100');
            $table->unsignedSmallInteger('ulsd_duty_pence')->comment('Diesel duty × 100');
            $table->unsignedTinyInteger('ulsp_vat_pct')->comment('VAT %');
            $table->unsignedTinyInteger('ulsd_vat_pct')->comment('VAT %');
        });
    }

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