<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('spam_db', function (Blueprint $table) {
            $table->set('type', ['GOOD', 'SPAM'])->default('SPAM');
            $table->string('word', 256)->primary();
            $table->integer('score')->default(10);

            $table->index('type');
        });
    }

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