@@ -26,16 +26,17 @@ public function up()
2626 }
2727
2828 Schema::create ($ tableNames ['permissions ' ], function (Blueprint $ table ) {
29- $ table ->bigIncrements ('id ' ); // permission id
29+ $ table ->uuid ('id ' ); // permission id
3030 $ table ->string ('name ' ); // For MySQL 8.0 use string('name', 125);
3131 $ table ->string ('guard_name ' ); // For MySQL 8.0 use string('guard_name', 125);
3232 $ table ->timestamps ();
3333
3434 $ table ->unique (['name ' , 'guard_name ' ]);
35+ $ table ->primary ('id ' );
3536 });
3637
3738 Schema::create ($ tableNames ['roles ' ], function (Blueprint $ table ) use ($ teams , $ columnNames ) {
38- $ table ->bigIncrements ('id ' ); // role id
39+ $ table ->uuid ('id ' ); // role id
3940 if ($ teams || config ('permission.testing ' )) { // permission.testing is a fix for sqlite testing
4041 $ table ->unsignedBigInteger ($ columnNames ['team_foreign_key ' ])->nullable ();
4142 $ table ->index ($ columnNames ['team_foreign_key ' ], 'roles_team_foreign_key_index ' );
@@ -48,13 +49,15 @@ public function up()
4849 } else {
4950 $ table ->unique (['name ' , 'guard_name ' ]);
5051 }
52+
53+ $ table ->primary ('id ' );
5154 });
5255
5356 Schema::create ($ tableNames ['model_has_permissions ' ], function (Blueprint $ table ) use ($ tableNames , $ columnNames , $ teams ) {
54- $ table ->unsignedBigInteger (PermissionRegistrar::$ pivotPermission );
57+ $ table ->uuid (PermissionRegistrar::$ pivotPermission );
5558
5659 $ table ->string ('model_type ' );
57- $ table ->unsignedBigInteger ($ columnNames ['model_morph_key ' ]);
60+ $ table ->uuid ($ columnNames ['model_morph_key ' ]);
5861 $ table ->index ([$ columnNames ['model_morph_key ' ], 'model_type ' ], 'model_has_permissions_model_id_model_type_index ' );
5962
6063 $ table ->foreign (PermissionRegistrar::$ pivotPermission )
@@ -75,10 +78,10 @@ public function up()
7578 });
7679
7780 Schema::create ($ tableNames ['model_has_roles ' ], function (Blueprint $ table ) use ($ tableNames , $ columnNames , $ teams ) {
78- $ table ->unsignedBigInteger (PermissionRegistrar::$ pivotRole );
81+ $ table ->uuid (PermissionRegistrar::$ pivotRole );
7982
8083 $ table ->string ('model_type ' );
81- $ table ->unsignedBigInteger ($ columnNames ['model_morph_key ' ]);
84+ $ table ->uuid ($ columnNames ['model_morph_key ' ]);
8285 $ table ->index ([$ columnNames ['model_morph_key ' ], 'model_type ' ], 'model_has_roles_model_id_model_type_index ' );
8386
8487 $ table ->foreign (PermissionRegistrar::$ pivotRole )
@@ -98,8 +101,8 @@ public function up()
98101 });
99102
100103 Schema::create ($ tableNames ['role_has_permissions ' ], function (Blueprint $ table ) use ($ tableNames ) {
101- $ table ->unsignedBigInteger (PermissionRegistrar::$ pivotPermission );
102- $ table ->unsignedBigInteger (PermissionRegistrar::$ pivotRole );
104+ $ table ->uuid (PermissionRegistrar::$ pivotPermission );
105+ $ table ->uuid (PermissionRegistrar::$ pivotRole );
103106
104107 $ table ->foreign (PermissionRegistrar::$ pivotPermission )
105108 ->references ('id ' ) // permission id
0 commit comments