From 9496078644c58cb112a11a897f8ccb917c1c1102 Mon Sep 17 00:00:00 2001 From: tracer Date: Sun, 15 Feb 2026 23:27:49 +0100 Subject: [PATCH] make the update more verbose for testing --- git_update.sh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/git_update.sh b/git_update.sh index f7a7896..0357f64 100755 --- a/git_update.sh +++ b/git_update.sh @@ -151,24 +151,30 @@ if [[ -n "$VERSION" || -n "$BUILD" ]]; then $version = getenv("SPEEDBB_VERSION"); $build = getenv("SPEEDBB_BUILD"); if ($version !== false && $version !== "") { - $updated = \Illuminate\Support\Facades\DB::table("settings") - ->where("key", "version") - ->update(["value" => $version]); - if ($updated === 0) { - \Illuminate\Support\Facades\DB::table("settings") - ->insert(["key" => "version", "value" => $version, "created_at" => now(), "updated_at" => now()]); - } - echo "Updated version rows: {$updated}\n"; + \Illuminate\Support\Facades\DB::table("settings")->upsert( + [[ + "key" => "version", + "value" => $version, + "created_at" => now(), + "updated_at" => now(), + ]], + ["key"], + ["value", "updated_at"] + ); + echo "Upserted version setting.\n"; } if ($build !== false && $build !== "") { - $updated = \Illuminate\Support\Facades\DB::table("settings") - ->where("key", "build") - ->update(["value" => $build]); - if ($updated === 0) { - \Illuminate\Support\Facades\DB::table("settings") - ->insert(["key" => "build", "value" => $build, "created_at" => now(), "updated_at" => now()]); - } - echo "Updated build rows: {$updated}\n"; + \Illuminate\Support\Facades\DB::table("settings")->upsert( + [[ + "key" => "build", + "value" => $build, + "created_at" => now(), + "updated_at" => now(), + ]], + ["key"], + ["value", "updated_at"] + ); + echo "Upserted build setting.\n"; } ' \ && echo "Running with PHP binary: $PHP_BIN -r " \