mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-23 22:38:36 +01:00
[management] Fix network migration issue in postgres (#3198)
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
1b2517ea20
commit
c01874e9ce
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user