unsignedInteger('parent_album_id')->nullable(); $table->string('url_path')->nullable(); $table->foreign('parent_album_id') ->references('id')->on('albums') ->onDelete('set null'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('albums', function (Blueprint $table) { $table->dropForeign('albums_parent_album_id_foreign'); $table->dropColumn('parent_album_id'); $table->dropColumn('url_path'); }); } }