Fixed #7145 - rename groups table to permissions_group for mysql 8 reserved word compatibility

This commit is contained in:
snipe 2019-06-12 15:51:47 -07:00
parent cbff66c9db
commit 1d0d25db37
2 changed files with 29 additions and 1 deletions

View file

@ -7,7 +7,7 @@ use Watson\Validating\ValidatingTrait;
class Group extends SnipeModel
{
protected $table = 'groups';
protected $table = 'permission_groups';
public $rules = array(
'name' => 'required|min:3|max:255',

View file

@ -0,0 +1,28 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameGroupsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::rename('groups', 'permission_groups');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::rename('permission_groups', 'groups');
}
}