Files
zero2prod/migrations/20250930145931_add_role_to_users.sql
Alphonse Paix 3e81c27ab3
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled
Administrator privileges to get and delete subscribers
2025-09-30 18:28:04 +02:00

8 lines
201 B
SQL

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;