From 9eb94bc9bb96e07b08c7804f7de0b4e88ea02e0d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 23 Dec 2018 19:09:15 -0700 Subject: [PATCH] Add new migration --- ...0_add_account_status_to_profiles_table.php | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 database/migrations/2018_12_22_055940_add_account_status_to_profiles_table.php diff --git a/database/migrations/2018_12_22_055940_add_account_status_to_profiles_table.php b/database/migrations/2018_12_22_055940_add_account_status_to_profiles_table.php new file mode 100644 index 000000000..3d503c19d --- /dev/null +++ b/database/migrations/2018_12_22_055940_add_account_status_to_profiles_table.php @@ -0,0 +1,75 @@ +dropColumn('verify_token'); + $table->dropColumn('secret'); + $table->dropColumn('salmon_url'); + $table->dropColumn('hub_url'); + }); + } + + if(Schema::hasColumn('stories', 'bigIncrements')) { + Schema::table('stories', function (Blueprint $table) { + $table->dropColumn('bigIncrements'); + }); + Schema::table('stories', function (Blueprint $table) { + $table->bigIncrements('id')->first(); + }); + } + + // Add account status to profile and user tables + + Schema::table('profiles', function (Blueprint $table) { + $table->string('status')->nullable()->index()->after('username'); + }); + + Schema::table('users', function (Blueprint $table) { + $table->string('status')->nullable()->index()->after('email'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('profiles', function (Blueprint $table) { + $table->string('verify_token')->nullable(); + $table->string('secret')->nullable(); + $table->string('salmon_url')->nullable(); + $table->string('hub_url')->nullable(); + }); + + Schema::table('stories', function (Blueprint $table) { + $table->dropColumn('id'); + }); + Schema::table('stories', function (Blueprint $table) { + $table->bigIncrements('bigIncrements')->first(); + }); + + Schema::table('profiles', function (Blueprint $table) { + $table->dropColumn('status'); + }); + + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('status'); + }); + } +}