ALTER TABLE public.accounts
ADD CONSTRAINT accounts_personal_code_unique UNIQUE (personal_code);

ALTER TABLE public.invitations
ALTER COLUMN personal_code TYPE text;

ALTER TABLE public.invitations
ADD CONSTRAINT invitations_personal_code_unique UNIQUE (personal_code);