Files
heygermany-e2e-mrg1d1zl/db/postgres/0005-user-type-role.sql
e2e 59b4a7a404
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 09:21:21 +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;