-- Name: strategic_clusters_output_cluster_access_routes; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_output_cluster_access_routes (
    cluster_run_id integer,
    cluster_id text,
    edge_count bigint,
    distance double precision,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_output_cluster_access_routes'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_access_routes ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_access_routes ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_access_routes ALTER COLUMN edge_count OPTIONS (
    column_name 'edge_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_access_routes ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_access_routes ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_output_cluster_core_routes; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes (
    cluster_run_id integer,
    core_route_id bigint,
    cluster_id text,
    cab_name character varying,
    core_route_distance double precision,
    geom public.geometry,
    route_rank bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_output_cluster_core_routes'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN core_route_id OPTIONS (
    column_name 'core_route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN core_route_distance OPTIONS (
    column_name 'core_route_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_core_routes ALTER COLUMN route_rank OPTIONS (
    column_name 'route_rank'
);


--
-- Name: strategic_clusters_output_cluster_review; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_output_cluster_review (
    id integer,
    cluster_run_id integer,
    cluster_run_datetime timestamp without time zone,
    cluster_id text,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises numeric,
    pia_ug_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_mdu_premises numeric,
    pia_ug_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    in_project_premises numeric,
    released_premises numeric,
    cab_name character varying,
    pole_distance double precision,
    duct_distance double precision,
    civils_distance double precision,
    total_distance double precision,
    cluster_capex_budget numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_output_cluster_review'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pole_distance OPTIONS (
    column_name 'pole_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN duct_distance OPTIONS (
    column_name 'duct_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN civils_distance OPTIONS (
    column_name 'civils_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster_review ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_output_premise; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_output_premise (
    sprn integer,
    fid character varying(20),
    cluster_run_id integer,
    cluster_run_datetime timestamp without time zone,
    cluster_id text,
    building_type text,
    pia_type text,
    project_id integer,
    status smallint,
    premise_selected integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_output_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise ALTER COLUMN premise_selected OPTIONS (
    column_name 'premise_selected'
);


--
-- Name: strategic_clusters_output_premise_backup; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_output_premise_backup (
    sprn integer,
    fid character varying(20),
    cluster_run_id integer,
    cluster_run_datetime timestamp without time zone,
    cluster_id text,
    building_type text,
    pia_type text,
    project_id integer,
    status smallint,
    premise_selected integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_output_premise_backup'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_premise_backup ALTER COLUMN premise_selected OPTIONS (
    column_name 'premise_selected'
);


--
-- Name: strategic_clusters_project_creation_sprntopt; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt (
    cluster_sprn integer,
    fid character varying(20),
    bd_status smallint,
    existing_sprn integer,
    portfolio_name character varying,
    building_type text,
    pia_type text,
    install_type integer,
    class_type character varying
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_project_creation_sprntopt'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN cluster_sprn OPTIONS (
    column_name 'cluster_sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN existing_sprn OPTIONS (
    column_name 'existing_sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN portfolio_name OPTIONS (
    column_name 'portfolio_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN install_type OPTIONS (
    column_name 'install_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_project_creation_sprntopt ALTER COLUMN class_type OPTIONS (
    column_name 'class_type'
);


--
-- Name: strategic_clusters_rollout_plan_candidate_clusters; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters (
    id integer,
    cluster_run_id integer,
    cluster_run_datetime timestamp without time zone,
    cluster_id text,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises numeric,
    pia_ug_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_mdu_premises numeric,
    pia_ug_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    in_project_premises numeric,
    released_premises numeric,
    cab_name character varying,
    pole_distance double precision,
    duct_distance double precision,
    civils_distance double precision,
    total_distance double precision,
    cluster_capex_budget numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_rollout_plan_candidate_clusters'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pole_distance OPTIONS (
    column_name 'pole_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN duct_distance OPTIONS (
    column_name 'duct_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN civils_distance OPTIONS (
    column_name 'civils_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_candidate_clusters ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_rollout_plan_clusters; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters (
    cumulative_premises numeric,
    cumulative_capex numeric,
    cumulative_cppp numeric,
    rollout_month integer,
    id integer,
    capacity_order integer,
    cab_order integer,
    hld_order integer,
    priority_category integer,
    borough text,
    cluster_run_id integer,
    cluster_id text,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    mdu_wayleave_percent numeric,
    sdu_premises numeric,
    in_project_premises numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    t50_green_premises bigint,
    t50_amber_premises bigint,
    mm100_green_premises bigint,
    mm100_amber_premises bigint,
    governance_premises bigint,
    cab_name character varying,
    cab_status integer,
    cab_aux_capacity_percent numeric,
    cab_build_required_by date,
    notes text,
    build_partner character varying(100)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_rollout_plan_clusters'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cumulative_premises OPTIONS (
    column_name 'cumulative_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cumulative_capex OPTIONS (
    column_name 'cumulative_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cumulative_cppp OPTIONS (
    column_name 'cumulative_cppp'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN rollout_month OPTIONS (
    column_name 'rollout_month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN capacity_order OPTIONS (
    column_name 'capacity_order'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cab_order OPTIONS (
    column_name 'cab_order'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN hld_order OPTIONS (
    column_name 'hld_order'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN priority_category OPTIONS (
    column_name 'priority_category'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN t50_green_premises OPTIONS (
    column_name 't50_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN t50_amber_premises OPTIONS (
    column_name 't50_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mm100_green_premises OPTIONS (
    column_name 'mm100_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN mm100_amber_premises OPTIONS (
    column_name 'mm100_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN governance_premises OPTIONS (
    column_name 'governance_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cab_aux_capacity_percent OPTIONS (
    column_name 'cab_aux_capacity_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN cab_build_required_by OPTIONS (
    column_name 'cab_build_required_by'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN notes OPTIONS (
    column_name 'notes'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters ALTER COLUMN build_partner OPTIONS (
    column_name 'build_partner'
);


--
-- Name: strategic_clusters_rollout_plan_clusters_geom; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom (
    cumulative_premises numeric,
    cumulative_capex numeric,
    cumulative_cppp numeric,
    rollout_month integer,
    id integer,
    capacity_order integer,
    cab_order integer,
    hld_order integer,
    priority_category integer,
    borough text,
    cluster_run_id integer,
    cluster_id text,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    mdu_wayleave_percent numeric,
    sdu_premises numeric,
    in_project_premises numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    t50_green_premises bigint,
    t50_amber_premises bigint,
    mm100_green_premises bigint,
    mm100_amber_premises bigint,
    governance_premises bigint,
    cab_name character varying,
    cab_status integer,
    cab_aux_capacity_percent numeric,
    cab_build_required_by date,
    notes text,
    build_partner character varying(100),
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_rollout_plan_clusters_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cumulative_premises OPTIONS (
    column_name 'cumulative_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cumulative_capex OPTIONS (
    column_name 'cumulative_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cumulative_cppp OPTIONS (
    column_name 'cumulative_cppp'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN rollout_month OPTIONS (
    column_name 'rollout_month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN capacity_order OPTIONS (
    column_name 'capacity_order'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cab_order OPTIONS (
    column_name 'cab_order'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN hld_order OPTIONS (
    column_name 'hld_order'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN priority_category OPTIONS (
    column_name 'priority_category'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN t50_green_premises OPTIONS (
    column_name 't50_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN t50_amber_premises OPTIONS (
    column_name 't50_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mm100_green_premises OPTIONS (
    column_name 'mm100_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN mm100_amber_premises OPTIONS (
    column_name 'mm100_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN governance_premises OPTIONS (
    column_name 'governance_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cab_aux_capacity_percent OPTIONS (
    column_name 'cab_aux_capacity_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN cab_build_required_by OPTIONS (
    column_name 'cab_build_required_by'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN notes OPTIONS (
    column_name 'notes'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN build_partner OPTIONS (
    column_name 'build_partner'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_geom ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_rollout_plan_clusters_stg0; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 (
    cluster_id text,
    total_premises bigint,
    total_overlap bigint,
    overlap_percent numeric,
    t50_green_premises bigint,
    t50_amber_premises bigint,
    mm100_green_premises bigint,
    mm100_amber_premises bigint,
    governance bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_rollout_plan_clusters_stg0'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN total_overlap OPTIONS (
    column_name 'total_overlap'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN overlap_percent OPTIONS (
    column_name 'overlap_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN t50_green_premises OPTIONS (
    column_name 't50_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN t50_amber_premises OPTIONS (
    column_name 't50_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN mm100_green_premises OPTIONS (
    column_name 'mm100_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN mm100_amber_premises OPTIONS (
    column_name 'mm100_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg0 ALTER COLUMN governance OPTIONS (
    column_name 'governance'
);


--
-- Name: strategic_clusters_rollout_plan_clusters_stg_wip_data; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data (
    sprn integer,
    segment text,
    portfolio_name character varying,
    borough text,
    classification_cat text,
    project_classification text,
    project_id integer,
    project_status_id integer,
    on_hold boolean,
    project_premises bigint,
    rag text,
    governance integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_rollout_plan_clusters_stg_wip_data'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN segment OPTIONS (
    column_name 'segment'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN portfolio_name OPTIONS (
    column_name 'portfolio_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN classification_cat OPTIONS (
    column_name 'classification_cat'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN project_classification OPTIONS (
    column_name 'project_classification'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN project_status_id OPTIONS (
    column_name 'project_status_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN on_hold OPTIONS (
    column_name 'on_hold'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN project_premises OPTIONS (
    column_name 'project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN rag OPTIONS (
    column_name 'rag'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_clusters_stg_wip_data ALTER COLUMN governance OPTIONS (
    column_name 'governance'
);


--
-- Name: strategic_clusters_rollout_plan_portfolio_overlap; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap (
    portfolio text,
    green_premises_8month bigint,
    amber_premises_8month bigint,
    green_premises_12month bigint,
    amber_premises_12month bigint,
    green_premises_24month bigint,
    amber_premises_24month bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_rollout_plan_portfolio_overlap'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN portfolio OPTIONS (
    column_name 'portfolio'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN green_premises_8month OPTIONS (
    column_name 'green_premises_8month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN amber_premises_8month OPTIONS (
    column_name 'amber_premises_8month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN green_premises_12month OPTIONS (
    column_name 'green_premises_12month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN amber_premises_12month OPTIONS (
    column_name 'amber_premises_12month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN green_premises_24month OPTIONS (
    column_name 'green_premises_24month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_rollout_plan_portfolio_overlap ALTER COLUMN amber_premises_24month OPTIONS (
    column_name 'amber_premises_24month'
);


--
-- Name: strategic_clusters_runs; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_runs (
    cluster_run_id integer NOT NULL,
    cluster_run_name character varying(100),
    cluster_run_description text,
    cluster_run_datetime timestamp without time zone,
    cluster_run_type character varying
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_runs'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_runs ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_runs ALTER COLUMN cluster_run_name OPTIONS (
    column_name 'cluster_run_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_runs ALTER COLUMN cluster_run_description OPTIONS (
    column_name 'cluster_run_description'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_runs ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_runs ALTER COLUMN cluster_run_type OPTIONS (
    column_name 'cluster_run_type'
);


--
-- Name: strategic_clusters_stg0; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg0 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    total_building_premises bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    geom public.geometry,
    r bigint,
    include_status text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg0'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN total_building_premises OPTIONS (
    column_name 'total_building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg0 ALTER COLUMN include_status OPTIONS (
    column_name 'include_status'
);


--
-- Name: strategic_clusters_stg1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg10; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg10 (
    core_route_id bigint,
    cluster_id text,
    cab_name character varying,
    core_route_distance double precision,
    geom public.geometry,
    route_type text,
    route_rank bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg10'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN core_route_id OPTIONS (
    column_name 'core_route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN core_route_distance OPTIONS (
    column_name 'core_route_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN route_type OPTIONS (
    column_name 'route_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10 ALTER COLUMN route_rank OPTIONS (
    column_name 'route_rank'
);


--
-- Name: strategic_clusters_stg10t; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg10t (
    core_route_id bigint,
    cluster_id text,
    cab_name character varying,
    core_route_distance double precision,
    core_route_distance_pole double precision,
    core_route_distance_duct double precision,
    core_route_distance_civils double precision,
    core_route_cost numeric,
    core_route_cost_pole numeric,
    core_route_cost_duct numeric,
    core_route_cost_civils numeric,
    geom public.geometry,
    route_rank bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg10t'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_id OPTIONS (
    column_name 'core_route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_distance OPTIONS (
    column_name 'core_route_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_distance_pole OPTIONS (
    column_name 'core_route_distance_pole'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_distance_duct OPTIONS (
    column_name 'core_route_distance_duct'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_distance_civils OPTIONS (
    column_name 'core_route_distance_civils'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_cost OPTIONS (
    column_name 'core_route_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_cost_pole OPTIONS (
    column_name 'core_route_cost_pole'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_cost_duct OPTIONS (
    column_name 'core_route_cost_duct'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN core_route_cost_civils OPTIONS (
    column_name 'core_route_cost_civils'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg10t ALTER COLUMN route_rank OPTIONS (
    column_name 'route_rank'
);


--
-- Name: strategic_clusters_stg11; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg11 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg11'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg11 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);


--
-- Name: strategic_clusters_stg12; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg12 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg12'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_stg12_pass1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg12_pass1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass1 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_stg12_pass2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg12_pass2'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass2 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_stg12_pass3; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg12_pass3'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass3 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_stg12_pass4; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg12_pass4'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass4 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_stg12_pass5; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 (
    route_id bigint,
    fid character varying(20),
    building_premises bigint,
    pia_type text,
    node_id bigint,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    cluster_id text,
    r bigint,
    cluster_center_vertice_id bigint,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg12_pass5'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN route_id OPTIONS (
    column_name 'route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN cluster_center_vertice_id OPTIONS (
    column_name 'cluster_center_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg12_pass5 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_stg13; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg13 (
    cluster_id text,
    edge_count bigint,
    distance double precision,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg13'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13 ALTER COLUMN edge_count OPTIONS (
    column_name 'edge_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg13_test1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg13_test1 (
    cluster_id text,
    edge bigint,
    edge_count bigint,
    building_premises numeric,
    distance double precision,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg13_test1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test1 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test1 ALTER COLUMN edge_count OPTIONS (
    column_name 'edge_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg13_test2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg13_test2 (
    cluster_id text,
    edge bigint,
    edge_count bigint,
    building_premises numeric,
    distance double precision,
    geom public.geometry,
    intersects bigint,
    t public.geometry,
    i_geom public.geometry,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg13_test2'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN edge_count OPTIONS (
    column_name 'edge_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN intersects OPTIONS (
    column_name 'intersects'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN i_geom OPTIONS (
    column_name 'i_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13_test2 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


--
-- Name: strategic_clusters_stg13a; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg13a (
    cluster_id text,
    total_routes bigint,
    total_premises numeric,
    span_coupler_routed bigint,
    pole_routed bigint,
    chamber_routed bigint,
    span_coupler_not_routed bigint,
    pole_not_routed bigint,
    chamber_not_routed bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg13a'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN total_routes OPTIONS (
    column_name 'total_routes'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN span_coupler_routed OPTIONS (
    column_name 'span_coupler_routed'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN pole_routed OPTIONS (
    column_name 'pole_routed'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN chamber_routed OPTIONS (
    column_name 'chamber_routed'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN span_coupler_not_routed OPTIONS (
    column_name 'span_coupler_not_routed'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN pole_not_routed OPTIONS (
    column_name 'pole_not_routed'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg13a ALTER COLUMN chamber_not_routed OPTIONS (
    column_name 'chamber_not_routed'
);


--
-- Name: strategic_clusters_stg14; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg14 (
    cluster_id text,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    in_project_premises numeric,
    released_premises numeric,
    cab_name character varying,
    total_distance numeric,
    cluster_capex_budget numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg14'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg14 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2 ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2 ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2a; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2a (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2a'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2a ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2b; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2b (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2b'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2b ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2c; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2c (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2c'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2c ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2d; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2d (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2d'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2d ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2e; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2e (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2e'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2e ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2_2f; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2_2f (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer,
    cluster_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_sdu_mix numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2_2f'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2_2f ALTER COLUMN cluster_sdu_mix OPTIONS (
    column_name 'cluster_sdu_mix'
);


--
-- Name: strategic_clusters_stg2a; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2a (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2a'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2a ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2b; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2b (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2b'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2b1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2b1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2b1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2b1 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2c; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2c (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2c'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2c1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2c1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2c1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2c1 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2d; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2d (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2d'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2d1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2d1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2d1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2d1 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2e; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2e (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2e'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2e1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2e1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2e1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2e1 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2f; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2f (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2f'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2f1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2f1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2f1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2f1 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2g; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2g (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2g'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2g1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2g1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2g1'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2g1 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg2h; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg2h (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    mdu_id bigint,
    building_premises bigint,
    building_type text,
    closestcab_type text,
    closestcab_metrestocab double precision,
    pia_type text,
    project_id integer,
    status smallint,
    road_meters_per_premise numeric,
    mdu_with_wayleave bigint,
    mdu_with_wayleave_t50 bigint,
    mdu_with_wayleave_other bigint,
    buffer_radius numeric,
    geom public.geometry,
    t integer,
    cluster_id text,
    existing_cluster integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg2h'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN buffer_radius OPTIONS (
    column_name 'buffer_radius'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg2h ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);


--
-- Name: strategic_clusters_stg3; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg3 (
    cluster_id text,
    borough character varying(50),
    existing_cluster integer,
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg3'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg3a; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg3a (
    cluster_id text,
    borough character varying(50),
    existing_cluster integer,
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg3a'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg3a ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg4; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg4 (
    t bigint,
    r bigint,
    cluster_id_parent_candidate text,
    parent_borough character varying(50),
    cluster_premise_count_parent_candidate numeric,
    cluster_id_child_candidate text,
    cluster_premise_count_child_candidate numeric,
    child_borough character varying(50),
    child_geom public.geometry,
    parent_area double precision,
    child_area double precision,
    intersect_area double precision,
    intersect_percent double precision,
    parent_cluster_candidate integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg4'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN t OPTIONS (
    column_name 't'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN cluster_id_parent_candidate OPTIONS (
    column_name 'cluster_id_parent_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN parent_borough OPTIONS (
    column_name 'parent_borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN cluster_premise_count_parent_candidate OPTIONS (
    column_name 'cluster_premise_count_parent_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN cluster_id_child_candidate OPTIONS (
    column_name 'cluster_id_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN cluster_premise_count_child_candidate OPTIONS (
    column_name 'cluster_premise_count_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN child_borough OPTIONS (
    column_name 'child_borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN child_geom OPTIONS (
    column_name 'child_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN parent_area OPTIONS (
    column_name 'parent_area'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN child_area OPTIONS (
    column_name 'child_area'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN intersect_area OPTIONS (
    column_name 'intersect_area'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN intersect_percent OPTIONS (
    column_name 'intersect_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg4 ALTER COLUMN parent_cluster_candidate OPTIONS (
    column_name 'parent_cluster_candidate'
);


--
-- Name: strategic_clusters_stg5; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg5 (
    cluster_id text,
    borough character varying(50),
    existing_cluster integer,
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    pia_oh_percent numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg5'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN existing_cluster OPTIONS (
    column_name 'existing_cluster'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN pia_oh_percent OPTIONS (
    column_name 'pia_oh_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg5 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg6; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg6 (
    cluster_id text,
    borough character varying(50),
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    pia_oh_percent numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg6'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN pia_oh_percent OPTIONS (
    column_name 'pia_oh_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg6a; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg6a (
    cluster_id_child_candidate text,
    cluster_premise_count_child_candidate numeric,
    cluster_id_parent_candidate text,
    cluster_premise_count_parent_candidate numeric,
    borough character varying(50),
    child_geom public.geometry,
    cumulative_prem numeric,
    parent_geom public.geometry,
    distance double precision,
    cluster_premise_count_parent_new numeric
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg6a'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN cluster_id_child_candidate OPTIONS (
    column_name 'cluster_id_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN cluster_premise_count_child_candidate OPTIONS (
    column_name 'cluster_premise_count_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN cluster_id_parent_candidate OPTIONS (
    column_name 'cluster_id_parent_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN cluster_premise_count_parent_candidate OPTIONS (
    column_name 'cluster_premise_count_parent_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN child_geom OPTIONS (
    column_name 'child_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN cumulative_prem OPTIONS (
    column_name 'cumulative_prem'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN parent_geom OPTIONS (
    column_name 'parent_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6a ALTER COLUMN cluster_premise_count_parent_new OPTIONS (
    column_name 'cluster_premise_count_parent_new'
);


--
-- Name: strategic_clusters_stg6b; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg6b (
    cluster_id_child_candidate text,
    new_id text,
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg6b'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN cluster_id_child_candidate OPTIONS (
    column_name 'cluster_id_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN new_id OPTIONS (
    column_name 'new_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg6b ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_stg7; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg7 (
    cluster_id text,
    borough character varying(50),
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    pia_oh_percent numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry,
    centriod public.geometry,
    id bigint,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg7'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN pia_oh_percent OPTIONS (
    column_name 'pia_oh_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN centriod OPTIONS (
    column_name 'centriod'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg7 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


--
-- Name: strategic_clusters_stg8; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg8 (
    core_route_id bigint,
    cab_distance_row bigint,
    cluster_id text,
    cluster_vertice_id bigint,
    cab_id bigint,
    cab_name character varying,
    cab_vertice_id bigint,
    distance double precision,
    line_geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg8'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN core_route_id OPTIONS (
    column_name 'core_route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN cab_distance_row OPTIONS (
    column_name 'cab_distance_row'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN cluster_vertice_id OPTIONS (
    column_name 'cluster_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN cab_id OPTIONS (
    column_name 'cab_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN cab_vertice_id OPTIONS (
    column_name 'cab_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg8 ALTER COLUMN line_geom OPTIONS (
    column_name 'line_geom'
);


--
-- Name: strategic_clusters_stg9; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_stg9 (
    core_route_id bigint,
    cab_distance_row bigint,
    cluster_id text,
    cluster_vertice_id bigint,
    cab_id bigint,
    cab_name character varying,
    cab_vertice_id bigint,
    distance double precision,
    line_geom public.geometry,
    seq integer,
    path_seq integer,
    node bigint,
    edge bigint,
    cost double precision,
    agg_cost double precision,
    the_geom public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_stg9'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN core_route_id OPTIONS (
    column_name 'core_route_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cab_distance_row OPTIONS (
    column_name 'cab_distance_row'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cluster_vertice_id OPTIONS (
    column_name 'cluster_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cab_id OPTIONS (
    column_name 'cab_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cab_vertice_id OPTIONS (
    column_name 'cab_vertice_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN line_geom OPTIONS (
    column_name 'line_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN seq OPTIONS (
    column_name 'seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN path_seq OPTIONS (
    column_name 'path_seq'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN node OPTIONS (
    column_name 'node'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN edge OPTIONS (
    column_name 'edge'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN agg_cost OPTIONS (
    column_name 'agg_cost'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_stg9 ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);


--
-- Name: strategic_clusters_test; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_test (
    id bigint,
    cluster_id text,
    cluster_premise_count numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    sdu_premises numeric,
    pia_oh_premises numeric,
    pia_ug_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_mdu_premises numeric,
    pia_ug_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    pia_oh_percent numeric,
    in_project_premises numeric,
    released_premises numeric,
    geom public.geometry,
    cluster_id2 text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_test'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN pia_oh_percent OPTIONS (
    column_name 'pia_oh_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test ALTER COLUMN cluster_id2 OPTIONS (
    column_name 'cluster_id2'
);


--
-- Name: strategic_clusters_test2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_test2 (
    r bigint,
    cluster_id_child_candidate text,
    cluster_premise_count_child_candidate numeric,
    cluster_id_parent_candidate text,
    cluster_premise_count_parent_candidate numeric,
    child_geom public.geometry,
    cumulative_prem numeric,
    parent_geom public.geometry,
    distance double precision,
    cluster_premise_count_parent_new numeric,
    line_geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_test2'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN r OPTIONS (
    column_name 'r'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN cluster_id_child_candidate OPTIONS (
    column_name 'cluster_id_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN cluster_premise_count_child_candidate OPTIONS (
    column_name 'cluster_premise_count_child_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN cluster_id_parent_candidate OPTIONS (
    column_name 'cluster_id_parent_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN cluster_premise_count_parent_candidate OPTIONS (
    column_name 'cluster_premise_count_parent_candidate'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN child_geom OPTIONS (
    column_name 'child_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN cumulative_prem OPTIONS (
    column_name 'cumulative_prem'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN parent_geom OPTIONS (
    column_name 'parent_geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN cluster_premise_count_parent_new OPTIONS (
    column_name 'cluster_premise_count_parent_new'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_test2 ALTER COLUMN line_geom OPTIONS (
    column_name 'line_geom'
);


--
-- Name: strategic_clusters_to_delivery_clusters; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters (
    date_cluster_processed timestamp with time zone,
    rollout_month integer,
    borough text,
    cluster_id text,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    mdu_with_wayleave_t50 numeric,
    mdu_with_wayleave_other numeric,
    mdu_wayleave_percent numeric,
    sdu_premises numeric,
    in_project_premises numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    t50_green_premises bigint,
    t50_amber_premises bigint,
    mm100_green_premises bigint,
    mm100_amber_premises bigint,
    build_partner character varying(100),
    moved_to_cluster_id text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_to_delivery_clusters'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN date_cluster_processed OPTIONS (
    column_name 'date_cluster_processed'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN rollout_month OPTIONS (
    column_name 'rollout_month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN t50_green_premises OPTIONS (
    column_name 't50_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN t50_amber_premises OPTIONS (
    column_name 't50_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mm100_green_premises OPTIONS (
    column_name 'mm100_green_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN mm100_amber_premises OPTIONS (
    column_name 'mm100_amber_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN build_partner OPTIONS (
    column_name 'build_partner'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_clusters ALTER COLUMN moved_to_cluster_id OPTIONS (
    column_name 'moved_to_cluster_id'
);


--
-- Name: strategic_clusters_to_delivery_premises; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises (
    id integer NOT NULL,
    sprn integer,
    fid character varying(20),
    cluster_run_id integer,
    cluster_run_datetime timestamp without time zone,
    cluster_id text,
    address text,
    postcode character varying(8),
    building_type text,
    pia_type text,
    project_id integer,
    lead_project integer,
    status smallint,
    cab_name character varying,
    cab_status integer,
    cab_live_date date,
    classification_code character varying,
    class_description character varying,
    borough character varying(50),
    class_type text,
    geom public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_to_delivery_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN lead_project OPTIONS (
    column_name 'lead_project'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN cab_live_date OPTIONS (
    column_name 'cab_live_date'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN classification_code OPTIONS (
    column_name 'classification_code'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN class_description OPTIONS (
    column_name 'class_description'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN class_type OPTIONS (
    column_name 'class_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_to_delivery_premises_boundary_todo; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo (
    id integer,
    sprn integer,
    fid character varying(20),
    cluster_run_id integer,
    cluster_run_datetime timestamp without time zone,
    cluster_id text,
    address text,
    postcode character varying(8),
    building_type text,
    pia_type text,
    project_id integer,
    lead_project integer,
    status smallint,
    cab_name character varying,
    cab_status integer,
    cab_live_date date,
    classification_code character varying,
    class_description character varying,
    borough character varying(50),
    class_type text,
    geom public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_to_delivery_premises_boundary_todo'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN lead_project OPTIONS (
    column_name 'lead_project'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN cab_live_date OPTIONS (
    column_name 'cab_live_date'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN classification_code OPTIONS (
    column_name 'classification_code'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN class_description OPTIONS (
    column_name 'class_description'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN class_type OPTIONS (
    column_name 'class_type'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_premises_boundary_todo ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_to_delivery_projects; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects (
    rollout_month integer,
    cluster_id character varying(100),
    cluster_contractor character varying(100),
    project_id integer,
    actual_contractor text,
    actual_planning_contractor text,
    project_name text,
    project_added timestamp without time zone,
    project_created text,
    lead_project integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_to_delivery_projects'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN rollout_month OPTIONS (
    column_name 'rollout_month'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN cluster_contractor OPTIONS (
    column_name 'cluster_contractor'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN actual_contractor OPTIONS (
    column_name 'actual_contractor'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN actual_planning_contractor OPTIONS (
    column_name 'actual_planning_contractor'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN project_name OPTIONS (
    column_name 'project_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN project_added OPTIONS (
    column_name 'project_added'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN project_created OPTIONS (
    column_name 'project_created'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_to_delivery_projects ALTER COLUMN lead_project OPTIONS (
    column_name 'lead_project'
);


--
-- Name: strategic_clusters_trial_candidates; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_trial_candidates (
    cluster_id text,
    total_premises bigint,
    mdu_premises bigint,
    mdu_with_wayleave bigint,
    sdu_premises bigint,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises bigint,
    pia_ug_premises bigint,
    civils_premises bigint,
    pia_oh_mdu_premises bigint,
    pia_oh_sdu_premises bigint,
    pia_ug_mdu_premises bigint,
    pia_ug_sdu_premises bigint,
    civils_mdu_premises bigint,
    civils_sdu_premises bigint,
    in_project_premises bigint,
    released_premises bigint,
    pole_distance double precision,
    duct_distance double precision,
    civils_distance double precision,
    total_distance double precision,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_trial_candidates'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pole_distance OPTIONS (
    column_name 'pole_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN duct_distance OPTIONS (
    column_name 'duct_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN civils_distance OPTIONS (
    column_name 'civils_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_clusters_trial_candidates_selected_20220301_t; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t (
    cluster_id text,
    total_premises bigint,
    mdu_premises bigint,
    mdu_with_wayleave bigint,
    sdu_premises bigint,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises bigint,
    pia_ug_premises bigint,
    civils_premises bigint,
    pia_oh_mdu_premises bigint,
    pia_oh_sdu_premises bigint,
    pia_ug_mdu_premises bigint,
    pia_ug_sdu_premises bigint,
    civils_mdu_premises bigint,
    civils_sdu_premises bigint,
    in_project_premises bigint,
    released_premises bigint,
    pole_distance numeric,
    duct_distance numeric,
    civils_distance numeric,
    total_distance numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_trial_candidates_selected_20220301_t'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pole_distance OPTIONS (
    column_name 'pole_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN duct_distance OPTIONS (
    column_name 'duct_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN civils_distance OPTIONS (
    column_name 'civils_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_trial_candidates_selected_20220301_t ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_plan_2m_premise_scenario5; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 (
    plan_month numeric,
    site_name character varying,
    workstream text,
    sprn integer,
    uprn bigint,
    address text,
    postcode character varying(8),
    building_type text,
    geom public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_plan_2m_premise_scenario5'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN plan_month OPTIONS (
    column_name 'plan_month'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN site_name OPTIONS (
    column_name 'site_name'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN workstream OPTIONS (
    column_name 'workstream'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: strategic_plan_2m_premise_scenario5_site_id; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5_site_id (
    id bigint,
    site_name character varying
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_plan_2m_premise_scenario5_site_id'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5_site_id ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_plan_2m_premise_scenario5_site_id ALTER COLUMN site_name OPTIONS (
    column_name 'site_name'
);


--
-- Name: sut_6_dj5; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.sut_6_dj5 (
    id integer,
    hp_date date,
    uprn bigint,
    door_number character varying,
    postcode character varying,
    type character varying,
    block character varying,
    geom public.geometry(Point,27700),
    address text,
    status smallint,
    borough text,
    business_name text,
    main_proprietor text,
    last_status_update text,
    comment text,
    date_added date,
    project_id integer,
    portfolio_id integer,
    business_live integer,
    bd_status smallint,
    sprn integer,
    splitter_id text,
    sales_status smallint,
    declared_live_date date,
    install_type smallint,
    planning_ecd date,
    civils_done boolean,
    cabled boolean,
    spliced boolean,
    tested boolean,
    on_hold boolean,
    on_hold_category smallint,
    on_hold_subcategory smallint,
    on_hold_start date,
    on_hold_revisit date,
    on_hold_stop date,
    last_updater character varying,
    last_update_timestamp timestamp without time zone,
    mdu_id integer,
    forecast_live_date date,
    wayleave_date date,
    main_leaseholder text,
    leaseholder_managed boolean
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'sut_6_dj5'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN hp_date OPTIONS (
    column_name 'hp_date'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN door_number OPTIONS (
    column_name 'door_number'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN block OPTIONS (
    column_name 'block'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN business_name OPTIONS (
    column_name 'business_name'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN main_proprietor OPTIONS (
    column_name 'main_proprietor'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN last_status_update OPTIONS (
    column_name 'last_status_update'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN comment OPTIONS (
    column_name 'comment'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN date_added OPTIONS (
    column_name 'date_added'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN business_live OPTIONS (
    column_name 'business_live'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN splitter_id OPTIONS (
    column_name 'splitter_id'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN sales_status OPTIONS (
    column_name 'sales_status'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN declared_live_date OPTIONS (
    column_name 'declared_live_date'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN install_type OPTIONS (
    column_name 'install_type'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN planning_ecd OPTIONS (
    column_name 'planning_ecd'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN civils_done OPTIONS (
    column_name 'civils_done'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN cabled OPTIONS (
    column_name 'cabled'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN spliced OPTIONS (
    column_name 'spliced'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN tested OPTIONS (
    column_name 'tested'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN on_hold OPTIONS (
    column_name 'on_hold'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN on_hold_category OPTIONS (
    column_name 'on_hold_category'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN on_hold_subcategory OPTIONS (
    column_name 'on_hold_subcategory'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN on_hold_start OPTIONS (
    column_name 'on_hold_start'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN on_hold_revisit OPTIONS (
    column_name 'on_hold_revisit'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN on_hold_stop OPTIONS (
    column_name 'on_hold_stop'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN last_updater OPTIONS (
    column_name 'last_updater'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN last_update_timestamp OPTIONS (
    column_name 'last_update_timestamp'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN forecast_live_date OPTIONS (
    column_name 'forecast_live_date'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN main_leaseholder OPTIONS (
    column_name 'main_leaseholder'
);
ALTER FOREIGN TABLE strategy.sut_6_dj5 ALTER COLUMN leaseholder_managed OPTIONS (
    column_name 'leaseholder_managed'
);


--
-- Name: temp_b3_living_stock_v2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.temp_b3_living_stock_v2 (
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    parent_uprn bigint,
    block text,
    postcode character varying(8),
    address text,
    business_name text,
    borough character varying(50),
    main_proprietor text,
    title_no text,
    property_type text,
    cross_reference character varying(50),
    udprn bigint,
    umprn integer,
    geom public.geometry(Point,27700),
    sprn integer,
    portfolio_id smallint,
    bd_status smallint,
    leasehold_portfolio_id integer,
    wayleave_date date,
    mdu_id bigint,
    class_type text,
    category_code smallint,
    wayleave_portfolio_id smallint,
    main_leaseholder text,
    leaseholder_managed boolean,
    building_type text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'temp_b3_living_stock_v2'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN classification_code OPTIONS (
    column_name 'classification_code'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN class_description OPTIONS (
    column_name 'class_description'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN parent_uprn OPTIONS (
    column_name 'parent_uprn'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN block OPTIONS (
    column_name 'block'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN business_name OPTIONS (
    column_name 'business_name'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN main_proprietor OPTIONS (
    column_name 'main_proprietor'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN title_no OPTIONS (
    column_name 'title_no'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN property_type OPTIONS (
    column_name 'property_type'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN cross_reference OPTIONS (
    column_name 'cross_reference'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN udprn OPTIONS (
    column_name 'udprn'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN umprn OPTIONS (
    column_name 'umprn'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN leasehold_portfolio_id OPTIONS (
    column_name 'leasehold_portfolio_id'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN class_type OPTIONS (
    column_name 'class_type'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN category_code OPTIONS (
    column_name 'category_code'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN wayleave_portfolio_id OPTIONS (
    column_name 'wayleave_portfolio_id'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN main_leaseholder OPTIONS (
    column_name 'main_leaseholder'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN leaseholder_managed OPTIONS (
    column_name 'leaseholder_managed'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);


--
-- Name: temp_b3_living_stock_v2_dj1; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 (
    id integer,
    name character varying(100),
    notes character varying(100),
    type text,
    borough text,
    olt bigint,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    sdu_premises numeric,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    cab_name character varying,
    total_distance numeric,
    cluster_capex_budget numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    costing_datetime timestamp with time zone,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'temp_b3_living_stock_v2_dj1'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN notes OPTIONS (
    column_name 'notes'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN olt OPTIONS (
    column_name 'olt'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN costing_datetime OPTIONS (
    column_name 'costing_datetime'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: temp_b3_living_stock_v2_dj2; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 (
    id integer,
    name character varying(100),
    notes character varying(100),
    type text,
    borough text,
    olt bigint,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    sdu_premises numeric,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    cab_name character varying,
    total_distance numeric,
    cluster_capex_budget numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    costing_datetime timestamp with time zone,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'temp_b3_living_stock_v2_dj2'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN notes OPTIONS (
    column_name 'notes'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN olt OPTIONS (
    column_name 'olt'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN costing_datetime OPTIONS (
    column_name 'costing_datetime'
);
ALTER FOREIGN TABLE strategy.temp_b3_living_stock_v2_dj2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
-- Name: temp_barnet_exec_review_20230207; Type: FOREIGN TABLE; Schema: strategy; Owner: -
--

CREATE FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 (
    id integer,
    name character varying(100),
    notes character varying(100),
    type text,
    borough text,
    olt bigint,
    total_premises numeric,
    mdu_premises numeric,
    mdu_with_wayleave numeric,
    sdu_premises numeric,
    mdu_buildings bigint,
    sdu_buildings bigint,
    pia_oh_premises numeric,
    pia_ug_l_premises numeric,
    pia_ug_c_premises numeric,
    civils_premises numeric,
    pia_oh_mdu_premises numeric,
    pia_oh_sdu_premises numeric,
    pia_ug_l_mdu_premises numeric,
    pia_ug_l_sdu_premises numeric,
    pia_ug_c_mdu_premises numeric,
    pia_ug_c_sdu_premises numeric,
    civils_mdu_premises numeric,
    civils_sdu_premises numeric,
    cab_name character varying,
    total_distance numeric,
    cluster_capex_budget numeric,
    mdu_low_capex numeric,
    sdu_low_capex numeric,
    capacity_low_capex numeric,
    civils_low_capex numeric,
    pia_ug_low_capex numeric,
    pia_oh_low_capex numeric,
    mdu_high_capex numeric,
    sdu_high_capex numeric,
    capacity_high_capex numeric,
    civils_high_capex numeric,
    pia_ug_high_capex numeric,
    pia_oh_high_capex numeric,
    mdu_wayleave_percent numeric,
    capex_low numeric,
    cppp_low numeric,
    capex_high numeric,
    cppp_high numeric,
    costing_datetime timestamp with time zone,
    geom public.geometry,
    live_premises bigint,
    barnet_premises bigint,
    barnet_live_premises bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'temp_barnet_exec_review_20230207'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN notes OPTIONS (
    column_name 'notes'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN olt OPTIONS (
    column_name 'olt'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN costing_datetime OPTIONS (
    column_name 'costing_datetime'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN live_premises OPTIONS (
    column_name 'live_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN barnet_premises OPTIONS (
    column_name 'barnet_premises'
);
ALTER FOREIGN TABLE strategy.temp_barnet_exec_review_20230207 ALTER COLUMN barnet_live_premises OPTIONS (
    column_name 'barnet_live_premises'
);


--
