Skip to content

Commit

Permalink
fixes in database migration Fixes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
stojankukrika committed Feb 14, 2015
1 parent a590849 commit 06de83e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 42 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function up()
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name');
$table -> boolean('is_admin')->nullable()->default(0);
$table -> boolean('is_admin')->default(0);
$table->timestamps();
});

Expand All @@ -26,11 +26,11 @@ public function up()
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('user_id')->unsigned()->index();
$table->integer('role_id')->unsigned()->index();
$table->timestamps();
$table->unsignedInteger('user_id');
$table->unsignedInteger('role_id');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->timestamps();
});
}

Expand Down
8 changes: 4 additions & 4 deletions database/migrations/2014_10_16_115550_entrust_permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function up()
$table->engine = 'InnoDB';
$table->increments('id');
$table->string('name')->unique();
$table->string('display_name')->unique();
$table->string('display_name');
$table->boolean('is_admin');
$table->timestamps();
});
Expand All @@ -28,11 +28,11 @@ public function up()
{
$table->engine = 'InnoDB';
$table->increments('id');
$table->integer('permission_id')->unsigned()->index();
$table->integer('role_id')->unsigned()->index();
$table->timestamps();
$table->unsignedInteger('permission_id');
$table->unsignedInteger('role_id');
$table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->timestamps();
});
}

Expand Down

0 comments on commit 06de83e

Please sign in to comment.