fis association replace

This commit is contained in:
Pascal Fischer
2025-07-03 13:35:18 +02:00
parent 7132642e4c
commit e78b7dd058
3 changed files with 9 additions and 9 deletions

View File

@@ -39,6 +39,11 @@ func MigrateFieldFromGobToJSON[T any, S any](ctx context.Context, db *gorm.DB, f
return nil
}
if !db.Migrator().HasColumn(&model, fieldName) {
log.WithContext(ctx).Debugf("Table for %T does not have column %s, no migration needed", model, fieldName)
return nil
}
stmt := &gorm.Statement{DB: db}
err := stmt.Parse(model)
if err != nil {