ALTER TABLE public.registry_entities ALTER COLUMN reference_id DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN parent_id DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_vatn DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_locality DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_pcode DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_address DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN person_surname DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN person_name DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_name DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_type DROP DEFAULT;
ALTER TABLE public.registry_entities ALTER COLUMN entity_form DROP DEFAULT;

ALTER TABLE public.registry_entities DROP CONSTRAINT registry_country_fk;
ALTER TABLE public.registry_entities DROP CONSTRAINT registry_entities_code_list_registry_categories_fk;
ALTER TABLE public.registry_entities DROP CONSTRAINT registry_entities_code_list_registry_forms_fk;
ALTER TABLE public.registry_entities DROP CONSTRAINT registry_entities_code_list_registry_types_fk;
ALTER TABLE public.registry_entities DROP CONSTRAINT registry_state_fk;

DROP INDEX idx_34672_entity_country_fk_idx;
DROP INDEX idx_34672_entity_state_fk_idx;
DROP INDEX idx_34672_registry_entities_code_list_registry_categories_fk;
DROP INDEX idx_34672_registry_entities_code_list_registry_forms_fk;
DROP INDEX idx_34672_registry_entities_code_list_registry_types_fk;

ALTER TABLE public.registry_entities ADD entity_brand varchar(50) NULL;