<?php

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

class GoliathSpecialFlag extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('prefix_goliath_flags', function (Blueprint $table) {
            $table->tinyInteger('flag_special')->nullable();
        });

        Schema::create('goliath_organisation_special', function (Blueprint $table) {
            $table->id();

            $table->timestamps();

            $table->tinyInteger('special')->nullable();

            $table->foreignId('organisation_id')->cascadeOnDelete()->constrained('organisations');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropColumns('prefix_goliath_flags', ['flag_special']);
        Schema::dropIfExists('goliath_organisation_special');
    }
}
