Skip to content

Commit b147684

Browse files
committed
Set updated at
1 parent 28f3d65 commit b147684

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/db/queries/create_new_snapshot.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ WITH upd AS (
55
SET metadata = @metadata,
66
sandbox_started_at = @started_at,
77
origin_node_id = @origin_node_id,
8-
auto_pause = @auto_pause
8+
auto_pause = @auto_pause,
9+
updated_at = now()
910
FROM "public"."envs" e
1011
WHERE s.sandbox_id = @sandbox_id
1112
AND e.id = s.env_id
@@ -22,12 +23,12 @@ WITH upd AS (
2223
INSERT INTO "public"."snapshots" (
2324
sandbox_id, base_env_id, env_id, metadata,
2425
sandbox_started_at, env_secure, allow_internet_access,
25-
origin_node_id, auto_pause
26+
origin_node_id, auto_pause, updated_at
2627
)
2728
SELECT
2829
@sandbox_id, @base_template_id, id, @metadata,
2930
@started_at, @secure, @allow_internet_access,
30-
@origin_node_id, @auto_pause
31+
@origin_node_id, @auto_pause, now()
3132
FROM ins_env
3233
WHERE NOT EXISTS (SELECT 1 FROM upd)
3334
RETURNING env_id

packages/db/queries/create_new_snapshot.sql.go

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)