From 9df483f30a917155e07e65f398edbdbbb59338fe Mon Sep 17 00:00:00 2001 From: OJisMe Date: Mon, 5 Feb 2024 11:06:15 -0500 Subject: [PATCH] edit sac-cli clean command to only drop dbs with "sac_test_" prefix --- cli/commands/clean_tests.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/commands/clean_tests.go b/cli/commands/clean_tests.go index a984d6c77..e3d4c6973 100644 --- a/cli/commands/clean_tests.go +++ b/cli/commands/clean_tests.go @@ -48,7 +48,7 @@ func CleanTestDBs() error { return fmt.Errorf("failed to get current user: %w", err) } - rows, err := db.Query("SELECT datname FROM pg_database WHERE datistemplate = false AND datname != 'postgres' AND datname != $1 AND datname != $2", currentUser.Username, CONFIG.Database.DatabaseName) + rows, err := db.Query("SELECT datname FROM pg_database WHERE datistemplate = false AND datname != 'postgres' AND datname != $1 AND datname != $2 AND datname LIKE 'sac_test_%';", currentUser.Username, CONFIG.Database.DatabaseName) if err != nil { return err }