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;