Initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- name: CountCategories :one
|
||||
SELECT COUNT(*) FROM project_categories;
|
||||
|
||||
-- name: ListCategories :many
|
||||
SELECT * FROM project_categories
|
||||
ORDER BY sort ASC, created_at ASC;
|
||||
|
||||
-- name: ListActiveCategories :many
|
||||
SELECT * FROM project_categories
|
||||
WHERE status = 'active'
|
||||
ORDER BY sort ASC, created_at ASC;
|
||||
|
||||
-- name: CreateCategory :one
|
||||
INSERT INTO project_categories (id, name, sort, status)
|
||||
VALUES (?, ?, ?, ?)
|
||||
RETURNING *;
|
||||
|
||||
-- name: UpdateCategory :one
|
||||
UPDATE project_categories
|
||||
SET name = ?, sort = ?, status = ?, updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = ?
|
||||
RETURNING *;
|
||||
|
||||
-- name: DeleteCategory :exec
|
||||
DELETE FROM project_categories
|
||||
WHERE id = ?;
|
||||
Reference in New Issue
Block a user