diff --git a/database/migrations/2016_05_20_024859_remove_option_keys_from_settings_table.php b/database/migrations/2016_05_20_024859_remove_option_keys_from_settings_table.php index 0ac3ddd58..d89677f34 100644 --- a/database/migrations/2016_05_20_024859_remove_option_keys_from_settings_table.php +++ b/database/migrations/2016_05_20_024859_remove_option_keys_from_settings_table.php @@ -14,8 +14,8 @@ class RemoveOptionKeysFromSettingsTable extends Migration { Schema::table('settings', function (Blueprint $table) { // - $table->dropColumn('option_name'); - $table->dropColumn('option_value'); + if(Schema::hasColumn('option_name', 'settings')) + $table->dropColumn('option_name'); }); } @@ -28,6 +28,7 @@ class RemoveOptionKeysFromSettingsTable extends Migration { Schema::table('Settings', function (Blueprint $table) { // + $table->string('option_name')->nullable(); }); } } diff --git a/database/migrations/2016_05_20_143758_remove_option_value_from_settings_table.php b/database/migrations/2016_05_20_143758_remove_option_value_from_settings_table.php new file mode 100644 index 000000000..302baaa8c --- /dev/null +++ b/database/migrations/2016_05_20_143758_remove_option_value_from_settings_table.php @@ -0,0 +1,34 @@ +dropColumn('option_value'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + Schema::table('settings', function (Blueprint $table) { + $table->string('option_value')->nullable(); + }); + } +}