Files
Verde-Web/database/migrations/2026_04_30_100001_create_provinces_table.php
admin c8404564fe feat(backend): complete Modules 2 + 3 (geo + user management)
Module 2 — Geographic Data: PSGC tables (regions/provinces/cities/
barangays) with native geometry(polygon|point, 4326) columns; cascading
dropdown endpoints; ST_Contains-based GPS resolution; service-area CRUD
with barangay attach/detach; SamplePsgcSeeder + psgc:import command.

Module 3 — User Management: 5 role-specific profile tables (driver/
helper/scanner/store_partner with verification_status + rejection
reason); profile auto-created on register; admin user CRUD with
filters/pagination, suspend/activate, profile approve/reject;
self-service /me + /me/profile with role-aware validation that blocks
self-approval and resets rejected profiles to pending on resubmit.

69 feature tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 23:59:56 +08:00

30 lines
824 B
PHP

<?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::create('provinces', function (Blueprint $table) {
$table->id();
$table->string('psgc_code', 12)->unique();
$table->string('code', 16)->unique();
$table->string('name', 191);
$table->foreignId('region_id')->constrained()->cascadeOnDelete();
$table->string('income_classification', 32)->nullable();
$table->timestamps();
$table->softDeletes();
$table->index(['region_id', 'name']);
});
}
public function down(): void
{
Schema::dropIfExists('provinces');
}
};