Fix migration, add IS NULL

This commit is contained in:
Till Faelligen 2022-02-11 18:58:01 +01:00
parent 6fe71d92bb
commit eeaad35ce1
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ func UpAddAccountType(tx *sql.Tx) error {
return fmt.Errorf("failed to add column: %w", err)
}
_, err = tx.Exec("UPDATE account_accounts SET account_type = 1 WHERE appservice_id = '';")
_, err = tx.Exec("UPDATE account_accounts SET account_type = 1 WHERE appservice_id = '' OR appservice_id IS NULL;")
if err != nil {
return fmt.Errorf("failed to update user accounts: %w", err)
}

View file

@ -23,7 +23,7 @@ func UpAddAccountType(tx *sql.Tx) error {
if err != nil {
return fmt.Errorf("failed to add column: %w", err)
}
_, err = tx.Exec(`UPDATE account_accounts SET account_type = 1 WHERE appservice_id = ''`)
_, err = tx.Exec(`UPDATE account_accounts SET account_type = 1 WHERE appservice_id = '' OR appservice_id IS NULL`)
if err != nil {
return fmt.Errorf("failed to update user accounts: %w", err)
}