Files
coder/coderd/database/queries/licenses.sql
Kyle Carberry fb9ca7b830 feat: Add the option to generate a trial license during setup (#5110)
This allows users to generate a 30 day free license during setup to
test out Enterprise features.
2022-11-16 17:09:49 -06:00

28 lines
361 B
SQL

-- name: InsertLicense :one
INSERT INTO
licenses (
uploaded_at,
jwt,
exp,
uuid
)
VALUES
($1, $2, $3, $4) RETURNING *;
-- name: GetLicenses :many
SELECT *
FROM licenses
ORDER BY (id);
-- name: GetUnexpiredLicenses :many
SELECT *
FROM licenses
WHERE exp > NOW()
ORDER BY (id);
-- name: DeleteLicense :one
DELETE
FROM licenses
WHERE id = $1
RETURNING id;