Skip to content

Commit

Permalink
Revert "Back in time fix FOR snipe#7145 for new installs on MySQL 8+"
Browse files Browse the repository at this point in the history
This reverts commit 2bfa05f.
  • Loading branch information
ShadowLinks committed Jun 19, 2019
1 parent d5a2afc commit aefa02b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MigrationCartalystSentryInstallGroups extends Migration {
*/
public function up()
{
Schema::create('permission_groups', function($table)
Schema::create('groups', function($table)
{
$table->increments('id');
$table->string('name');
Expand All @@ -46,7 +46,7 @@ public function up()
*/
public function down()
{
Schema::drop('permission_groups');
Schema::drop('groups');
}

}
20 changes: 2 additions & 18 deletions database/migrations/2019_06_12_184327_rename_groups_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,7 @@ class RenameGroupsTable extends Migration
*/
public function up()
{
// We check to see if this table exists before attempting the migration since
// upgraded installs would have this table, but new installs wouldn't.
// We had to change the name of the table in the older migrations
// to handle a MySQl 8+ compatibility issue related to reserved words.
// Without going back in time in migrations, this would fail since the groups table
// would never be allowed to be created in the first place on MySql 8+.
//
// So... if an upgrade, let's rename that table.
// If a new install, the migration was already changed, so the table isn't
// called that anymore and we can skip this migration.

if (Schema::hasTable('groups')) {
Schema::rename('groups', 'permission_groups');
}

Schema::rename('groups', 'permission_groups');
}

/**
Expand All @@ -37,8 +23,6 @@ public function up()
*/
public function down()
{
if (Schema::hasTable('permission_groups')) {
Schema::rename('permission_groups', 'groups');
}
Schema::rename('permission_groups', 'groups');
}
}

0 comments on commit aefa02b

Please sign in to comment.