database: Replace existing entries in Refs.

* guix/store/database.scm (add-reference-sql): Add "OR REPLACE".
This commit is contained in:
Ludovic Courtès 2018-06-06 17:14:18 +02:00
parent 4bd86f0d62
commit 122a6cad7d
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -141,7 +141,7 @@ of course. Returns the row id of the row that was modified or inserted."
(last-insert-row-id db))))) (last-insert-row-id db)))))
(define add-reference-sql (define add-reference-sql
"INSERT INTO Refs (referrer, reference) VALUES (:referrer, :reference);") "INSERT OR REPLACE INTO Refs (referrer, reference) VALUES (:referrer, :reference);")
(define (add-references db referrer references) (define (add-references db referrer references)
"REFERRER is the id of the referring store item, REFERENCES is a list "REFERRER is the id of the referring store item, REFERENCES is a list