mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 14:33:10 -06:00
* Fix guests that were created accidentally by migration a users again * Check for errors in ExpirePresence
21 lines
520 B
Go
21 lines
520 B
Go
package deltas
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
"fmt"
|
|
)
|
|
|
|
func UpNoGuests(ctx context.Context, tx *sql.Tx) error {
|
|
// AddAccountType introduced a bug where each user that had was registered as a regular user, but without user_id, became a guest.
|
|
_, err := tx.ExecContext(ctx, "UPDATE account_accounts SET account_type = 1 WHERE account_type = 2;")
|
|
if err != nil {
|
|
return fmt.Errorf("failed to execute upgrade: %w", err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func DownNoGuests(ctx context.Context, tx *sql.Tx) error {
|
|
return nil
|
|
}
|