mirror of
https://github.com/flarum/core.git
synced 2025-08-02 22:47:33 +02:00
Use new migration format
This commit is contained in:
@@ -8,24 +8,19 @@
|
|||||||
* file that was distributed with this source code.
|
* 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\Blueprint;
|
||||||
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
|
||||||
class CreateMentionsPostsTable extends AbstractMigration
|
return [
|
||||||
{
|
'up' => function (Builder $schema) {
|
||||||
public function up()
|
$schema->create('mentions_posts', function (Blueprint $table) {
|
||||||
{
|
|
||||||
$this->schema->create('mentions_posts', 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']);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
public function down()
|
'down' => function (Builder $schema) {
|
||||||
{
|
$schema->drop('mentions_posts');
|
||||||
$this->schema->drop('mentions_posts');
|
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
|
@@ -8,24 +8,19 @@
|
|||||||
* file that was distributed with this source code.
|
* 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\Blueprint;
|
||||||
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
|
||||||
class CreateMentionsUsersTable extends AbstractMigration
|
return [
|
||||||
{
|
'up' => function (Builder $schema) {
|
||||||
public function up()
|
$schema->create('mentions_users', function (Blueprint $table) {
|
||||||
{
|
|
||||||
$this->schema->create('mentions_users', 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']);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
public function down()
|
'down' => function (Builder $schema) {
|
||||||
{
|
$schema->drop('mentions_users');
|
||||||
$this->schema->drop('mentions_users');
|
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
|
Reference in New Issue
Block a user