Implement new budget with transaction to be able to satisfy not null columns
This commit is contained in:
@ -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