<?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___example_items table
 * (child rows for the Example model's hasMany relationship).
 */
class ExampleItemMigrator extends Migrator
{
    /** @var string Table name (without the WordPress prefix). */
    protected static $table = '__SNAKE_NAME___example_items';

    /**
     * Build / update the schema.
     *
     * @return void
     */
    public static function up()
    {
        Schema::create(static::$table, function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('example_id');
            $table->string('label', 191);
            $table->timestamps();
            $table->index('example_id');
        });
    }
}
