<?php

namespace PluginsNameSpaces\Database\Migrations;

use PluginsNameSpaces\Framework\Database\Schema\Schema;
use PluginsNameSpaces\Framework\Database\Schema\Blueprint;
use PluginsNameSpaces\Framework\Database\Migration\Migrator;

/**
 * Creates the {prefix}___SNAKE_NAME___examples table using the Schema
 * builder. Use this as a template for your own migrations and register
 * the class in Database\DBMigrator::$migrations.
 */
class ExampleMigrator extends Migrator
{
    /** @var string Table name (without the WordPress prefix). */
    protected static $table = '__SNAKE_NAME___examples';

    /**
     * Build / update the schema.
     *
     * @return void
     */
    public static function up()
    {
        Schema::create(static::$table, function (Blueprint $table) {
            $table->id();
            $table->string('title', 191);
            $table->string('status', 50)->default('active');
            $table->longText('meta')->nullable();
            $table->timestamps();
            $table->index('status');
        });
    }
}
