Skip to content

Commit

Permalink
[management] Fix network migration issue in postgres (#3198)
Browse files Browse the repository at this point in the history
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
  • Loading branch information
bcmmbaga authored Jan 17, 2025
1 parent 1b2517e commit c01874e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions management/server/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit c01874e

Please sign in to comment.