-- Renames the 'root' role to 'master_admin', and adds two new roles below
-- 'admin': 'content_manager' (same capabilities the old 'admin' role always
-- had — everything except managing other accounts) and 'reviewer'
-- (read-only everywhere except their own account).
--
-- Two-step ALTER because MySQL won't let a column hold a value that isn't
-- yet in its own ENUM definition.

ALTER TABLE admin_users MODIFY role ENUM('root','master_admin','admin','content_manager','reviewer') NOT NULL DEFAULT 'content_manager';
UPDATE admin_users SET role = 'master_admin' WHERE role = 'root';
ALTER TABLE admin_users MODIFY role ENUM('master_admin','admin','content_manager','reviewer') NOT NULL DEFAULT 'content_manager';
