Implement assignment import and clear of budget

This commit is contained in:
2021-12-07 15:18:47 +00:00
parent 6f4bff929e
commit 0b0b20c5ec
12 changed files with 249 additions and 23 deletions

View File

@ -0,0 +1,13 @@
-- name: CreateAssignment :one
INSERT INTO assignments (
date, amount, category_id
) VALUES (
$1, $2, $3
)
RETURNING *;
-- name: DeleteAllAssignments :execrows
DELETE FROM assignments
USING categories
INNER JOIN category_groups ON categories.category_group_id = category_groups.id
WHERE categories.id = assignments.category_id AND category_groups.budget_id = @budget_id;