mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 09:43:10 -06:00
Rename migration, add missing update for appservices
This commit is contained in:
parent
5c5a216011
commit
9f7244f884
|
|
@ -4,15 +4,9 @@ import (
|
|||
"database/sql"
|
||||
"fmt"
|
||||
|
||||
"github.com/pressly/goose"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal/sqlutil"
|
||||
)
|
||||
|
||||
func init() {
|
||||
goose.AddMigration(UpAddAccountType, DownAddAccountType)
|
||||
}
|
||||
|
||||
func LoadAddAccountType(m *sqlutil.Migrations) {
|
||||
m.AddMigration(UpAddAccountType, DownAddAccountType)
|
||||
}
|
||||
|
|
@ -22,6 +16,10 @@ func UpAddAccountType(tx *sql.Tx) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("failed to execute upgrade: %w", err)
|
||||
}
|
||||
_, err = tx.Exec("UPDATE account_accounts SET account_type = 4 WHERE appservice_id <> '';")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute upgrade: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue