🐛 Fix ERROR: column reference "id" is ambiguous (SQLSTATE 42702)

This commit is contained in:
LittleSheep 2025-01-26 13:54:34 +08:00
parent f392f12f76
commit da62afe2d1
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ func adminTriggerScanTask(c *fiber.Ctx) error {
})
database.C.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "hash"}},
DoUpdates: clause.Assignments(map[string]interface{}{}),
DoUpdates: clause.AssignmentColumns([]string{"thumbnail", "title", "content", "description", "published_at"}),
}).Create(&result)
log.Info().Str("source", src.ID).Int("count", len(result)).Msg("Scanned a news sources.")

View File

@ -49,7 +49,7 @@ func ScanNewsSources(eager ...bool) {
})
database.C.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "hash"}},
DoUpdates: clause.Assignments(map[string]interface{}{}),
DoUpdates: clause.AssignmentColumns([]string{"thumbnail", "title", "content", "description", "published_at"}),
}).Create(&result)
log.Info().Str("source", src.ID).Int("count", len(result)).Msg("Scanned a news sources.")