31 lines
1.0 KiB
PHP
31 lines
1.0 KiB
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->id();
|
|
$table->foreignId('contract_id')->constrained('contracts')->onDelete('cascade');
|
|
$table->string('payment_type');
|
|
$table->string('payment_number')->nullable();
|
|
$table->string('bank_name')->nullable();
|
|
$table->decimal('amount', 15, 2);
|
|
$table->date('due_date');
|
|
$table->string('status')->default('pending');
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
$table->foreignId('created_by')->nullable()->constrained('users');
|
|
$table->foreignId('updated_by')->nullable()->constrained('users');
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('payments');
|
|
}
|
|
}; |