Add income_category_id only after categories table exists

This commit is contained in:
2021-12-11 22:08:08 +00:00
parent 208ffce968
commit 8b6a8c3697
2 changed files with 3 additions and 2 deletions

View File

@@ -4,6 +4,8 @@ CREATE TABLE categories (
category_group_id uuid NOT NULL REFERENCES category_groups (id) ON DELETE CASCADE,
name varchar(50) NOT NULL
);
ALTER TABLE budgets ADD COLUMN income_category_id uuid NOT NULL REFERENCES categories (id) DEFERRABLE;
-- +goose Down
ALTER TABLE budgets DROP COLUMN income_category_id;
DROP TABLE categories;