
CREATE TABLE service.merge_poi_task
(
    task_id bigint PRIMARY KEY,
    altay_data_date timestamp with time zone NOT NULL,
    created_at timestamp with time zone NOT NULL,
    summary_json jsonb NOT NULL
);

CREATE TABLE service.merge_poi_altay_feed_data
(
    task_id bigint NOT NULL,
    object_id bigint NOT NULL,
    permalink bigint NOT NULL,
    to_delete boolean NOT NULL,
    data_json jsonb NOT NULL,
    the_geom geometry,
    revision bigint NOT NULL
);

CREATE INDEX IF NOT EXISTS merge_poi_altay_feed_data_task_id_idx
    ON service.merge_poi_altay_feed_data USING btree(task_id);