diff --git a/database/migrations/2017_09_20_225456_AddForeignKeyToRedirect.php b/database/migrations/2017_09_20_225456_AddForeignKeyToRedirect.php new file mode 100644 index 00000000..0c0e9a17 --- /dev/null +++ b/database/migrations/2017_09_20_225456_AddForeignKeyToRedirect.php @@ -0,0 +1,32 @@ +foreign('redirect_to')->references('id')->on('users')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropForeign('users_redirect_to_foreign'); + }); + } +}