<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

class AddLimitLeaveMonthCategory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::table('categories')->insert([
            'c_code' => 'LIMIT',
            'c_name' => 'Giới hạn số ngày nghỉ có phép/tháng',
            'c_type' => 'LIMIT_LEAVE_MONTH',
            'c_value' => '3',
            'c_active' => 1,
            'created_at' => now(),
            'updated_at' => now(),
        ]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        DB::table('categories')
            ->where('c_code', 'LIMIT')
            ->where('c_type', 'LIMIT_LEAVE_MONTH')
            ->delete();
    }
}
