Define the code to delete data from non-master branches properly
This commit is contained in:
parent
9c7310f8e3
commit
b087cfca67
1 changed files with 15 additions and 1 deletions
|
|
@ -162,4 +162,18 @@ WHERE id IN ("
|
||||||
(string-join guix-revision-ids ", ")
|
(string-join guix-revision-ids ", ")
|
||||||
")")))))))
|
")")))))))
|
||||||
|
|
||||||
(with-postgresql-connection "foo" (lambda (conn) (for-each (lambda (branch-name) (delete-data-for-branch conn 1 branch-name)) (map car (exec-query conn "SELECT DISTINCT name FROM git_branches WHERE git_repository_id = 1 AND name != 'master'")))))
|
(define (delete-data-for-all-branches-but-master)
|
||||||
|
(with-postgresql-connection
|
||||||
|
"data-deletion"
|
||||||
|
(lambda (conn)
|
||||||
|
(for-each
|
||||||
|
(lambda (branch-name)
|
||||||
|
(delete-data-for-branch conn 1 branch-name))
|
||||||
|
(map
|
||||||
|
car
|
||||||
|
(exec-query
|
||||||
|
conn
|
||||||
|
"
|
||||||
|
SELECT DISTINCT name
|
||||||
|
FROM git_branches
|
||||||
|
WHERE git_repository_id = 1 AND name != 'master'"))))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue