瀏覽代碼

change IS NOT to !=

Alexander Belanger 3 年之前
父節點
當前提交
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 {
 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
 	return query.Update("archived", true).Error
 }
 }
@@ -52,7 +52,7 @@ func (m *MonitorTestResultRepository) ArchiveMonitorTestResults(recommenderID st
 func (m *MonitorTestResultRepository) DeleteOldMonitorTestResults(recommenderID string) error {
 func (m *MonitorTestResultRepository) DeleteOldMonitorTestResults(recommenderID string) error {
 	monitors := make([]*models.MonitorTestResult, 0)
 	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
 	// we need to switch on the database type to delete records older than 24 hours
 	switch m.db.Dialector.Name() {
 	switch m.db.Dialector.Name() {