fix: add check for empty services (#7611)

This commit is contained in:
Nityananda Gohain 2025-04-15 22:09:33 +05:30 committed by GitHub
parent 48936bed9b
commit e723399f7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,12 +238,14 @@ func (migration *updateIntegrations) Up(ctx context.Context, db *bun.DB) error {
if err == nil && len(existingServices) > 0 { if err == nil && len(existingServices) > 0 {
newServices := migration. newServices := migration.
CopyOldCloudIntegrationServicesToNewCloudIntegrationServices(tx, orgIDs[0], existingServices) CopyOldCloudIntegrationServicesToNewCloudIntegrationServices(tx, orgIDs[0], existingServices)
_, err = tx. if len(newServices) > 0 {
NewInsert(). _, err = tx.
Model(&newServices). NewInsert().
Exec(ctx) Model(&newServices).
if err != nil { Exec(ctx)
return err if err != nil {
return err
}
} }
} }
return nil return nil