diff --git a/userapi/storage/accounts/postgres/deltas/20220210130238_add_account_type.go b/userapi/storage/accounts/postgres/deltas/2022021013023800_add_account_type.go similarity index 79% rename from userapi/storage/accounts/postgres/deltas/20220210130238_add_account_type.go rename to userapi/storage/accounts/postgres/deltas/2022021013023800_add_account_type.go index bb5374896..f4da387f9 100644 --- a/userapi/storage/accounts/postgres/deltas/20220210130238_add_account_type.go +++ b/userapi/storage/accounts/postgres/deltas/2022021013023800_add_account_type.go @@ -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 }