Skip to content

Commit

Permalink
Add primary key 184940940 (#187)
Browse files Browse the repository at this point in the history
* Adds migration to add primary key
* Adds bean for FlywayConfiguration.
* Adds max clients for db tests.
* Add not null to id

---------

Co-authored-by: Bethany Seeger <bseeger@codeforamerica.org>
Co-Authored-By: Chibuisi Enyia; cenyia@codeforamerica.org
Co-Authored-By: Cypress Borg; cborg@codeforamerica.org
  • Loading branch information
cy-by and bseeger authored Apr 20, 2023
1 parent ac9b127 commit 7964632
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
alter table submissions
add primary key (id);
alter table submissions
alter column id set not null;
17 changes: 17 additions & 0 deletions src/test/java/formflow/library/config/FlywayConfiguration.java
Original file line number Diff line number Diff line change
@@ -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();
};
}
}
2 changes: 2 additions & 0 deletions src/test/resources/application-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7964632

Please sign in to comment.