<?php

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

class AddCheckAllIntoOptionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('product_options', function (Blueprint $table) {
            $table->boolean('is_indeterminate')->default(false)->after('is_template');
            $table->boolean('is_check_all')->default(true)->after('is_template');
        });
        Schema::table('product_option_details', function (Blueprint $table) {
            $table->boolean('is_check')->default(true)->after('position');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('product_options', function (Blueprint $table) {
            $table->dropColumn('is_indeterminate');
            $table->dropColumn('is_check_all');
        });
        Schema::table('product_option_details', function (Blueprint $table) {
            $table->dropColumn('is_check');
        });
    }
}
