<?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('currencies',function(Blueprint $t){$t->char('code',3)->primary();$t->string('name',60);$t->string('symbol',8);$t->unsignedTinyInteger('decimals');$t->boolean('is_active')->default(true);$t->timestamps();});
 Schema::create('countries',function(Blueprint $t){$t->id();$t->char('iso2',2)->unique();$t->char('iso3',3);$t->string('name',100);$t->string('dial_code',8);$t->char('currency_code',3);$t->boolean('is_active')->default(true);$t->timestamps();$t->foreign('currency_code')->references('code')->on('currencies');});
 Schema::create('corridors',function(Blueprint $t){$t->id();$t->foreignId('from_country_id')->constrained('countries');$t->foreignId('to_country_id')->constrained('countries');$t->unsignedBigInteger('min_amount_minor');$t->unsignedBigInteger('max_amount_minor');$t->unsignedBigInteger('daily_cap_minor');$t->unsignedInteger('code_validity_hours')->default(72);$t->boolean('is_active')->default(true);$t->timestamps();$t->unique(['from_country_id','to_country_id']);});
 } public function down():void{Schema::dropIfExists('corridors');Schema::dropIfExists('countries');Schema::dropIfExists('currencies');}};
