Skip to content

Commit

Permalink
Merge pull request #2 from gghughunishvili/fea1
Browse files Browse the repository at this point in the history
updates integer columns to bigInteger to comply with Laravel 6
  • Loading branch information
gghughunishvili authored Jan 16, 2020
2 parents 3984f3d + 85f2f1f commit 6548bc0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/views/generators/migration.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function up()

// Create table for storing roles
Schema::create('{{ $rolesTable }}', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
Expand All @@ -25,8 +25,8 @@ public function up()

// Create table for associating roles to users (Many-to-Many)
Schema::create('{{ $roleUserTable }}', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->bigInteger('user_id')->unsigned();
$table->bigInteger('role_id')->unsigned();

$table->foreign('user_id')->references('{{ $userKeyName }}')->on('{{ $usersTable }}')
->onUpdate('cascade')->onDelete('cascade');
Expand All @@ -38,7 +38,7 @@ public function up()

// Create table for storing permissions
Schema::create('{{ $permissionsTable }}', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
Expand All @@ -47,8 +47,8 @@ public function up()

// Create table for associating permissions to roles (Many-to-Many)
Schema::create('{{ $permissionRoleTable }}', function (Blueprint $table) {
$table->integer('permission_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->bigInteger('permission_id')->unsigned();
$table->bigInteger('role_id')->unsigned();

$table->foreign('permission_id')->references('id')->on('{{ $permissionsTable }}')
->onUpdate('cascade')->onDelete('cascade');
Expand Down

0 comments on commit 6548bc0

Please sign in to comment.