Files
heygermany-e2e-mrg4m7dd/db/postgres/0005-user-type-role.sql
e2e 6c231d1d36
Some checks failed
Main / Setup and Test (push) Has been cancelled
Main / Build Website (push) Has been cancelled
chore: heygermany customer project
2026-07-11 10:52:27 +02:00

22 lines
445 B
PL/PgSQL

CREATE TYPE app.user_type AS ENUM (
'company',
'backoffice',
'candidate'
);
ALTER TABLE app.user
DROP COLUMN role;
BEGIN;
-- Create a new enum with the desired values
ALTER TYPE app.user_role RENAME TO user_role_old;
CREATE TYPE app.user_role AS ENUM (
'admin',
'owner'
);
DROP TYPE app.user_role_old;
COMMIT;
ALTER TABLE app.user
ADD COLUMN role app.user_role NOT NULL,
ADD COLUMN type app.user_type NOT NULL;