CREATE TYPE user_role AS ENUM ('admin', 'writer');

ALTER TABLE users ADD COLUMN role user_role;

UPDATE users SET role = 'admin' WHERE role IS NULL;

ALTER TABLE users ALTER COLUMN role SET NOT NULL;
