Skip to content

Commit

Permalink
SQALE: Drop dynamic partitions on test start;
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Mar 14, 2023
1 parent 82d70b1 commit 75d5c23
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public SqaleRepositoryService repositoryService(
public void clearDatabase(SqaleRepoContext sqlRepoContext) {
LOGGER.info("Clearing the testing database!");
try (JdbcSession jdbcSession = sqlRepoContext.newJdbcSession().startTransaction()) {
// Simulations results have dynamic partitions, we need to execute delete triggers to clean them.
jdbcSession.executeStatement("DELETE FROM m_simulation_result CASCADE;");

// Truncate cascades to sub-rows of the "object aggregate" - if FK points to m_object table hierarchy.
jdbcSession.executeStatement("TRUNCATE m_object CASCADE;");

Expand Down

0 comments on commit 75d5c23

Please sign in to comment.