-
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.
* 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
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/main/resources/db/migration/V7__submission_add_primary_key.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,4 @@ | ||
alter table submissions | ||
add primary key (id); | ||
alter table submissions | ||
alter column id set not null; |
17 changes: 17 additions & 0 deletions
17
src/test/java/formflow/library/config/FlywayConfiguration.java
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,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(); | ||
}; | ||
} | ||
} |
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