mirror of
https://github.com/1f349/site-hosting.git
synced 2025-01-21 06:36:33 +00:00
24 lines
400 B
SQL
24 lines
400 B
SQL
-- name: GetSiteByDomain :one
|
|
SELECT *
|
|
FROM sites
|
|
WHERE domain = ?
|
|
LIMIT 1;
|
|
|
|
-- name: GetLastUpdatedByDomainBranch :one
|
|
SELECT last_update
|
|
FROM branches
|
|
WHERE domain = ?
|
|
AND branch = ?
|
|
AND enable = true
|
|
LIMIT 1;
|
|
|
|
-- name: AddSiteDomain :exec
|
|
INSERT INTO sites (domain, token)
|
|
VALUES (?, ?);
|
|
|
|
-- name: SetDomainBranchEnabled :exec
|
|
UPDATE branches
|
|
SET enable = ?
|
|
WHERE domain = ?
|
|
AND branch = ?;
|