Use new migration format

This commit is contained in:
Franz Liedke 2016-02-24 23:13:28 +09:00
parent b656f6f54c
commit f270a609cb
2 changed files with 16 additions and 26 deletions

View File

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

View File

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