diff --git a/database/migrations/xxxx_xx_xx_xxxxxx_create_invoices_table.php b/database/migrations/xxxx_xx_xx_xxxxxx_create_invoices_table.php new file mode 100644 index 0000000..5409f66 --- /dev/null +++ b/database/migrations/xxxx_xx_xx_xxxxxx_create_invoices_table.php @@ -0,0 +1,29 @@ +id(); + $table->unsignedBigInteger('order_id'); + $table->unsignedBigInteger('customer_id'); + $table->timestamp('invoice_date'); + $table->decimal('total_amount', 10, 2); + $table->string('payment_status'); + $table->timestamps(); + + $table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade'); + $table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade'); + }); + } + + public function down() + { + Schema::dropIfExists('invoices'); + } +}