<?php

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

class AddMembershipFieldsToMembersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('members', function (Blueprint $table) {
            $table->dateTime('start_membership', 0)->after('kvk_number')->nullable();
            $table->dateTime('end_membership', 0)->after('start_membership')->nullable();
            $table->string('contribution')->after('end_membership')->nullable();
            $table->string('invoice_number')->after('contribution')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('members', function (Blueprint $table) {
            $table->dropColumn('start_membership');
            $table->dropColumn('end_membership');
            $table->dropColumn('contribution');
            $table->dropColumn('invoice_number');
        });
    }
}
