Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
[5.8] Update migrations to use bigIncrements on primaries and foreign…
Browse files Browse the repository at this point in the history
… keys (#96)

This PR closes: #93 and #94
  • Loading branch information
chuckrincon authored and kaidesu committed Apr 22, 2019
1 parent 9a01263 commit 68039b1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion migrations/2015_01_20_084450_create_roles_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CreateRolesTable extends Migration
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name')->unique();
$table->string('slug')->unique();
$table->text('description')->nullable();
Expand Down
6 changes: 3 additions & 3 deletions migrations/2015_01_20_084525_create_role_user_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class CreateRoleUserTable extends Migration
public function up()
{
Schema::create('role_user', function (Blueprint $table) {
$table->increments('id');
$table->integer('role_id')->unsigned()->index();
$table->bigIncrements('id');
$table->unsignedBigInteger('role_id')->index();
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->integer('user_id')->unsigned()->index();
$table->unsignedBigInteger('user_id')->index();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
Expand Down
2 changes: 1 addition & 1 deletion migrations/2015_01_24_080208_create_permissions_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CreatePermissionsTable extends Migration
public function up()
{
Schema::create('permissions', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name');
$table->string('slug')->unique();
$table->text('description')->nullable();
Expand Down
6 changes: 3 additions & 3 deletions migrations/2015_01_24_080433_create_permission_role_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class CreatePermissionRoleTable extends Migration
public function up()
{
Schema::create('permission_role', function (Blueprint $table) {
$table->increments('id');
$table->integer('permission_id')->unsigned()->index();
$table->bigIncrements('id');
$table->unsignedBigInteger('permission_id')->index();
$table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
$table->integer('role_id')->unsigned()->index();
$table->unsignedBigInteger('role_id')->index();
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->timestamps();
});
Expand Down
6 changes: 3 additions & 3 deletions migrations/2017_10_17_170735_create_permission_user_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class CreatePermissionUserTable extends Migration
public function up()
{
Schema::create('permission_user', function (Blueprint $table) {
$table->increments('id');
$table->integer('permission_id')->unsigned()->index();
$table->bigIncrements('id');
$table->unsignedBigInteger('permission_id')->index();
$table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
$table->integer('user_id')->unsigned()->index();
$table->unsignedBigInteger('user_id')->index();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
Expand Down

0 comments on commit 68039b1

Please sign in to comment.