<?php

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

class ChangeOwnerOperationOwnerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('owner_price_operation_owner', function (Blueprint $table) {
            $table->date("discount_date")->nullable()->comment("满减标记日");
            $table->integer("target_value")->nullable()->comment("目标值");
        });
        Schema::table('owner_price_operations', function (Blueprint $table) {
            $table->dropColumn("discount_date");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('owner_price_operation_owner', function (Blueprint $table) {
            $table->dropColumn("discount_date");
            $table->dropColumn("target_value");
        });
        Schema::table('owner_price_operations', function (Blueprint $table) {
            $table->date("discount_date")->nullable()->comment("满减标记日");
        });
    }
}
