<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        if(!Schema::hasTable('blacklist')) {
            Schema::create('blacklist', function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->string('entity_id')->unique();
                $table->string('entity_name')->default('');
                $table->enum('entity_type', [
                    'character',
                    'corporation',
                    'alliance',
                    'coalition',
                ]);
                $table->text('reason');
                $table->string('lister_id');
                $table->string('lister_name');
                $table->enum('state', [
                    'Added',
                    'Removed',
                    'Neither',
                ])->default('Neither');
                $table->string('removed_by_id')->nullable();
                $table->string('removed_by_name')->nullable();
                $table->text('removed_notes')->nullable();
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('blacklist');
    }
};
