diff options
Diffstat (limited to 'migrations/2018_02_01_000000_items_modify_selective_show.php')
| -rw-r--r-- | migrations/2018_02_01_000000_items_modify_selective_show.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/migrations/2018_02_01_000000_items_modify_selective_show.php b/migrations/2018_02_01_000000_items_modify_selective_show.php new file mode 100644 index 0000000..2c63217 --- /dev/null +++ b/migrations/2018_02_01_000000_items_modify_selective_show.php @@ -0,0 +1,51 @@ +<?php + +use Carbon\Carbon; + +use Illuminate\Support\Facades\Schema; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class ItemsModifySelectiveShow extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('item', function (Blueprint $table) { + $table->boolean("show_in_build")->nullable(); + }); + + DB::table('item') + ->update([ + 'show_in_build' => true + ]); + + DB::table('item') + ->where('name', 'Healing Flask') + ->update([ + 'show_in_build' => false + ]); + + DB::table('item') + ->where('name', 'Scout Cam') + ->update([ + 'show_in_build' => false + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('item', function (Blueprint $table) { + $table->dropColumn("show_in_build"); + }); + } +} |
