diff --git a/database/migrations/2026_02_04_222005_create_receivables_table.php b/database/migrations/2026_02_04_222005_create_receivables_table.php new file mode 100644 index 0000000..d672cd4 --- /dev/null +++ b/database/migrations/2026_02_04_222005_create_receivables_table.php @@ -0,0 +1,35 @@ +id(); + $table->unsignedBigInteger('tenant_id'); + $table->string('customer_name', 100); + $table->string('invoice_no', 50); + $table->date('issue_date'); + $table->date('due_date')->nullable(); + $table->string('category', 50)->default('서비스'); + $table->bigInteger('amount')->default(0); + $table->bigInteger('collected_amount')->default(0); + $table->string('status', 20)->default('outstanding'); // outstanding, partial, collected, overdue + $table->string('description', 255)->nullable(); + $table->text('memo')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['tenant_id', 'status']); + $table->index(['tenant_id', 'due_date']); + }); + } + + public function down(): void + { + Schema::dropIfExists('receivables'); + } +};