ALTER TABLE public.registry_entities DROP COLUMN entity_subtype;
ALTER TABLE public.registry_entities DROP COLUMN entity_name_2;
ALTER TABLE public.registry_entities DROP COLUMN entity_fiscal;
ALTER TABLE public.registry_entities RENAME COLUMN entity_level TO parent_id;
ALTER TABLE public.registry_entities ALTER COLUMN parent_id TYPE int8 USING parent_id::int8;
ALTER TABLE public.registry_entities RENAME COLUMN legacy_id TO reference_id;
ALTER TABLE public.registry_entities DROP COLUMN old_data;
ALTER TABLE public.registry_entities ALTER COLUMN meta SET DEFAULT '{}'::jsonb;

ALTER TABLE public.registry_entities DROP COLUMN iban_st;
ALTER TABLE public.registry_entities DROP COLUMN iban_cin_e;
ALTER TABLE public.registry_entities DROP COLUMN iban_cin_it;
ALTER TABLE public.registry_entities DROP COLUMN iban_abi;
ALTER TABLE public.registry_entities DROP COLUMN iban_cab;
ALTER TABLE public.registry_entities DROP COLUMN iban_cc;
ALTER TABLE public.registry_entities DROP COLUMN bic;

