diff --git a/src/main/resources/db/migration/V7__submission_add_primary_key.sql b/src/main/resources/db/migration/V7__submission_add_primary_key.sql new file mode 100644 index 000000000..6e5dc20af --- /dev/null +++ b/src/main/resources/db/migration/V7__submission_add_primary_key.sql @@ -0,0 +1,4 @@ +alter table submissions + add primary key (id); +alter table submissions + alter column id set not null; diff --git a/src/test/java/formflow/library/config/FlywayConfiguration.java b/src/test/java/formflow/library/config/FlywayConfiguration.java new file mode 100644 index 000000000..80bd178b0 --- /dev/null +++ b/src/test/java/formflow/library/config/FlywayConfiguration.java @@ -0,0 +1,17 @@ +package formflow.library.config; + +import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FlywayConfiguration { + + @Bean + public FlywayMigrationStrategy clean() { + return flyway -> { + flyway.clean(); + flyway.migrate(); + }; + } +} diff --git a/src/test/resources/application-test.yaml b/src/test/resources/application-test.yaml index da0a79fa7..eeccf779b 100644 --- a/src/test/resources/application-test.yaml +++ b/src/test/resources/application-test.yaml @@ -19,6 +19,8 @@ spring: url: jdbc:postgresql://localhost:5432/form-flow-test username: form-flow-test password: postgres + hikari: + maximum-pool-size: 2 flyway: baselineOnMigrate: true clean-on-validation-error: true