feat: add weekly_pump_prices migration for BEIS fuel price data
Created migration for storing UK weekly pump prices from BEIS publications. Table uses Monday date as primary key and stores petrol/diesel pump prices, duty, and VAT rates as integer pence or percentage values.
This commit is contained in:
@@ -0,0 +1,32 @@
|
|||||||
|
<?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');
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user