From f682741758b7b9c75e7a42b673f402ec56a97efb Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Wed, 15 Aug 2018 04:51:56 +0800 Subject: [PATCH] edit password_resets tables --- config/auth.php | 7 +--- ...iy_password_resets_for_receiver_column.php | 38 +++++++++++++++++++ ...password_resets_for_casebuilder_column.php | 38 +++++++++++++++++++ ...6_drop_password_resets_for_admin_table.php | 32 ++++++++++++++++ 4 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 database/migrations/2018_08_14_201742_modifiy_password_resets_for_receiver_column.php create mode 100644 database/migrations/2018_08_14_201920_modifiy_password_resets_for_casebuilder_column.php create mode 100644 database/migrations/2018_08_14_205016_drop_password_resets_for_admin_table.php diff --git a/config/auth.php b/config/auth.php index a276272..1e1c38c 100644 --- a/config/auth.php +++ b/config/auth.php @@ -145,12 +145,7 @@ return [ 'provider' => 'caseBuilders', 'table' => 'password_resets_for_casebuilder', 'expire' => 60, - ], - 'admins' => [ - 'provider' => 'admins', - 'table' => 'password_resets_for_admin', - 'expire' => 60, - ], + ] ], ]; diff --git a/database/migrations/2018_08_14_201742_modifiy_password_resets_for_receiver_column.php b/database/migrations/2018_08_14_201742_modifiy_password_resets_for_receiver_column.php new file mode 100644 index 0000000..4c8fc8e --- /dev/null +++ b/database/migrations/2018_08_14_201742_modifiy_password_resets_for_receiver_column.php @@ -0,0 +1,38 @@ +unique('email'); + }); + Schema::table('password_resets_for_receiver', function (Blueprint $table) { + $table->foreign('email', 'fk_password_resets_for_receiver_1')->references('email')->on('Receiver')->onUpdate('NO ACTION')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('password_resets_for_receiver', function (Blueprint $table) { + $table->dropForeign('fk_password_resets_for_receiver_1'); + }); + Schema::table('Receiver', function (Blueprint $table) { + $table->dropUnique('email'); + }); + } +} diff --git a/database/migrations/2018_08_14_201920_modifiy_password_resets_for_casebuilder_column.php b/database/migrations/2018_08_14_201920_modifiy_password_resets_for_casebuilder_column.php new file mode 100644 index 0000000..f5f6f68 --- /dev/null +++ b/database/migrations/2018_08_14_201920_modifiy_password_resets_for_casebuilder_column.php @@ -0,0 +1,38 @@ +unique('contactEmail'); + }); + Schema::table('password_resets_for_casebuilder', function (Blueprint $table) { + $table->foreign('email', 'fk_password_resets_for_casebuilder_1')->references('contactEmail')->on('CaseBuilder')->onUpdate('NO ACTION')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('password_resets_for_casebuilder', function (Blueprint $table) { + $table->dropForeign('fk_password_resets_for_casebuilder_1'); + }); + Schema::table('CaseBuilder', function (Blueprint $table) { + $table->dropUnique('contactEmail'); + }); + } +} diff --git a/database/migrations/2018_08_14_205016_drop_password_resets_for_admin_table.php b/database/migrations/2018_08_14_205016_drop_password_resets_for_admin_table.php new file mode 100644 index 0000000..04a96fa --- /dev/null +++ b/database/migrations/2018_08_14_205016_drop_password_resets_for_admin_table.php @@ -0,0 +1,32 @@ +string('email')->index(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } +}