This commit is contained in:
Marco Pedone 2026-05-22 20:40:58 +02:00
parent cc246ee6fb
commit 9cffbbef74

View file

@ -96,7 +96,7 @@ func AnnunciInsert(annunci typesdefs.AnnunciParsed, resetAllBeforeUpdate bool, i
to_insert = append(to_insert, value)
}
if len(to_insert) > 0 {
stmt := Annunci.INSERT(Annunci.MutableColumns).MODELS(to_insert).ON_CONFLICT(Annunci.Codice).DO_UPDATE(SET(Annunci.MutableColumns.SET(Annunci.EXCLUDED.MutableColumns)))
stmt := Annunci.INSERT(Annunci.MutableColumns).MODELS(to_insert).ON_CONFLICT(Annunci.ID).DO_UPDATE(SET(Annunci.MutableColumns.SET(Annunci.EXCLUDED.MutableColumns))).ON_CONFLICT(Annunci.Codice).DO_UPDATE(SET(Annunci.MutableColumns.SET(Annunci.EXCLUDED.MutableColumns)))
if isDryRun {
log.Printf("Dry run: would have inserted %d records\n", len(to_insert))
} else {