From 993513b9c403908a33d71068ab4f709a229f7c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Wed, 27 Jun 2018 21:33:53 +0200 Subject: [PATCH] fixed some migration names and used helper where appropriate --- ...nge_user_discussions_discussions_users.php | 12 ++------- ..._072600_change_email_tokens_b8_columns.php | 27 ------------------- ...change_email_tokens_rename_id_to_token.php | 14 ++++++++++ ...ame_permissions_to_groups_permissions.php} | 0 ...00_rename_users_groups_to_groups_users.php | 2 +- ...ge_password_tokens_rename_id_to_token.php} | 0 6 files changed, 17 insertions(+), 38 deletions(-) delete mode 100644 framework/core/migrations/2018_01_15_072600_change_email_tokens_b8_columns.php create mode 100644 framework/core/migrations/2018_01_15_072600_change_email_tokens_rename_id_to_token.php rename framework/core/migrations/{2018_01_18_130400_rename_permissions_to_group_permissions.php => 2018_01_18_130400_rename_permissions_to_groups_permissions.php} (100%) rename framework/core/migrations/{2018_01_18_134400_change_password_tokens_id_to_token.php => 2018_01_18_134400_change_password_tokens_rename_id_to_token.php} (100%) diff --git a/framework/core/migrations/2018_01_15_071700_change_user_discussions_discussions_users.php b/framework/core/migrations/2018_01_15_071700_change_user_discussions_discussions_users.php index c0e48bb91..e1ac5e026 100644 --- a/framework/core/migrations/2018_01_15_071700_change_user_discussions_discussions_users.php +++ b/framework/core/migrations/2018_01_15_071700_change_user_discussions_discussions_users.php @@ -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'); diff --git a/framework/core/migrations/2018_01_15_072600_change_email_tokens_b8_columns.php b/framework/core/migrations/2018_01_15_072600_change_email_tokens_b8_columns.php deleted file mode 100644 index 4bb891a1f..000000000 --- a/framework/core/migrations/2018_01_15_072600_change_email_tokens_b8_columns.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * 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'); - }); - } -]; diff --git a/framework/core/migrations/2018_01_15_072600_change_email_tokens_rename_id_to_token.php b/framework/core/migrations/2018_01_15_072600_change_email_tokens_rename_id_to_token.php new file mode 100644 index 000000000..e62a842c6 --- /dev/null +++ b/framework/core/migrations/2018_01_15_072600_change_email_tokens_rename_id_to_token.php @@ -0,0 +1,14 @@ + + * + * 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'); diff --git a/framework/core/migrations/2018_01_18_130400_rename_permissions_to_group_permissions.php b/framework/core/migrations/2018_01_18_130400_rename_permissions_to_groups_permissions.php similarity index 100% rename from framework/core/migrations/2018_01_18_130400_rename_permissions_to_group_permissions.php rename to framework/core/migrations/2018_01_18_130400_rename_permissions_to_groups_permissions.php diff --git a/framework/core/migrations/2018_01_18_130400_rename_users_groups_to_groups_users.php b/framework/core/migrations/2018_01_18_130400_rename_users_groups_to_groups_users.php index 40f4178f9..32b110e19 100644 --- a/framework/core/migrations/2018_01_18_130400_rename_users_groups_to_groups_users.php +++ b/framework/core/migrations/2018_01_18_130400_rename_users_groups_to_groups_users.php @@ -11,4 +11,4 @@ use Flarum\Database\Migration; -return Migration::renameTable('users_groups', 'group_user'); +return Migration::renameTable('users_groups', 'group_users'); diff --git a/framework/core/migrations/2018_01_18_134400_change_password_tokens_id_to_token.php b/framework/core/migrations/2018_01_18_134400_change_password_tokens_rename_id_to_token.php similarity index 100% rename from framework/core/migrations/2018_01_18_134400_change_password_tokens_id_to_token.php rename to framework/core/migrations/2018_01_18_134400_change_password_tokens_rename_id_to_token.php