From 9df483f30a917155e07e65f398edbdbbb59338fe Mon Sep 17 00:00:00 2001 From: OJisMe Date: Mon, 5 Feb 2024 11:06:15 -0500 Subject: [PATCH 1/2] 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 } From 7bcaaab3f429033fb48285305c233174fcdcf405 Mon Sep 17 00:00:00 2001 From: OJisMe Date: Wed, 7 Feb 2024 17:53:04 -0500 Subject: [PATCH 2/2] removing duplicate commands from cli --- cli/main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cli/main.go b/cli/main.go index 7ed2f9a0b..6967add90 100755 --- a/cli/main.go +++ b/cli/main.go @@ -19,8 +19,6 @@ func main() { commands.ResetCommand(), commands.InsertCommand(), commands.DropCommand(), - commands.ResetCommand(), - commands.DropCommand(), commands.RunBackendCommand(), commands.TestCommand(), // TODO: frontend tests commands.FormatCommand(), // TODO: frontend format