Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit sac-cli clean command to only drop dbs with "sac_test_" prefix #169

Closed
wants to merge 2 commits into from
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
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
2 changes: 0 additions & 2 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading