diff --git a/bootstrap/src/main/resources/application.yml b/bootstrap/src/main/resources/application.yml index d53f254..27eba26 100644 --- a/bootstrap/src/main/resources/application.yml +++ b/bootstrap/src/main/resources/application.yml @@ -10,7 +10,7 @@ spring: jpa: hibernate: - ddl-auto: update + ddl-auto: validate properties: hibernate.transaction.jta.platform: org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform hibernate: @@ -48,5 +48,4 @@ spring: jpa: properties: hibernate: - ddl-auto: update dialect: org.hibernate.dialect.PostgreSQLDialect \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c71a596..a7dee1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ services: POSTGRES_PASSWORD: ${DB_PASSWORD} volumes: - rest-email-bridge-db-data:/var/lib/postgresql/data + - ./infrastructure/src/main/resources/db-scripts:/docker-entrypoint-initdb.d networks: - network diff --git a/infrastructure/src/main/resources/db-scripts/V1.0.0_DDL_init_scheme.sql b/infrastructure/src/main/resources/db-scripts/V1.0.0_DDL_init_scheme.sql new file mode 100644 index 0000000..150075c --- /dev/null +++ b/infrastructure/src/main/resources/db-scripts/V1.0.0_DDL_init_scheme.sql @@ -0,0 +1,8 @@ +CREATE TABLE restemailbridge.mail +( + id BIGSERIAL PRIMARY KEY, + body VARCHAR(255) NOT NULL, + recipient VARCHAR(255) NOT NULL, + sender VARCHAR(255) NOT NULL, + subject VARCHAR(255) NOT NULL +); \ No newline at end of file