mirror of
https://github.com/writefreely/writefreely
synced 2025-02-17 16:28:23 +00:00
Ensure SetCollectionAttribute also updates attributes
Previously, it would only INSERT.
This commit is contained in:
parent
5d4ebb59c7
commit
e0c165ff1e
1 changed files with 1 additions and 1 deletions
|
@ -2274,7 +2274,7 @@ func (db *datastore) GetCollectionAttribute(id int64, attr string) string {
|
|||
}
|
||||
|
||||
func (db *datastore) SetCollectionAttribute(id int64, attr, v string) error {
|
||||
_, err := db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?)", id, attr, v)
|
||||
_, err := db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?) "+db.upsert("collection_id", "attribute")+" value = ?", id, attr, v, v)
|
||||
if err != nil {
|
||||
log.Error("Unable to INSERT into collectionattributes: %v", err)
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue