mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 23:18:56 +08:00
fixed some migration names and used helper where appropriate
This commit is contained in:
parent
db6f4f2c77
commit
993513b9c4
@ -9,14 +9,6 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Builder;
|
use Flarum\Database\Migration;
|
||||||
|
|
||||||
return [
|
return Migration::renameTable('users_discussions', 'discussions_users');
|
||||||
'up' => function (Builder $schema) {
|
|
||||||
$schema->rename('users_discussions', 'discussions_users');
|
|
||||||
},
|
|
||||||
|
|
||||||
'down' => function (Builder $schema) {
|
|
||||||
$schema->rename('discussions_users', 'users_discussions');
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
@ -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');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
];
|
|
@ -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');
|
@ -11,4 +11,4 @@
|
|||||||
|
|
||||||
use Flarum\Database\Migration;
|
use Flarum\Database\Migration;
|
||||||
|
|
||||||
return Migration::renameTable('users_groups', 'group_user');
|
return Migration::renameTable('users_groups', 'group_users');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user