

ALTER TABLE public.count_events DROP CONSTRAINT count_events_fk_registry;
ALTER TABLE public.count_events DROP COLUMN client_id;
ALTER TABLE public.count_events RENAME COLUMN details TO meta;

ALTER TABLE public.count_events ADD objecttype varchar(45) NOT NULL;
ALTER TABLE public.count_events ADD status varchar(7) NOT NULL;

ALTER TABLE public.count_events ALTER COLUMN "date" TYPE timestamp USING "date"::timestamp;
ALTER TABLE public.count_events DROP CONSTRAINT count_events_fk_sm;
