From 45b6808b2b5ffaf4bcbb963a2f51fa7441894a5b Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:59:36 +0000 Subject: [PATCH] feat: create migration for invoices table with sch --- ...xxx_xx_xx_xxxxxx_create_invoices_table.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 database/migrations/xxxx_xx_xx_xxxxxx_create_invoices_table.php 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'); + } +}