diff --git a/database/migrations/2022_05_16_235350_remove_stored_eula_field.php b/database/migrations/2022_05_16_235350_remove_stored_eula_field.php new file mode 100644 index 000000000..48c8a1882 --- /dev/null +++ b/database/migrations/2022_05_16_235350_remove_stored_eula_field.php @@ -0,0 +1,48 @@ +get(); + + foreach ($actionlog_eulas as $eula_file) { + $eula_file->filename = $eula_file->stored_eula_file; + $eula_file->save(); + } + + $actionlog_bad_action_type = Actionlog::where('item_id', '=', 0)->whereNull('target_type')->whereNull('action_type')->whereNull('target_type')->get(); + + foreach ($actionlog_bad_action_type as $bad_action_type) { + $bad_action_type->delete(); + } + + Schema::table('action_logs', function (Blueprint $table) { + $table->dropColumn('stored_eula_file'); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('action_logs', function (Blueprint $table) { + $table->string('stored_eula_file')->nullable()->default(null); + }); + } +}