Implements some handy shortcuts for creating typical migrations.
<?php

namespace Davis\SocialProfile\Migration;

use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('socialbuttons', function (Blueprint $table) {
    $table->increments('id');
    $table->integer('user_id')->unsigned();
    $table->longText('buttons');
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('users', ['twitter_id' => ['string', 'length' => 255, 'nullable' => true]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('discussions', function (Blueprint $table) {
    $table->increments('id');
    $table->string('title', 200);
    $table->integer('comments_count')->unsigned()->default(0);
    $table->integer('participants_count')->unsigned()->default(0);
    $table->integer('number_index')->unsigned()->default(0);
    $table->dateTime('start_time');
    $table->integer('start_user_id')->unsigned()->nullable();
    $table->integer('start_post_id')->unsigned()->nullable();
    $table->dateTime('last_time')->nullable();
    $table->integer('last_user_id')->unsigned()->nullable();
    $table->integer('last_post_id')->unsigned()->nullable();
    $table->integer('last_post_number')->unsigned()->nullable();
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('users', ['flags_read_time' => ['dateTime', 'nullable' => true]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('discussions', ['is_approved' => ['boolean', 'default' => 1]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('users_tags', function (Blueprint $table) {
    $table->integer('user_id')->unsigned();
    $table->integer('tag_id')->unsigned();
    $table->dateTime('read_time')->nullable();
    $table->boolean('is_hidden')->default(0);
    $table->primary(['user_id', 'tag_id']);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('posts', ['ip_address' => ['string', 'length' => 45, 'nullable' => true]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('notifications', function (Blueprint $table) {
    $table->increments('id');
    $table->integer('user_id')->unsigned();
    $table->integer('sender_id')->unsigned()->nullable();
    $table->string('type', 100);
    $table->string('subject_type', 200)->nullable();
    $table->integer('subject_id')->unsigned()->nullable();
    $table->binary('data')->nullable();
    $table->dateTime('time');
    $table->boolean('is_read')->default(0);
    $table->boolean('is_deleted')->default(0);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('email_tokens', function (Blueprint $table) {
    $table->string('id', 100)->primary();
    $table->string('email', 150);
    $table->integer('user_id')->unsigned();
    $table->timestamp('created_at');
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('api_keys', function (Blueprint $table) {
    $table->string('id', 100)->primary();
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addSettings(['flarum-tags.max_primary_tags' => '1', 'flarum-tags.min_primary_tags' => '1', 'flarum-tags.max_secondary_tags' => '3', 'flarum-tags.min_secondary_tags' => '0']);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::renameTable('config', 'settings');
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('users_discussions', ['subscription' => ['enum', 'allowed' => ['follow', 'ignore'], 'nullable' => true]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('config', function (Blueprint $table) {
    $table->string('key', 100)->primary();
    $table->binary('value')->nullable();
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('groups', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name_singular', 100);
    $table->string('name_plural', 100);
    $table->string('color', 20)->nullable();
    $table->string('icon', 100)->nullable();
});
<?php

use Flarum\Database\Migration;
return Migration::addColumns('pages', ['is_html' => ['boolean', 'default' => 0]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('mentions_users', function (Blueprint $table) {
    $table->integer('post_id')->unsigned();
    $table->integer('mentions_id')->unsigned();
    $table->primary(['post_id', 'mentions_id']);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::renameColumn('users', 'notification_read_time', 'notifications_read_time');
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('auth_tokens', function (Blueprint $table) {
    $table->string('id', 100)->primary();
    $table->string('payload', 150);
    $table->timestamp('created_at');
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('posts', ['is_spam' => ['boolean', 'default' => 0]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('flags', function (Blueprint $table) {
    $table->increments('id');
    $table->integer('post_id')->unsigned();
    $table->string('type');
    $table->integer('user_id')->unsigned()->nullable();
    $table->string('reason')->nullable();
    $table->string('reason_detail')->nullable();
    $table->dateTime('time');
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('users_discussions', function (Blueprint $table) {
    $table->integer('user_id')->unsigned();
    $table->integer('discussion_id')->unsigned();
    $table->dateTime('read_time')->nullable();
    $table->integer('read_number')->unsigned()->nullable();
    $table->primary(['user_id', 'discussion_id']);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('users_groups', function (Blueprint $table) {
    $table->integer('user_id')->unsigned();
    $table->integer('group_id')->unsigned();
    $table->primary(['user_id', 'group_id']);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::renameColumn('users', 'suspended_until', 'suspend_until');
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('discussions', ['hide_time' => ['dateTime', 'nullable' => true], 'hide_user_id' => ['integer', 'unsigned' => true, 'nullable' => true]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('permissions', function (Blueprint $table) {
    $table->integer('group_id')->unsigned();
    $table->string('permission', 100);
    $table->primary(['group_id', 'permission']);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('discussions_tags', function (Blueprint $table) {
    $table->integer('discussion_id')->unsigned();
    $table->integer('tag_id')->unsigned();
    $table->primary(['discussion_id', 'tag_id']);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('discussions', ['is_sticky' => ['boolean', 'default' => 0]]);
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
return Migration::createTable('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('username', 100)->unique();
    $table->string('email', 150)->unique();
    $table->boolean('is_activated')->default(0);
    $table->string('password', 100);
    $table->text('bio')->nullable();
    $table->string('avatar_path', 100)->nullable();
    $table->binary('preferences')->nullable();
    $table->dateTime('join_time')->nullable();
    $table->dateTime('last_seen_time')->nullable();
    $table->dateTime('read_time')->nullable();
    $table->dateTime('notification_read_time')->nullable();
    $table->integer('discussions_count')->unsigned()->default(0);
    $table->integer('comments_count')->unsigned()->default(0);
});
<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Flarum\Database\Migration;
return Migration::addColumns('users', ['suspended_until' => ['dateTime', 'nullable' => true]]);