From d69e01d6c78ee2d5a49e2dc9cff4c918c8572e6a Mon Sep 17 00:00:00 2001 From: Truong Vo <41848815+vmtruong301296@users.noreply.github.com> Date: Tue, 6 Aug 2024 07:57:45 +0700 Subject: [PATCH] =?UTF-8?q?B=E1=BB=95=20sung=20default=20data=20migrate=20?= =?UTF-8?q?cho=20b=E1=BA=A3ng=20danh=20m=E1=BB=A5c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4_08_02_025714_create_categories_table.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/BACKEND/database/migrations/2024_08_02_025714_create_categories_table.php b/BACKEND/database/migrations/2024_08_02_025714_create_categories_table.php index 39f5297..0336713 100644 --- a/BACKEND/database/migrations/2024_08_02_025714_create_categories_table.php +++ b/BACKEND/database/migrations/2024_08_02_025714_create_categories_table.php @@ -2,6 +2,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; return new class extends Migration @@ -20,6 +21,54 @@ return new class extends Migration $table->integer('c_active'); $table->timestamps(); }); + + DB::table('categories')->insert([ + [ + 'c_code' => 'S', + 'c_name' => 'Buổi Sáng', + 'c_type' => 'TIME_TYPE', + 'c_value' => null, + 'c_active' => 1, + 'created_at' => now(), + 'updated_at' => now(), + ], + [ + 'c_code' => 'C', + 'c_name' => 'Buổi Chiều', + 'c_type' => 'TIME_TYPE', + 'c_value' => null, + 'c_active' => 1, + 'created_at' => now(), + 'updated_at' => now(), + ], + [ + 'c_code' => 'ALL', + 'c_name' => 'Cả Ngày', + 'c_type' => 'TIME_TYPE', + 'c_value' => null, + 'c_active' => 1, + 'created_at' => now(), + 'updated_at' => now(), + ], + [ + 'c_code' => 'WFH', + 'c_name' => 'Work For Home', + 'c_type' => 'REASON', + 'c_value' => null, + 'c_active' => 1, + 'created_at' => now(), + 'updated_at' => now(), + ], + [ + 'c_code' => 'ONLEAVE', + 'c_name' => 'Nghỉ phép', + 'c_type' => 'REASON', + 'c_value' => null, + 'c_active' => 1, + 'created_at' => now(), + 'updated_at' => now(), + ], + ]); } /**