-
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.
[NS-35] - Tests k8s update flyway directory
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
api-webmvc/src/main/resources/db/migration/V0001__create-database.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
CREATE TABLE FOOD | ||
( | ||
id UUID NOT NULL, | ||
name VARCHAR(255) NULL, | ||
protein INT NULL, | ||
carbs INT NULL, | ||
fat INT NULL, | ||
CONSTRAINT pk_food_entity PRIMARY KEY (id) | ||
); | ||
|
||
CREATE TABLE MEAL | ||
( | ||
id UUID NOT NULL, | ||
name VARCHAR(255), | ||
CONSTRAINT pk_meal_entity PRIMARY KEY (id) | ||
); | ||
|
||
CREATE TABLE MEAL_PORTIONS | ||
( | ||
meal_id UUID NOT NULL, | ||
food_id UUID NOT NULL, | ||
amount INT NOT NULL | ||
); | ||
|
||
ALTER TABLE MEAL_PORTIONS | ||
ADD CONSTRAINT fk_meal_portions | ||
PRIMARY KEY (meal_id, food_id), | ||
ADD CONSTRAINT fk_meal | ||
FOREIGN KEY (meal_id) REFERENCES MEAL(id), | ||
ADD CONSTRAINT fk_food | ||
FOREIGN KEY (food_id) REFERENCES FOOD(id); |