diff options
author | Joe Chen <jc@unknwon.io> | 2023-12-17 16:49:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 16:49:37 -0500 |
commit | 41d473e999031a9144bd969a9cc64686f9017606 (patch) | |
tree | ac948d03093e1cf48727a69e260883e78333764c | |
parent | 25fdeaac49af622ff8e059a3502df6d7190f7313 (diff) |
Taskfile: drop-test-db (#7623)
[skip ci]
-rw-r--r-- | Taskfile.yml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Taskfile.yml b/Taskfile.yml index 6607b8a6..872bf990 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -90,3 +90,12 @@ tasks: desc: Identify legacy and deprecated lines cmds: - grep -rnw "\(LEGACY\|Deprecated\)" internal + + drop-test-db: + desc: Drop the test database + cmds: + - | + for dbname in $(psql -Xc "copy (select datname from pg_database where datname like 'gogs-%') to stdout"); do + dropdb "$dbname" + echo "dropped $dbname" + done |