Skip to content

Commit

Permalink
Merge pull request #1224 from djoudi/master
Browse files Browse the repository at this point in the history
Use bigIncrements/bigInteger in migration
  • Loading branch information
drbyte authored Sep 20, 2019
2 parents 2f26ff5 + d339d2f commit f3652b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions database/migrations/create_permission_tables.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ class CreatePermissionTables extends Migration
$columnNames = config('permission.column_names');

Schema::create($tableNames['permissions'], function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name');
$table->string('guard_name');
$table->timestamps();
});

Schema::create($tableNames['roles'], function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name');
$table->string('guard_name');
$table->timestamps();
});

Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
$table->unsignedInteger('permission_id');
$table->unsignedBigInteger('permission_id');

$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
Expand All @@ -47,7 +47,7 @@ class CreatePermissionTables extends Migration
});

Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
$table->unsignedInteger('role_id');
$table->unsignedBigInteger('role_id');

$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
Expand All @@ -63,8 +63,8 @@ class CreatePermissionTables extends Migration
});

Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
$table->unsignedInteger('permission_id');
$table->unsignedInteger('role_id');
$table->unsignedBigInteger('permission_id');
$table->unsignedBigInteger('role_id');

$table->foreign('permission_id')
->references('id')
Expand Down

0 comments on commit f3652b5

Please sign in to comment.