From 06de83e61da1b1579576424c357b706ef08b335f Mon Sep 17 00:00:00 2001 From: Stojan Kukrika Date: Sat, 14 Feb 2015 07:34:24 +0100 Subject: [PATCH] fixes in database migration Fixes #42 --- ...100000_create_password_reminders_table.php | 34 ------------------- ...2014_10_16_115128_entrust_setup_tables.php | 8 ++--- .../2014_10_16_115550_entrust_permissions.php | 8 ++--- 3 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 database/migrations/2014_10_12_100000_create_password_reminders_table.php diff --git a/database/migrations/2014_10_12_100000_create_password_reminders_table.php b/database/migrations/2014_10_12_100000_create_password_reminders_table.php deleted file mode 100644 index 975ef3de..00000000 --- a/database/migrations/2014_10_12_100000_create_password_reminders_table.php +++ /dev/null @@ -1,34 +0,0 @@ -engine = 'InnoDB'; - $table->string('email')->index(); - $table->string('token')->index(); - $table->timestamp('created_at'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('password_reminders'); - } - -} diff --git a/database/migrations/2014_10_16_115128_entrust_setup_tables.php b/database/migrations/2014_10_16_115128_entrust_setup_tables.php index 8d3e264d..7e42c24b 100644 --- a/database/migrations/2014_10_16_115128_entrust_setup_tables.php +++ b/database/migrations/2014_10_16_115128_entrust_setup_tables.php @@ -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(); }); @@ -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(); }); } diff --git a/database/migrations/2014_10_16_115550_entrust_permissions.php b/database/migrations/2014_10_16_115550_entrust_permissions.php index 92fb99d8..740712ae 100644 --- a/database/migrations/2014_10_16_115550_entrust_permissions.php +++ b/database/migrations/2014_10_16_115550_entrust_permissions.php @@ -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(); }); @@ -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(); }); }