From 937851bb613c6ab3790455cbbd6d092feb055dc6 Mon Sep 17 00:00:00 2001 From: daengdeni Date: Wed, 15 Jan 2025 10:41:30 +0700 Subject: [PATCH] feat(database): create migration for temp_accounts table - Menambahkan file migrasi untuk tabel temp_accounts. - Menggunakan array untuk mendefinisikan field tabel. - Menyediakan fungsi untuk membuat dan menghapus tabel. --- ...1_15_032951_create_temp_accounts_table.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 database/migrations/2025_01_15_032951_create_temp_accounts_table.php diff --git a/database/migrations/2025_01_15_032951_create_temp_accounts_table.php b/database/migrations/2025_01_15_032951_create_temp_accounts_table.php new file mode 100644 index 0000000..a866f0c --- /dev/null +++ b/database/migrations/2025_01_15_032951_create_temp_accounts_table.php @@ -0,0 +1,38 @@ +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_accounts'); + } +};