Use new shortcuts for migrations

This commit is contained in:
Franz Liedke 2016-03-04 01:11:39 +09:00
parent 861ff6e910
commit af76eff949

View File

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