[bugfix] Fix update users query in migration (#3963)

This commit is contained in:
tobi 2025-04-02 12:39:38 +02:00 committed by GitHub
commit 57c5f68e1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,12 +81,13 @@ func init() {
return err
}
// Set instance app
// ID on all users.
// Set instance app ID on
// users where it's null.
if _, err := tx.
NewUpdate().
Table("users").
Set("? = ?", bun.Ident("created_by_application_id"), instanceAppID).
Where("? IS NULL", bun.Ident("created_by_application_id")).
Exec(ctx); err != nil {
return err
}