From 4dac3712a66c074e5463f2bbe28d708f81a37987 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 14 Dec 2023 14:32:26 +0000 Subject: [PATCH] Added DB migration for remote_ip, action_source, user_agent in logs Signed-off-by: snipe --- ...te_ip_and_action_source_to_action_logs.php | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 database/migrations/2023_12_14_032522_add_remote_ip_and_action_source_to_action_logs.php diff --git a/database/migrations/2023_12_14_032522_add_remote_ip_and_action_source_to_action_logs.php b/database/migrations/2023_12_14_032522_add_remote_ip_and_action_source_to_action_logs.php new file mode 100644 index 000000000..70616b9f7 --- /dev/null +++ b/database/migrations/2023_12_14_032522_add_remote_ip_and_action_source_to_action_logs.php @@ -0,0 +1,42 @@ +string('action_source')->nullable()->default(null); + $table->ipAddress('remote_ip')->nullable()->default(null); + $table->string('user_agent')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('action_logs', function (Blueprint $table) { + if (Schema::hasColumn('action_logs', 'action_source')) { + $table->dropColumn('action_source'); + } + if (Schema::hasColumn('action_logs', 'remote_ip')) { + $table->dropColumn('remote_ip'); + } + if (Schema::hasColumn('action_logs', 'user_agent')) { + $table->dropColumn('user_agent'); + } + }); + } +}