bluebell/database/queries/sites.sql

24 lines
400 B
MySQL
Raw Normal View History

-- name: GetSiteByDomain :one
2024-08-16 16:48:50 +01:00
SELECT *
FROM sites
WHERE domain = ?
2024-08-16 16:48:50 +01:00
LIMIT 1;
-- name: GetLastUpdatedByDomainBranch :one
SELECT last_update
FROM branches
2024-08-10 13:28:30 +01:00
WHERE domain = ?
AND branch = ?
AND enable = true
2024-08-10 13:28:30 +01:00
LIMIT 1;
2024-08-16 16:48:50 +01:00
-- name: AddSiteDomain :exec
INSERT INTO sites (domain, token)
VALUES (?, ?);
2024-08-16 16:48:50 +01:00
-- name: SetDomainBranchEnabled :exec
UPDATE branches
SET enable = ?
WHERE domain = ?
AND branch = ?;