-- +mixmaker Up
ALTER TABLE accounts
    DROP CONSTRAINT IF EXISTS accounts_role_check,
    ADD CONSTRAINT accounts_role_check CHECK (role IN ('admin', 'moderator', 'player'));

-- +mixmaker Down
UPDATE accounts SET role = 'player' WHERE role = 'moderator';
ALTER TABLE accounts
    DROP CONSTRAINT IF EXISTS accounts_role_check,
    ADD CONSTRAINT accounts_role_check CHECK (role IN ('admin', 'player'));
