Handle circular required keys

Use a dummy-value at first and update it later.
Deferrable doesn't seem to work for NOT NULL - only
for FOREIGN KEYs.
This commit is contained in:
jacob1123 committed 2021-12-14 14:13:23 +00:00
1 parent 9e01be699a
commit a8bd03a805
5 files changed
+51 -28

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
-- name: CreateBudget :one
INSERT INTO budgets
(name, last_modification)
VALUES ($1, NOW())
(name, income_category_id, last_modification)
VALUES ($1, $2, NOW())
RETURNING *;
-- name: SetInflowCategory :exec