Merge pull request #525 from writefreely/fix-monetization-sqlite-query

Fix monetization_pointer upsert query for SQLite
pull/538/merge
Matt Baer 3 years ago committed by GitHub
commit 0d554ce180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      database.go

@ -924,7 +924,7 @@ func (db *datastore) UpdateCollection(c *SubmittedCollection, alias string) erro
} }
} }
if !skipUpdate { if !skipUpdate {
_, err = db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value = ?", collID, "monetization_pointer", *c.Monetization, *c.Monetization) _, err = db.Exec("INSERT INTO collectionattributes (collection_id, attribute, value) VALUES (?, ?, ?) "+db.upsert("collection_id", "attribute")+" value = ?", collID, "monetization_pointer", *c.Monetization, *c.Monetization)
if err != nil { if err != nil {
log.Error("Unable to insert monetization_pointer value: %v", err) log.Error("Unable to insert monetization_pointer value: %v", err)
return err return err

Loading…
Cancel
Save