dendrite/userapi/storage/postgres/deltas/2022080800000000_no_guests.go
PiotrKozimor 83e9d2d83c
Fix guests that were created by migration a users again (#23)
* Fix guests that were created accidentally by migration a users again

* Check for errors in ExpirePresence
2022-08-08 18:20:09 +02:00

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
}