2025-01-05 18:41:38 +00:00
|
|
|
-- name: GetSiteByDomain :one
|
2024-08-16 16:48:50 +01:00
|
|
|
SELECT *
|
|
|
|
FROM sites
|
2025-01-05 18:41:38 +00:00
|
|
|
WHERE domain = ?
|
2024-08-16 16:48:50 +01:00
|
|
|
LIMIT 1;
|
|
|
|
|
2025-01-05 18:41:38 +00:00
|
|
|
-- name: GetLastUpdatedByDomainBranch :one
|
|
|
|
SELECT last_update
|
|
|
|
FROM branches
|
2024-08-10 13:28:30 +01:00
|
|
|
WHERE domain = ?
|
2025-01-05 18:41:38 +00:00
|
|
|
AND branch = ?
|
|
|
|
AND enable = true
|
2024-08-10 13:28:30 +01:00
|
|
|
LIMIT 1;
|
2024-08-16 16:48:50 +01:00
|
|
|
|
2025-01-08 01:03:05 +00:00
|
|
|
-- name: AddSite :exec
|
2025-01-05 18:41:38 +00:00
|
|
|
INSERT INTO sites (domain, token)
|
|
|
|
VALUES (?, ?);
|
2024-08-16 16:48:50 +01:00
|
|
|
|
2025-01-08 01:03:05 +00:00
|
|
|
-- name: UpdateSiteToken :exec
|
|
|
|
UPDATE sites
|
|
|
|
SET token = ?
|
|
|
|
WHERE domain = ?;
|
|
|
|
|
|
|
|
-- name: AddBranch :exec
|
|
|
|
INSERT INTO branches (domain, branch, last_update, enable)
|
|
|
|
VALUES (?, ?, ?, ?);
|
|
|
|
|
|
|
|
-- name: UpdateBranch :exec
|
|
|
|
UPDATE branches
|
|
|
|
SET last_update = ?
|
|
|
|
WHERE domain = ?
|
|
|
|
AND branch = ?;
|
|
|
|
|
|
|
|
-- name: SetBranchEnabled :exec
|
2025-01-05 18:41:38 +00:00
|
|
|
UPDATE branches
|
|
|
|
SET enable = ?
|
|
|
|
WHERE domain = ?
|
|
|
|
AND branch = ?;
|