lockserver/db/queries/user_codes.sql
Finn 350fc3b339
All checks were successful
/ build-container (push) Successful in 1m3s
rip out all auth stuff, add a containerfile
2024-04-23 17:34:57 -07:00

14 lines
504 B
SQL

-- name: CreateUserCode :one
INSERT INTO user_codes (user, code, start, end) VALUES (?, ?, ?, ?) RETURNING id;
-- name: DeleteUserCode :exec
DELETE FROM user_codes WHERE id = ?;
-- name: AssignUserCodeSlot :exec
INSERT INTO user_code_slots (user_code, lock, slot) VALUES (?, ?, ?);
-- name: UnassignUserCodeSlot :exec
DELETE FROM user_code_slots WHERE user_code = ? AND lock = ?;
-- name: GetAllUserCodes :many
SELECT user_codes.*, users.name FROM user_codes, users WHERE user_codes.user = users.id;