@@ -24,6 +24,7 @@ return new class extends Migration
2424 throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
2525 }
2626
27+ Schema::dropIfExists($tableNames['permissions']);
2728 Schema::create($tableNames['permissions'], function (Blueprint $table) {
2829 //$table->engine('InnoDB');
2930 $table->bigIncrements('id'); // permission id
@@ -34,6 +35,7 @@ return new class extends Migration
3435 $table->unique(['name', 'guard_name']);
3536 });
3637
38+ Schema::dropIfExists($tableNames['roles']);
3739 Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
3840 //$table->engine('InnoDB');
3941 $table->bigIncrements('id'); // role id
@@ -51,6 +53,7 @@ return new class extends Migration
5153 }
5254 });
5355
56+ Schema::dropIfExists($tableNames['model_has_permissions']);
5457 Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
5558 $table->unsignedBigInteger($pivotPermission);
5659
@@ -75,6 +78,7 @@ return new class extends Migration
7578
7679 });
7780
81+ Schema::dropIfExists($tableNames['model_has_roles']);
7882 Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
7983 $table->unsignedBigInteger($pivotRole);
8084
@@ -98,6 +102,7 @@ return new class extends Migration
98102 }
99103 });
100104
105+ Schema::dropIfExists($tableNames['role_has_permissions']);
101106 Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
102107 $table->unsignedBigInteger($pivotPermission);
103108 $table->unsignedBigInteger($pivotRole);
0 commit comments