Bổ sung default data migrate cho bảng danh mục

This commit is contained in:
Truong Vo 2024-08-06 07:57:45 +07:00
parent ae5737c3bf
commit d69e01d6c7
1 changed files with 49 additions and 0 deletions

View File

@ -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(),
],
]);
}
/**