From a32dadf2db2bf851b25c54ab066f6f61e670703e Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Fri, 17 Jan 2025 10:16:05 +0300 Subject: [PATCH] Fix network migration issue in postgres Signed-off-by: bcmmbaga --- management/server/migration/migration.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/management/server/migration/migration.go b/management/server/migration/migration.go index 8986d77b505..d7abbad47d2 100644 --- a/management/server/migration/migration.go +++ b/management/server/migration/migration.go @@ -330,10 +330,7 @@ func MigrateNewField[T any](ctx context.Context, db *gorm.DB, columnName string, } var rows []map[string]any - if err := tx.Table(tableName). - Select("id", columnName). - Where(columnName + " IS NULL OR " + columnName + " = ''"). - Find(&rows).Error; err != nil { + if err := tx.Table(tableName).Select("id", columnName).Where(columnName + " IS NULL").Find(&rows).Error; err != nil { return fmt.Errorf("failed to find rows with empty %s: %w", columnName, err) }