Use new shortcuts for migrations

This commit is contained in:
Franz Liedke 2016-03-04 01:12:03 +09:00
parent 6a9391d02e
commit ec3db146fc
2 changed files with 16 additions and 26 deletions

View File

@ -8,19 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [ return Migration::createTable(
'up' => function (Builder $schema) { 'mentions_posts',
$schema->create('mentions_posts', function (Blueprint $table) { function (Blueprint $table) {
$table->integer('post_id')->unsigned(); $table->integer('post_id')->unsigned();
$table->integer('mentions_id')->unsigned(); $table->integer('mentions_id')->unsigned();
$table->primary(['post_id', 'mentions_id']); $table->primary(['post_id', 'mentions_id']);
});
},
'down' => function (Builder $schema) {
$schema->drop('mentions_posts');
} }
]; );

View File

@ -8,19 +8,14 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [ return Migration::createTable(
'up' => function (Builder $schema) { 'mentions_users',
$schema->create('mentions_users', function (Blueprint $table) { function (Blueprint $table) {
$table->integer('post_id')->unsigned(); $table->integer('post_id')->unsigned();
$table->integer('mentions_id')->unsigned(); $table->integer('mentions_id')->unsigned();
$table->primary(['post_id', 'mentions_id']); $table->primary(['post_id', 'mentions_id']);
});
},
'down' => function (Builder $schema) {
$schema->drop('mentions_users');
} }
]; );