Files
hqland-app/database/migrations/2025_01_08_000000_create_payments_table.php

22 lines
983 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('payments', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->foreignUuid('contract_id')->constrained('contracts')->cascadeOnDelete();
$table->string('payment_type');
$table->integer('installment_no')->default(1);
$table->decimal('amount', 15, 2);
$table->date('due_date')->nullable();
$table->date('paid_date')->nullable();
$table->string('status')->default('PENDING'); // PENDING, PAID, OVERDUE, CANCELLED
$table->string('receipt_number')->nullable();
$table->jsonb('metadata')->nullable();
$table->timestamps();
});
}
public function down(): void { Schema::dropIfExists('payments'); }
};