chore: split queries.sql into files by table (#762)

This commit is contained in:
Colin Adler
2022-04-01 15:45:23 -05:00
committed by GitHub
parent 2b1a0ee126
commit fd523100bf
27 changed files with 2816 additions and 2770 deletions
@@ -0,0 +1,56 @@
-- name: GetProjectVersionsByProjectID :many
SELECT
*
FROM
project_versions
WHERE
project_id = $1 :: uuid;
-- name: GetProjectVersionByJobID :one
SELECT
*
FROM
project_versions
WHERE
job_id = $1;
-- name: GetProjectVersionByProjectIDAndName :one
SELECT
*
FROM
project_versions
WHERE
project_id = $1
AND "name" = $2;
-- name: GetProjectVersionByID :one
SELECT
*
FROM
project_versions
WHERE
id = $1;
-- name: InsertProjectVersion :one
INSERT INTO
project_versions (
id,
project_id,
organization_id,
created_at,
updated_at,
"name",
description,
job_id
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *;
-- name: UpdateProjectVersionByID :exec
UPDATE
project_versions
SET
project_id = $2,
updated_at = $3
WHERE
id = $1;