From 314d9bfce55de6218b0a45fa00b3a7c7ccaac477 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Wed, 15 Jan 2025 09:23:31 +0700 Subject: [PATCH] feat(database): create migration for temp_customers table - Menambahkan file migrasi untuk tabel temp_customers. - Menggunakan array field untuk mendefinisikan kolom tabel. - Menyediakan fungsi untuk membuat dan menghapus tabel. --- ..._10_030946_create_temp_customers_table.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 database/migrations/2024_12_10_030946_create_temp_customers_table.php diff --git a/database/migrations/2024_12_10_030946_create_temp_customers_table.php b/database/migrations/2024_12_10_030946_create_temp_customers_table.php new file mode 100644 index 0000000..b2ea52c --- /dev/null +++ b/database/migrations/2024_12_10_030946_create_temp_customers_table.php @@ -0,0 +1,37 @@ +id(); + foreach ($fieldArray as $field) { + $field = trim($field); + if ($field !== '@id') { // Skip @id as we already have $table->id() + $table->text($field)->nullable(); + } + } + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('temp_customers'); + } +};