mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
6a9391d02e
commit
ec3db146fc
|
@ -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('mentions_posts', function (Blueprint $table) {
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->integer('mentions_id')->unsigned();
|
||||
$table->primary(['post_id', 'mentions_id']);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('mentions_posts');
|
||||
return Migration::createTable(
|
||||
'mentions_posts',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->integer('mentions_id')->unsigned();
|
||||
$table->primary(['post_id', 'mentions_id']);
|
||||
}
|
||||
];
|
||||
);
|
||||
|
|
|
@ -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('mentions_users', function (Blueprint $table) {
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->integer('mentions_id')->unsigned();
|
||||
$table->primary(['post_id', 'mentions_id']);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->drop('mentions_users');
|
||||
return Migration::createTable(
|
||||
'mentions_users',
|
||||
function (Blueprint $table) {
|
||||
$table->integer('post_id')->unsigned();
|
||||
$table->integer('mentions_id')->unsigned();
|
||||
$table->primary(['post_id', 'mentions_id']);
|
||||
}
|
||||
];
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user