Alexander Belanger 3 лет назад
Родитель
Сommit
30fa794bfa
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      internal/repository/gorm/monitor.go

+ 2 - 2
internal/repository/gorm/monitor.go

@@ -44,7 +44,7 @@ func (m *MonitorTestResultRepository) UpdateMonitorTestResult(monitor *models.Mo
 }
 
 func (m *MonitorTestResultRepository) ArchiveMonitorTestResults(recommenderID string) error {
-	query := m.db.Debug().Unscoped().Model(&models.MonitorTestResult{}).Where("last_recommender_run_id IS NOT ?", recommenderID)
+	query := m.db.Debug().Unscoped().Model(&models.MonitorTestResult{}).Where("last_recommender_run_id != ?", recommenderID)
 
 	return query.Update("archived", true).Error
 }
@@ -52,7 +52,7 @@ func (m *MonitorTestResultRepository) ArchiveMonitorTestResults(recommenderID st
 func (m *MonitorTestResultRepository) DeleteOldMonitorTestResults(recommenderID string) error {
 	monitors := make([]*models.MonitorTestResult, 0)
 
-	query := m.db.Debug().Unscoped().Where("last_recommender_run_id IS NOT ?", recommenderID)
+	query := m.db.Debug().Unscoped().Where("last_recommender_run_id != ?", recommenderID)
 
 	// we need to switch on the database type to delete records older than 24 hours
 	switch m.db.Dialector.Name() {