Skip to content

Commit

Permalink
[NS-35] - Tests k8s update flyway directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Narvane committed Feb 25, 2024
1 parent b6789d9 commit 53d2179
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
1 change: 0 additions & 1 deletion api-webmvc/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ spring:
show-sql: true
flyway:
url: jdbc:postgresql://postgres-service:5432/my-storage
locations: classpath:/migration
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
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);

0 comments on commit 53d2179

Please sign in to comment.