I have a custom type in Postgres DB called money_with_currency Created as:
CREATE TYPE public.money_with_currency AS (currency_code char(3), amount numeric);
We want to change the type of currency_code from char(3) to varchar.
I thought the code would be something like:
ALTER TYPE public.money_with_currency ALTER ATTRIBUTE currency_code SET DATA TYPE varchar;
But got an error:
ALTER TYPE public.money_with_currency ALTER ATTRIBUTE currency_code SET DATA TYPE varchar;\n"
** (Postgrex.Error) ERROR 0A000 (feature_not_supported) cannot alter type "money_with_currency" because column "prog_fees.amount" uses it
Any thoughts if there is a solution without having to do manual migration to all columns using the type?