-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance expense jar category with name
- Loading branch information
Showing
11 changed files
with
40 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
server/src/main/resources/db/migration/V1_08__spending_jar_expense_category_schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
CREATE SEQUENCE IF NOT EXISTS sjec_seq_id START 1 INCREMENT 1; | ||
|
||
CREATE TABLE IF NOT EXISTS spending_jar_expense_category | ||
( | ||
id BIGSERIAL PRIMARY KEY, | ||
jar_id UUID NOT NULL, | ||
category_id UUID NOT NULL, | ||
creation_timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
id BIGINT PRIMARY KEY DEFAULT nextval('sjec_seq_id'), | ||
jar_id UUID NOT NULL, | ||
category_id UUID NOT NULL, | ||
category_name VARCHAR(100) NOT NULL, | ||
creation_timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
FOREIGN KEY (jar_id) REFERENCES spending_jars (id) | ||
) | ||
; | ||
|
||
CREATE UNIQUE INDEX IF NOT EXISTS unique_spending_jar_expense_category_id_idx ON spending_jar_expense_category (jar_id, category_id); | ||
|
||
CREATE INDEX IF NOT EXISTS search_expense_category_jar_id_idx ON spending_jar_expense_category (jar_id); | ||
|
||
CREATE SEQUENCE IF NOT EXISTS sjec_seq_id START 1 INCREMENT 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
server/src/test/resources/spendingplan/web/jar_expense_category-create.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
INSERT INTO server.spending_jar_expense_category(id, | ||
jar_id, | ||
category_id, | ||
category_name, | ||
creation_timestamp) | ||
VALUES (1, | ||
'e2709aa2-7907-4f78-98b6-0f36a0c1b5ca', | ||
'e2709aa2-7907-4f78-98b6-0f36a0c1b5ca', | ||
'Clothing', | ||
'2024-03-23T10:00:04.224870Z'), | ||
(2, | ||
'e2709aa2-7907-4f78-98b6-0f36a0c1b5ca', | ||
'ee0a4cdc-84f0-4f81-8aea-224dad4915e7', | ||
'Clothing', | ||
'2024-03-23T10:00:04.224870Z'); |