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-05 18:41:38 +00:00
|
|
|
-- name: AddSiteDomain :exec
|
|
|
|
INSERT INTO sites (domain, token)
|
|
|
|
VALUES (?, ?);
|
2024-08-16 16:48:50 +01:00
|
|
|
|
2025-01-05 18:41:38 +00:00
|
|
|
-- name: SetDomainBranchEnabled :exec
|
|
|
|
UPDATE branches
|
|
|
|
SET enable = ?
|
|
|
|
WHERE domain = ?
|
|
|
|
AND branch = ?;
|