<?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('invoice_schedules',function(Blueprint $t){$t->id();$t->foreignId('business_id')->index();$t->foreignId('account_id')->index();$t->foreignId('deal_id')->nullable()->index();$t->foreignId('operational_document_id')->nullable()->index();$t->foreignId('owner_id')->nullable()->index();$t->string('frequency');$t->date('next_invoice_date');$t->decimal('amount',15,2);$t->string('currency',8)->default('USD');$t->string('payment_terms')->default('Due on receipt');$t->text('description');$t->boolean('active')->default(true);$t->timestamps();});}public function down():void{Schema::dropIfExists('invoice_schedules');}};
