Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteAllExtensions;
import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteAllRoutines;
import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteAllTables;
import static com.appsmith.server.testhelpers.cleanup.DBCleanup.deleteKeysWithPattern;

Expand Down Expand Up @@ -38,8 +36,8 @@ public void afterAll(ExtensionContext context) {

log.debug("Cleaning up after all tests for {}", testClass.getName());
deleteAllTables(jdbcTemplate);
deleteAllExtensions(jdbcTemplate);
deleteAllRoutines(jdbcTemplate);
// deleteAllExtensions(jdbcTemplate);
// deleteAllRoutines(jdbcTemplate);
deleteKeysWithPattern("tenant:.*", reactiveRedisTemplate).block();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
public class DBCleanup {
public static void deleteAllTables(JdbcTemplate jdbcTemplate) {
List<String> tableNames = jdbcTemplate.queryForList(
"SELECT tablename FROM pg_tables WHERE schemaname = 'appsmith'", String.class);
"SELECT tablename FROM pg_tables WHERE schemaname = 'appsmith' AND tablename NOT IN ('user', 'tenant', 'flyway_schema_history', 'theme', 'config', 'permission_group')",
String.class);

for (String tableName : tableNames) {
jdbcTemplate.execute("DROP TABLE IF EXISTS \"" + tableName + "\" CASCADE");
jdbcTemplate.execute("TRUNCATE TABLE \"" + tableName + "\" CASCADE");
}
}

Expand Down