diff options
Diffstat (limited to 'src/migrations')
4 files changed, 29 insertions, 30 deletions
diff --git a/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php b/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php index b054a43..f04f3f0 100644 --- a/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php +++ b/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php @@ -14,8 +14,7 @@ class BotleaguesapiCreateUsers extends Migration { { Schema::create('users', function(Blueprint $table) { - $table->increments('id')->unsigned(); - $table->string('email', 127)->unique(); + $table->string('email', 127)->primary(); $table->string('password', 60); $table->rememberToken(); $table->boolean('isAdministrator')->default(false); diff --git a/src/migrations/2015_02_23_184413_botleaguesapi-create_bots.php b/src/migrations/2015_02_23_184413_botleaguesapi-create_bots.php index 11ab786..268039b 100644 --- a/src/migrations/2015_02_23_184413_botleaguesapi-create_bots.php +++ b/src/migrations/2015_02_23_184413_botleaguesapi-create_bots.php @@ -15,8 +15,8 @@ class BotleaguesapiCreateBots extends Migration { Schema::create('bots', function(Blueprint $table) { $table->increments('id')->unsigned(); - $table->integer('userId')->unsigned(); - $table->foreign('userId')->references('id')->on('users'); + $table->string('userEmail', 127)->index(); + $table->foreign('userEmail')->references('email')->on('users'); $table->integer('gameId')->unsigned(); $table->foreign('gameId')->references('id')->on('games'); $table->string('title', 45); diff --git a/src/migrations/2015_05_10_134654_botleaguesapi-create_user_tokens.php b/src/migrations/2015_05_10_134654_botleaguesapi-create_user_tokens.php index 3d8c82e..f4ce31a 100644 --- a/src/migrations/2015_05_10_134654_botleaguesapi-create_user_tokens.php +++ b/src/migrations/2015_05_10_134654_botleaguesapi-create_user_tokens.php @@ -15,8 +15,8 @@ class BotleaguesapiCreateUserTokens extends Migration { Schema::create('user_tokens', function(Blueprint $table) { $table->increments('id'); - $table->integer('userId')->unsigned(); - $table->foreign('userId')->references('id')->on('users'); + $table->string('userEmail', 127)->index(); + $table->foreign('userEmail')->references('email')->on('users'); $table->string('token'); $table->timestamp('valid_till'); $table->timestamps(); diff --git a/src/migrations/2015_05_13_105945_botleaguesapi-create_password_reminders.php b/src/migrations/2015_05_13_105945_botleaguesapi-create_password_reminders.php index a2473fb..2ef93f4 100644 --- a/src/migrations/2015_05_13_105945_botleaguesapi-create_password_reminders.php +++ b/src/migrations/2015_05_13_105945_botleaguesapi-create_password_reminders.php @@ -5,32 +5,32 @@ use Illuminate\Database\Migrations\Migration; class BotleaguesApiCreatePasswordReminders extends Migration { - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('password_reminders', function(Blueprint $table) - { - $table->integer('userId')->unsigned(); - $table->foreign('userId')->references('id')->on('users'); - $table->string('token')->index(); - $table->timestamp('created_at'); + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('password_reminders', function(Blueprint $table) + { + $table->string('userEmail', 127)->index(); + $table->foreign('userEmail')->references('email')->on('users'); + $table->string('token')->primary(); + $table->timestamp('created_at'); $table->timestamp('valid_till'); $table->timestamp('used_at')->nullable(); - }); - } + }); + } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('password_reminders'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('password_reminders'); + } } |