fixed some migration names and used helper where appropriate

This commit is contained in:
Daniël Klabbers 2018-06-27 21:33:53 +02:00
parent db6f4f2c77
commit 993513b9c4
6 changed files with 17 additions and 38 deletions

View File

@ -9,14 +9,6 @@
* file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Builder;
use Flarum\Database\Migration;
return [
'up' => function (Builder $schema) {
$schema->rename('users_discussions', 'discussions_users');
},
'down' => function (Builder $schema) {
$schema->rename('discussions_users', 'users_discussions');
}
];
return Migration::renameTable('users_discussions', 'discussions_users');

View File

@ -1,27 +0,0 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->table('email_tokens', function (Blueprint $table) {
$table->renameColumn('id', 'token');
});
},
'down' => function (Builder $schema) {
$schema->table('email_tokens', function (Blueprint $table) {
$table->renameColumn('token', 'id');
});
}
];

View File

@ -0,0 +1,14 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Flarum\Database\Migration;
return Migration::renameColumn('email_tokens', 'id','token');

View File

@ -11,4 +11,4 @@
use Flarum\Database\Migration;
return Migration::renameTable('users_groups', 'group_user');
return Migration::renameTable('users_groups', 'group_users');