<?php

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

class AddPelaburanToVoterTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
{
    Schema::table('voter', function (Blueprint $table) {
        $table->decimal('pelaburan', 12, 2)->default(0)->after('yuran');
        $table->decimal('tergempar', 12, 2)->default(0)->after('pelaburan');
        $table->decimal('barangan', 12, 2)->default(0)->after('tergempar');
        $table->decimal('peribadi', 12, 2)->default(0)->after('barangan');
        $table->decimal('berjamin_yuran', 12, 2)->default(0)->after('peribadi');
        $table->decimal('roadtax', 12, 2)->default(0)->after('berjamin_yuran');
        $table->decimal('pelbagai', 12, 2)->default(0)->after('roadtax');

    });
}

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('voter', function (Blueprint $table) {
            //
            $table->dropColumn([
                'pelaburan',
                'tergempar',
                'barangan',
                'peribadi',
                'berjamin_yuran',
                'roadtax',
                'pelbagai'
            ]);
        });
    }
}
