Skip to content

Commit

Permalink
test(sql/postgres): bump testcontainers, truncate cascade for Postgre…
Browse files Browse the repository at this point in the history
…SQL (spinnaker#820)
  • Loading branch information
ncknt authored Nov 13, 2020
1 parent 149c137 commit 0f7ba62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,14 @@ public static void cleanupDb(DSLContext context) {
&& !table.getName().equals(configuration.getDatabaseChangeLogLockTableName()))
.forEach(
table -> {
context.truncate(table.getName()).execute();
switch (context.dialect()) {
case POSTGRES:
context.truncateTable(table.getName()).cascade().execute();
break;
default:
context.truncateTable(table.getName()).execute();
break;
}
});
if (context.dialect() == SQLDialect.MYSQL) {
context.execute("set foreign_key_checks=1");
Expand Down
2 changes: 1 addition & 1 deletion spinnaker-dependencies/spinnaker-dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
api(platform("io.strikt:strikt-bom:0.28.0"))
api(platform("org.spockframework:spock-bom:1.3-groovy-2.5"))
api(platform("com.oracle.oci.sdk:oci-java-sdk-bom:1.5.17"))
api(platform("org.testcontainers:testcontainers-bom:1.14.3"))
api(platform("org.testcontainers:testcontainers-bom:1.15.0"))
api(platform("com.google.protobuf:protobuf-bom:${versions.protobuf}"))

constraints {
Expand Down

0 comments on commit 0f7ba62

Please sign in to comment.