Skip to content

Commit

Permalink
edit sac-cli clean command to only drop dbs with "sac_test_" prefix (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ojn03 authored Feb 5, 2024
1 parent effb1ac commit 0d099ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/commands/clean_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 0d099ad

Please sign in to comment.