<?php

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

class ChangePackageColumnsDecimal extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('packages',function (Blueprint $table){
            $table->decimal('weight',10,2)->comment('重KG')->change();
            $table->decimal('length',10,2)->comment('长(cm)')->change();
            $table->decimal('width',10,2)->comment('宽(cm)')->change();
            $table->decimal('height',10,2)->comment('高(cm)')->change();
            $table->decimal('bulk',16,2)->nullable()->comment('体积(cm³)')->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('packages', function (Blueprint $table) {
            $table->decimal('weight',8,2)->nullable()->comment('重KG')->change();
            $table->decimal('length',8,2)->nullable()->comment('长(cm)')->change();
            $table->decimal('width',8,2)->nullable()->comment('宽(cm)')->change();
            $table->decimal('height',8,2)->nullable()->comment('高(cm)')->change();
            $table->decimal('bulk',8,2)->nullable()->comment('体积(cm³)')->change();
        });
    }
}
