<?php

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

class CleanWebArtists extends Migration
{
    public function up()
    {
        Schema::table('web_artists', function (Blueprint $table) {
            $table->dropColumn('title');
        });

        Schema::table('web_artists', function (Blueprint $table) {
            $table->renameColumn('datahub_id', 'agent_id');
            $table->index('agent_id');
        });
    }

    public function down()
    {
        Schema::table('web_artists', function (Blueprint $table) {
            $table->text('title')->after('id');
        });

        Schema::table('web_artists', function (Blueprint $table) {
            $table->dropIndex(['agent_id']);
            $table->renameColumn('agent_id', 'datahub_id');
        });
    }
}

<?php

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

class CleanWebArtists extends Migration
{
    public function up()
    {
        Schema::table('web_artists', function (Blueprint $table) {
            $table->dropColumn('title');
        });

        Schema::table('web_artists', function (Blueprint $table) {
            $table->renameColumn('datahub_id', 'agent_id');
            $table->index('agent_id');
        });

        Schema::table('web_artists', function (Blueprint $table) {
            $table->integer('agent_id')->after('id')->change();
        });
    }

    public function down()
    {
        Schema::table('web_artists', function (Blueprint $table) {
            // API-337: Not nullable as an oversight!
            $table->text('title')->after('id');
        });

        Schema::table('web_artists', function (Blueprint $table) {
            $table->integer('agent_id')->after('intro_copy')->change();
        });

        Schema::table('web_artists', function (Blueprint $table) {
            $table->dropIndex(['agent_id']);
            $table->renameColumn('agent_id', 'datahub_id');
        });
    }
}

Move `agent_id` after `id` in `web_artists` [API-341, API-338]
Move `agent_id` after `id` in `web_artists` [API-341, API-338]
