Skip to content

Commit 9b012b7

Browse files
committed
drop claimed_at from nodes
1 parent 754964c commit 9b012b7

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE nodes ADD COLUMN claimed_at INTEGER;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE nodes DROP COLUMN claimed_at;

db/queries/nodes.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
-- name: InsertNode :one
2-
INSERT INTO nodes (fingerprint, claimed_at, last_heartbeat_at, created_at)
3-
VALUES (?, NULL, NULL, unixepoch())
4-
RETURNING id, fingerprint, claimed_at, last_heartbeat_at, created_at;
2+
INSERT INTO nodes (fingerprint, last_heartbeat_at, created_at)
3+
VALUES (?, NULL, unixepoch())
4+
RETURNING id, fingerprint, last_heartbeat_at, created_at;
55

66
-- name: GetNodeByFingerprint :one
7-
SELECT id, fingerprint, claimed_at, last_heartbeat_at, created_at
7+
SELECT id, fingerprint, last_heartbeat_at, created_at
88
FROM nodes
99
WHERE fingerprint = ?;
1010

@@ -15,7 +15,7 @@ WHERE fingerprint = ?;
1515

1616
-- name: UpdateNodeHeartbeatAndClaimedAtByFingerprint :exec
1717
UPDATE nodes
18-
SET last_heartbeat_at = unixepoch(), claimed_at = unixepoch()
18+
SET last_heartbeat_at = unixepoch()
1919
WHERE fingerprint = ?;
2020

2121
-- name: DeleteNodeByFingerprint :exec

internal/db/models.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/db/nodes.sql.go

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

0 commit comments

Comments
 (0)