Skip to content

A free open source IT asset/license management system

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

snipe1d0d25db378d
diff --git a/app/Models/Group.php b/app/Models/Group.php
index 1003e0d03f..48dafe1cec 100755
--- a/app/Models/Group.php
+++ b/app/Models/Group.php
@@ -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',
diff --git a/database/migrations/2019_06_12_184327_rename_groups_table.php b/database/migrations/2019_06_12_184327_rename_groups_table.php
new file mode 100644
index 0000000000..011570579f
--- /dev/null
+++ b/database/migrations/2019_06_12_184327_rename_groups_table.php
@@ -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');
+ }
+}