Implement new budget with transaction to be able to satisfy not null columns
This commit is contained in:
1 parent
935499e3a8
commit
40a299141d
3 files changed
+40
No files matched your search
@@ -4,6 +4,11 @@ INSERT INTO budgets
|
||||
VALUES ($1, NOW())
|
||||
RETURNING *;
|
||||
|
||||
-- name: SetInflowCategory :exec
|
||||
UPDATE budgets
|
||||
SET income_category_id = $1
|
||||
WHERE budgets.id = $2;
|
||||
|
||||
-- name: GetBudgetsForUser :many
|
||||
SELECT budgets.* FROM budgets
|
||||
LEFT JOIN user_budgets ON budgets.id = user_budgets.budget_id
|
||||
|
||||
Reference in new issue
Block a user