-- Name: distance_analysis_data_1780404808_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780404808_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780404823_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780404823_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780405317_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780405317_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780405342_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780405342_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780406899_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780406899_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780406912_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780406912_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780406936_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780406936_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780406945_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780406945_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780407030_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780407030_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780407500_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780407500_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780664238_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780664238_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_data_1780664359_output; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_data_1780664359_output (
    stocklist_id integer,
    project_id integer,
    uprn bigint,
    classification_code character varying,
    class_description character varying,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700),
    style_type text,
    stocklist_name character varying(500),
    account_id integer,
    account_name character varying(500),
    company_id integer,
    building_type text,
    building_use text,
    building_premises bigint,
    project_name character varying(500),
    toid character varying(50),
    rn bigint,
    temp_id bigint,
    target_1_column_1 text,
    target_1_column_2 text,
    target_1_column_3 text,
    target_1_distance double precision,
    target_1_calculated_heading_degrees double precision,
    target_2_column_1 text,
    target_2_column_2 text,
    target_2_column_3 text,
    target_2_distance double precision,
    target_2_calculated_heading_degrees double precision,
    target_3_column_1 text,
    target_3_column_2 text,
    target_3_column_3 text,
    target_3_distance double precision,
    target_3_calculated_heading_degrees double precision,
    t1_t2_similar_heading boolean,
    t1_t3_similar_heading boolean,
    t2_t3_similar_heading boolean,
    all_three_similar_heading boolean,
    aligned_datasets_count integer,
    target_matches_count integer,
    processed_datetime timestamp without time zone,
    last_id_processed integer
);


--
-- Name: distance_analysis_jobs; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_jobs (
    job_id uuid NOT NULL,
    status character varying(50),
    job_type character varying(20),
    stocklist_id integer,
    target_dataset_id_1 integer,
    target_dataset_id_2 integer,
    target_dataset_id_3 integer,
    detail_level character varying(20),
    output_mode character varying(20),
    maximum_distance integer,
    total_rows integer,
    processed_rows integer,
    progress integer,
    total integer,
    message text,
    created_at timestamp without time zone,
    completed_at timestamp without time zone,
    output_data_table character varying(200),
    created_user_id integer
);


--
-- Name: distance_analysis_tables; Type: TABLE; Schema: strategy; Owner: -
--

CREATE TABLE strategy.distance_analysis_tables (
    id bigint NOT NULL,
    datasource_name character varying,
    schema character varying,
    "table" character varying,
    return_column_1 character varying,
    return_column_2 character varying,
    return_column_3 character varying,
    geom_column character varying,
    pk_column character varying
);


--
-- Name: distance_analysis_tables_id_seq; Type: SEQUENCE; Schema: strategy; Owner: -
--

CREATE SEQUENCE strategy.distance_analysis_tables_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: distance_analysis_tables_id_seq; Type: SEQUENCE OWNED BY; Schema: strategy; Owner: -
--

ALTER SEQUENCE strategy.distance_analysis_tables_id_seq OWNED BY strategy.distance_analysis_tables.id;


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

CREATE FOREIGN TABLE strategy.driveway_analysis (
    fid character varying(20),
    borough character varying(50),
    building_premises bigint,
    building_type text,
    pia_type text,
    driveway public.geometry,
    driveway_length double precision,
    adjusted_driveway_length double precision,
    driveway_length_cat text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'driveway_analysis'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN driveway OPTIONS (
    column_name 'driveway'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN driveway_length OPTIONS (
    column_name 'driveway_length'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN adjusted_driveway_length OPTIONS (
    column_name 'adjusted_driveway_length'
);
ALTER FOREIGN TABLE strategy.driveway_analysis ALTER COLUMN driveway_length_cat OPTIONS (
    column_name 'driveway_length_cat'
);


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

CREATE FOREIGN TABLE strategy.driveway_analysis_stg1 (
    sprn integer,
    fid character varying(20),
    borough character varying(50),
    building_premises bigint,
    building_type text,
    pia_type text,
    geom public.geometry(Polygon,27700),
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'driveway_analysis_stg1'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg1 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.driveway_analysis_stg2 (
    fid character varying(20),
    geom_property public.geometry(Polygon,27700),
    geom_road public.geometry,
    distance double precision,
    p1 public.geometry,
    p2 public.geometry,
    driveway public.geometry,
    driveway_length double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'driveway_analysis_stg2'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN geom_property OPTIONS (
    column_name 'geom_property'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN geom_road OPTIONS (
    column_name 'geom_road'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN p1 OPTIONS (
    column_name 'p1'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN p2 OPTIONS (
    column_name 'p2'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN driveway OPTIONS (
    column_name 'driveway'
);
ALTER FOREIGN TABLE strategy.driveway_analysis_stg2 ALTER COLUMN driveway_length OPTIONS (
    column_name 'driveway_length'
);


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

CREATE FOREIGN TABLE strategy.employees (
    employee_id integer NOT NULL,
    full_name character varying NOT NULL,
    manager_id integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'employees'
);
ALTER FOREIGN TABLE strategy.employees ALTER COLUMN employee_id OPTIONS (
    column_name 'employee_id'
);
ALTER FOREIGN TABLE strategy.employees ALTER COLUMN full_name OPTIONS (
    column_name 'full_name'
);
ALTER FOREIGN TABLE strategy.employees ALTER COLUMN manager_id OPTIONS (
    column_name 'manager_id'
);


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

CREATE FOREIGN TABLE strategy.full_ultimate_building_type (
    sprn integer,
    uprn bigint,
    mdu_id bigint,
    fid character varying(20),
    building_premises bigint,
    building_residential_premises bigint,
    building_business_premises bigint,
    building_other_premises bigint,
    building_type text,
    building_height real,
    number_of_floors integer,
    building_classification text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'full_ultimate_building_type'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_residential_premises OPTIONS (
    column_name 'building_residential_premises'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_business_premises OPTIONS (
    column_name 'building_business_premises'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_other_premises OPTIONS (
    column_name 'building_other_premises'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_height OPTIONS (
    column_name 'building_height'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN number_of_floors OPTIONS (
    column_name 'number_of_floors'
);
ALTER FOREIGN TABLE strategy.full_ultimate_building_type ALTER COLUMN building_classification OPTIONS (
    column_name 'building_classification'
);


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

CREATE FOREIGN TABLE strategy.full_ultimate_closest_cab (
    sprn integer,
    uprn bigint,
    geom public.geometry(Point,27700),
    mdu_id bigint,
    closestcab_type text,
    closestcab_id integer,
    closestcab_name character varying,
    closestcab_metrestocab double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'full_ultimate_closest_cab'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN closestcab_id OPTIONS (
    column_name 'closestcab_id'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN closestcab_name OPTIONS (
    column_name 'closestcab_name'
);
ALTER FOREIGN TABLE strategy.full_ultimate_closest_cab ALTER COLUMN closestcab_metrestocab OPTIONS (
    column_name 'closestcab_metrestocab'
);


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

CREATE FOREIGN TABLE strategy.full_ultimate_fid_list (
    fid character varying(20)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'full_ultimate_fid_list'
);
ALTER FOREIGN TABLE strategy.full_ultimate_fid_list ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);


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

CREATE FOREIGN TABLE strategy.full_ultimate_fid_with_premises (
    fid character varying(20),
    borough character varying(50)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'full_ultimate_fid_with_premises'
);
ALTER FOREIGN TABLE strategy.full_ultimate_fid_with_premises ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.full_ultimate_fid_with_premises ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);


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

CREATE FOREIGN TABLE strategy.full_ultimate_pia_type (
    sprn integer NOT NULL,
    uprn bigint,
    geom public.geometry(Point,27700),
    pia_type text,
    opis_serial_no character varying,
    dist_to_pole double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'full_ultimate_pia_type'
);
ALTER FOREIGN TABLE strategy.full_ultimate_pia_type ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_pia_type ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_pia_type ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.full_ultimate_pia_type ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.full_ultimate_pia_type ALTER COLUMN opis_serial_no OPTIONS (
    column_name 'opis_serial_no'
);
ALTER FOREIGN TABLE strategy.full_ultimate_pia_type ALTER COLUMN dist_to_pole OPTIONS (
    column_name 'dist_to_pole'
);


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

CREATE FOREIGN TABLE strategy.full_ultimate_uprn_topoarea_map (
    uprn bigint,
    sprn integer,
    objectid integer,
    fid character varying(20),
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'full_ultimate_uprn_topoarea_map'
);
ALTER FOREIGN TABLE strategy.full_ultimate_uprn_topoarea_map ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_uprn_topoarea_map ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.full_ultimate_uprn_topoarea_map ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.full_ultimate_uprn_topoarea_map ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.full_ultimate_uprn_topoarea_map ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.hex_grid (
    id bigint,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hex_grid'
);
ALTER FOREIGN TABLE strategy.hex_grid ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.hex_grid ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.hex_grid_density (
    id bigint,
    premise_count bigint,
    sqm_per_premise bigint,
    total_road_meters double precision,
    road_meters_per_premise double precision,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hex_grid_density'
);
ALTER FOREIGN TABLE strategy.hex_grid_density ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.hex_grid_density ALTER COLUMN premise_count OPTIONS (
    column_name 'premise_count'
);
ALTER FOREIGN TABLE strategy.hex_grid_density ALTER COLUMN sqm_per_premise OPTIONS (
    column_name 'sqm_per_premise'
);
ALTER FOREIGN TABLE strategy.hex_grid_density ALTER COLUMN total_road_meters OPTIONS (
    column_name 'total_road_meters'
);
ALTER FOREIGN TABLE strategy.hex_grid_density ALTER COLUMN road_meters_per_premise OPTIONS (
    column_name 'road_meters_per_premise'
);
ALTER FOREIGN TABLE strategy.hex_grid_density ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.hex_grid_road_intersect (
    id bigint,
    total_road_meters double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hex_grid_road_intersect'
);
ALTER FOREIGN TABLE strategy.hex_grid_road_intersect ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.hex_grid_road_intersect ALTER COLUMN total_road_meters OPTIONS (
    column_name 'total_road_meters'
);


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

CREATE FOREIGN TABLE strategy.hex_grid_uprn_map (
    uprn bigint,
    id bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hex_grid_uprn_map'
);
ALTER FOREIGN TABLE strategy.hex_grid_uprn_map ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.hex_grid_uprn_map ALTER COLUMN id OPTIONS (
    column_name 'id'
);


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

CREATE FOREIGN TABLE strategy.hld_cab_boundaries (
    id_1 integer NOT NULL,
    geom public.geometry(MultiPolygon,27700),
    id_0 integer,
    name character varying(22),
    id bigint,
    count bigint,
    type character varying(20),
    ring character varying(20),
    mdu integer,
    sdu integer,
    "fibre sdu" bigint,
    comments character varying(200),
    ref character varying(10),
    layer character varying(100),
    path character varying(201)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hld_cab_boundaries'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN id_1 OPTIONS (
    column_name 'id_1'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN id_0 OPTIONS (
    column_name 'id_0'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN count OPTIONS (
    column_name 'count'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN ring OPTIONS (
    column_name 'ring'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN mdu OPTIONS (
    column_name 'mdu'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN sdu OPTIONS (
    column_name 'sdu'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN "fibre sdu" OPTIONS (
    column_name 'fibre sdu'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN comments OPTIONS (
    column_name 'comments'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN ref OPTIONS (
    column_name 'ref'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN layer OPTIONS (
    column_name 'layer'
);
ALTER FOREIGN TABLE strategy.hld_cab_boundaries ALTER COLUMN path OPTIONS (
    column_name 'path'
);


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

CREATE FOREIGN TABLE strategy.hld_cab_locations (
    id_0 integer NOT NULL,
    geom public.geometry(Point,27700),
    id bigint,
    type character varying(20),
    address character varying(63),
    ring character varying(25),
    postcode character varying(12),
    name character varying(50),
    comments character varying(100),
    landlord character varying(254),
    building_a character varying(254),
    status bigint,
    live_date date,
    aux integer,
    creator character varying(254),
    manufactur character varying(254),
    technology character varying(254),
    ip character varying(254),
    device_nam character varying(254),
    last_updat character varying(24),
    poncards bigint,
    card_slots bigint,
    model character varying(254),
    total_ponp character varying(254),
    odf_capaci character varying(254),
    odf_notes character varying(254),
    cpu_banks bigint,
    usable_cap bigint,
    min_unit_c bigint,
    max_unit_c bigint,
    exchange_i bigint,
    surveycode bigint,
    survey_not character varying(254),
    creationda character varying(24),
    units_per_ numeric,
    units_pe_1 numeric,
    fid numeric,
    "hld name" character varying(100),
    layer character varying(100),
    path character varying(200)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hld_cab_locations'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN id_0 OPTIONS (
    column_name 'id_0'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN ring OPTIONS (
    column_name 'ring'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN comments OPTIONS (
    column_name 'comments'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN landlord OPTIONS (
    column_name 'landlord'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN building_a OPTIONS (
    column_name 'building_a'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN live_date OPTIONS (
    column_name 'live_date'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN aux OPTIONS (
    column_name 'aux'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN creator OPTIONS (
    column_name 'creator'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN manufactur OPTIONS (
    column_name 'manufactur'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN technology OPTIONS (
    column_name 'technology'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN ip OPTIONS (
    column_name 'ip'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN device_nam OPTIONS (
    column_name 'device_nam'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN last_updat OPTIONS (
    column_name 'last_updat'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN poncards OPTIONS (
    column_name 'poncards'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN card_slots OPTIONS (
    column_name 'card_slots'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN model OPTIONS (
    column_name 'model'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN total_ponp OPTIONS (
    column_name 'total_ponp'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN odf_capaci OPTIONS (
    column_name 'odf_capaci'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN odf_notes OPTIONS (
    column_name 'odf_notes'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN cpu_banks OPTIONS (
    column_name 'cpu_banks'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN usable_cap OPTIONS (
    column_name 'usable_cap'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN min_unit_c OPTIONS (
    column_name 'min_unit_c'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN max_unit_c OPTIONS (
    column_name 'max_unit_c'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN exchange_i OPTIONS (
    column_name 'exchange_i'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN surveycode OPTIONS (
    column_name 'surveycode'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN survey_not OPTIONS (
    column_name 'survey_not'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN creationda OPTIONS (
    column_name 'creationda'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN units_per_ OPTIONS (
    column_name 'units_per_'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN units_pe_1 OPTIONS (
    column_name 'units_pe_1'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN "hld name" OPTIONS (
    column_name 'hld name'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN layer OPTIONS (
    column_name 'layer'
);
ALTER FOREIGN TABLE strategy.hld_cab_locations ALTER COLUMN path OPTIONS (
    column_name 'path'
);


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

CREATE FOREIGN TABLE strategy.hld_harrow_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,
    premises_cppp_order numeric,
    cheapest_96_percent text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'hld_harrow_clusters'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pole_distance OPTIONS (
    column_name 'pole_distance'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN duct_distance OPTIONS (
    column_name 'duct_distance'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN civils_distance OPTIONS (
    column_name 'civils_distance'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN premises_cppp_order OPTIONS (
    column_name 'premises_cppp_order'
);
ALTER FOREIGN TABLE strategy.hld_harrow_clusters ALTER COLUMN cheapest_96_percent OPTIONS (
    column_name 'cheapest_96_percent'
);


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

CREATE FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 (
    id integer NOT NULL,
    geom public.geometry(MultiPolygon,27700),
    geo_code character varying(9),
    geo_label character varying(254),
    geo_labelw character varying(254),
    label character varying(254),
    name character varying(254)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'infuse_lsoa_lyr_2011'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN geo_code OPTIONS (
    column_name 'geo_code'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN geo_label OPTIONS (
    column_name 'geo_label'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN geo_labelw OPTIONS (
    column_name 'geo_labelw'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN label OPTIONS (
    column_name 'label'
);
ALTER FOREIGN TABLE strategy.infuse_lsoa_lyr_2011 ALTER COLUMN name OPTIONS (
    column_name 'name'
);


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

CREATE FOREIGN TABLE strategy.kingston_cppp (
    project_id integer,
    cppp_low numeric,
    total_premises bigint,
    sprn integer,
    geom public.geometry(Point,27700),
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'kingston_cppp'
);
ALTER FOREIGN TABLE strategy.kingston_cppp ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.kingston_cppp ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.kingston_cppp ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.kingston_cppp ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.kingston_cppp ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.kingston_cppp ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.london (
    id integer,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'london'
);
ALTER FOREIGN TABLE strategy.london ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.london ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.london_borough_build_partners (
    partner_id integer,
    partner_name character varying(100),
    mmi_month_build_capacity integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'london_borough_build_partners'
);
ALTER FOREIGN TABLE strategy.london_borough_build_partners ALTER COLUMN partner_id OPTIONS (
    column_name 'partner_id'
);
ALTER FOREIGN TABLE strategy.london_borough_build_partners ALTER COLUMN partner_name OPTIONS (
    column_name 'partner_name'
);
ALTER FOREIGN TABLE strategy.london_borough_build_partners ALTER COLUMN mmi_month_build_capacity OPTIONS (
    column_name 'mmi_month_build_capacity'
);


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

CREATE FOREIGN TABLE strategy.london_borough_regions (
    id integer,
    borough character varying(22),
    region integer,
    geom public.geometry(MultiPolygon,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'london_borough_regions'
);
ALTER FOREIGN TABLE strategy.london_borough_regions ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.london_borough_regions ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.london_borough_regions ALTER COLUMN region OPTIONS (
    column_name 'region'
);
ALTER FOREIGN TABLE strategy.london_borough_regions ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.london_borough_ward_map (
    borough_id integer,
    borough character varying(22),
    ward_id integer,
    ward character varying(70),
    overlaparea double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'london_borough_ward_map'
);
ALTER FOREIGN TABLE strategy.london_borough_ward_map ALTER COLUMN borough_id OPTIONS (
    column_name 'borough_id'
);
ALTER FOREIGN TABLE strategy.london_borough_ward_map ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.london_borough_ward_map ALTER COLUMN ward_id OPTIONS (
    column_name 'ward_id'
);
ALTER FOREIGN TABLE strategy.london_borough_ward_map ALTER COLUMN ward OPTIONS (
    column_name 'ward'
);
ALTER FOREIGN TABLE strategy.london_borough_ward_map ALTER COLUMN overlaparea OPTIONS (
    column_name 'overlaparea'
);


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

CREATE FOREIGN TABLE strategy.london_boroughs (
    id integer NOT NULL,
    geom public.geometry(MultiPolygon,27700),
    borough character varying(22),
    gss_code character varying(9),
    hectares double precision,
    nonld_area double precision,
    area double precision,
    total_units integer,
    total_wayleave_units integer,
    total_wayleave_mdu integer,
    total_council_owned integer,
    percentage_council_units real,
    other_proprietor_mdu_units integer,
    total_wayleave_sdu integer,
    total_buildings_5_to_9 integer,
    total_units_5_to_9 integer,
    total_buildings_10_to_24 integer,
    total_units_10_to_24 integer,
    total_buildings_25_to_49 integer,
    total_units_25_to_49 integer,
    total_buildings_50_to_99 integer,
    total_units_50_to_99 integer,
    total_buildings_over_100 integer,
    total_units_over_100 integer,
    exchanges smallint,
    units integer,
    unitperexc real,
    inner_london boolean NOT NULL,
    live_units integer,
    customers integer,
    total_road_length bigint,
    total_built_pia bigint,
    total_mdu integer,
    total_sdu integer,
    pia_in_progress bigint,
    pia_rfb bigint,
    landlords_over_100units integer,
    total_pf_mdu integer,
    wayleave integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'london_boroughs'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN gss_code OPTIONS (
    column_name 'gss_code'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN hectares OPTIONS (
    column_name 'hectares'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN nonld_area OPTIONS (
    column_name 'nonld_area'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN area OPTIONS (
    column_name 'area'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_units OPTIONS (
    column_name 'total_units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_wayleave_units OPTIONS (
    column_name 'total_wayleave_units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_wayleave_mdu OPTIONS (
    column_name 'total_wayleave_mdu'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_council_owned OPTIONS (
    column_name 'total_council_owned'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN percentage_council_units OPTIONS (
    column_name 'percentage_council_units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN other_proprietor_mdu_units OPTIONS (
    column_name 'other_proprietor_mdu_units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_wayleave_sdu OPTIONS (
    column_name 'total_wayleave_sdu'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_buildings_5_to_9 OPTIONS (
    column_name 'total_buildings_5_to_9'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_units_5_to_9 OPTIONS (
    column_name 'total_units_5_to_9'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_buildings_10_to_24 OPTIONS (
    column_name 'total_buildings_10_to_24'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_units_10_to_24 OPTIONS (
    column_name 'total_units_10_to_24'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_buildings_25_to_49 OPTIONS (
    column_name 'total_buildings_25_to_49'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_units_25_to_49 OPTIONS (
    column_name 'total_units_25_to_49'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_buildings_50_to_99 OPTIONS (
    column_name 'total_buildings_50_to_99'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_units_50_to_99 OPTIONS (
    column_name 'total_units_50_to_99'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_buildings_over_100 OPTIONS (
    column_name 'total_buildings_over_100'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_units_over_100 OPTIONS (
    column_name 'total_units_over_100'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN exchanges OPTIONS (
    column_name 'exchanges'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN units OPTIONS (
    column_name 'units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN unitperexc OPTIONS (
    column_name 'unitperexc'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN inner_london OPTIONS (
    column_name 'inner_london'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN live_units OPTIONS (
    column_name 'live_units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN customers OPTIONS (
    column_name 'customers'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_road_length OPTIONS (
    column_name 'total_road_length'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_built_pia OPTIONS (
    column_name 'total_built_pia'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_mdu OPTIONS (
    column_name 'total_mdu'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_sdu OPTIONS (
    column_name 'total_sdu'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN pia_in_progress OPTIONS (
    column_name 'pia_in_progress'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN pia_rfb OPTIONS (
    column_name 'pia_rfb'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN landlords_over_100units OPTIONS (
    column_name 'landlords_over_100units'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN total_pf_mdu OPTIONS (
    column_name 'total_pf_mdu'
);
ALTER FOREIGN TABLE strategy.london_boroughs ALTER COLUMN wayleave OPTIONS (
    column_name 'wayleave'
);


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

CREATE FOREIGN TABLE strategy.london_wards (
    id integer NOT NULL,
    ward character varying(70),
    code character varying(9),
    geom public.geometry(MultiPolygon,27700),
    area double precision,
    total_mdu integer,
    total_pf_mdu integer,
    total_toppf integer,
    comment character varying,
    length_comsof integer,
    total_sdu integer,
    total2_4 integer,
    virginsdu integer,
    virgin1_4 integer,
    virginsdu_pc integer,
    virgin1_4_pc integer,
    neil_wardmonth smallint,
    passed2019 boolean,
    total5_9 smallint,
    exchangeid integer,
    liveinprogress integer,
    liveinprogress_huawei integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'london_wards'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN ward OPTIONS (
    column_name 'ward'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN code OPTIONS (
    column_name 'code'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN area OPTIONS (
    column_name 'area'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN total_mdu OPTIONS (
    column_name 'total_mdu'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN total_pf_mdu OPTIONS (
    column_name 'total_pf_mdu'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN total_toppf OPTIONS (
    column_name 'total_toppf'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN comment OPTIONS (
    column_name 'comment'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN length_comsof OPTIONS (
    column_name 'length_comsof'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN total_sdu OPTIONS (
    column_name 'total_sdu'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN total2_4 OPTIONS (
    column_name 'total2_4'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN virginsdu OPTIONS (
    column_name 'virginsdu'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN virgin1_4 OPTIONS (
    column_name 'virgin1_4'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN virginsdu_pc OPTIONS (
    column_name 'virginsdu_pc'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN virgin1_4_pc OPTIONS (
    column_name 'virgin1_4_pc'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN neil_wardmonth OPTIONS (
    column_name 'neil_wardmonth'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN passed2019 OPTIONS (
    column_name 'passed2019'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN total5_9 OPTIONS (
    column_name 'total5_9'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN exchangeid OPTIONS (
    column_name 'exchangeid'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN liveinprogress OPTIONS (
    column_name 'liveinprogress'
);
ALTER FOREIGN TABLE strategy.london_wards ALTER COLUMN liveinprogress_huawei OPTIONS (
    column_name 'liveinprogress_huawei'
);


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

CREATE FOREIGN TABLE strategy.lr_main (
    poly_id numeric(9,0),
    title_no character varying(9),
    geom public.geometry(Polygon,27700),
    uprn bigint,
    el character varying,
    af character varying,
    tenure character varying,
    address text,
    postcode character varying,
    price integer,
    main_proprietor character varying,
    country character varying,
    company_reg_num integer,
    proprietorship_category character varying,
    proprietor_address text,
    num_of_addresses smallint,
    additional_proprietors smallint,
    borough text,
    borough_id integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'lr_main'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN poly_id OPTIONS (
    column_name 'poly_id'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN title_no OPTIONS (
    column_name 'title_no'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN el OPTIONS (
    column_name 'el'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN af OPTIONS (
    column_name 'af'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN tenure OPTIONS (
    column_name 'tenure'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN price OPTIONS (
    column_name 'price'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN main_proprietor OPTIONS (
    column_name 'main_proprietor'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN country OPTIONS (
    column_name 'country'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN company_reg_num OPTIONS (
    column_name 'company_reg_num'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN proprietorship_category OPTIONS (
    column_name 'proprietorship_category'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN proprietor_address OPTIONS (
    column_name 'proprietor_address'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN num_of_addresses OPTIONS (
    column_name 'num_of_addresses'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN additional_proprietors OPTIONS (
    column_name 'additional_proprietors'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.lr_main ALTER COLUMN borough_id OPTIONS (
    column_name 'borough_id'
);


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

CREATE FOREIGN TABLE strategy.lsoa_geom (
    id integer NOT NULL,
    geom public.geometry(MultiPolygon,27700),
    lsoa21cd character varying(9),
    lsoa21nm character varying(40),
    globalid character varying(38)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'lsoa_geom'
);
ALTER FOREIGN TABLE strategy.lsoa_geom ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.lsoa_geom ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.lsoa_geom ALTER COLUMN lsoa21cd OPTIONS (
    column_name 'lsoa21cd'
);
ALTER FOREIGN TABLE strategy.lsoa_geom ALTER COLUMN lsoa21nm OPTIONS (
    column_name 'lsoa21nm'
);
ALTER FOREIGN TABLE strategy.lsoa_geom ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);


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

CREATE FOREIGN TABLE strategy.mdu_governance (
    project_id integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'mdu_governance'
);
ALTER FOREIGN TABLE strategy.mdu_governance ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);


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

CREATE FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 (
    sprn integer,
    class_type text,
    portfolio_id_fu smallint,
    portfolio_id_pt integer,
    borough text,
    segment text,
    portfolio_name character varying,
    bd_status smallint,
    description character varying,
    wayleave_date_full_ultimate date,
    wayleave_date_pf_master date,
    wayleave_forecast_date date,
    sales_status smallint,
    declared_live_date date,
    release_report integer,
    wayleave_report integer,
    building_type text,
    building_premises bigint,
    project_id integer,
    project_classification text,
    project_premises bigint,
    passes_8020_rule integer,
    project_status_id integer,
    project_status text,
    on_hold boolean,
    install_type integer,
    cab_name character varying,
    cab_status integer,
    report_status text,
    viable text,
    pre_plan_onhold integer,
    pre_plan_fluid integer,
    build_onhold integer,
    build_fluid integer,
    pia_type text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'mdu_wayleave_data_v2_6'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN class_type OPTIONS (
    column_name 'class_type'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN portfolio_id_fu OPTIONS (
    column_name 'portfolio_id_fu'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN portfolio_id_pt OPTIONS (
    column_name 'portfolio_id_pt'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN segment OPTIONS (
    column_name 'segment'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN portfolio_name OPTIONS (
    column_name 'portfolio_name'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN description OPTIONS (
    column_name 'description'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN wayleave_date_full_ultimate OPTIONS (
    column_name 'wayleave_date_full_ultimate'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN wayleave_date_pf_master OPTIONS (
    column_name 'wayleave_date_pf_master'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN wayleave_forecast_date OPTIONS (
    column_name 'wayleave_forecast_date'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN sales_status OPTIONS (
    column_name 'sales_status'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN declared_live_date OPTIONS (
    column_name 'declared_live_date'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN release_report OPTIONS (
    column_name 'release_report'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN wayleave_report OPTIONS (
    column_name 'wayleave_report'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN building_premises OPTIONS (
    column_name 'building_premises'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN project_classification OPTIONS (
    column_name 'project_classification'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN project_premises OPTIONS (
    column_name 'project_premises'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN passes_8020_rule OPTIONS (
    column_name 'passes_8020_rule'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN project_status_id OPTIONS (
    column_name 'project_status_id'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN project_status OPTIONS (
    column_name 'project_status'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN on_hold OPTIONS (
    column_name 'on_hold'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN install_type OPTIONS (
    column_name 'install_type'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN report_status OPTIONS (
    column_name 'report_status'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN viable OPTIONS (
    column_name 'viable'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN pre_plan_onhold OPTIONS (
    column_name 'pre_plan_onhold'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN pre_plan_fluid OPTIONS (
    column_name 'pre_plan_fluid'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN build_onhold OPTIONS (
    column_name 'build_onhold'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN build_fluid OPTIONS (
    column_name 'build_fluid'
);
ALTER FOREIGN TABLE strategy.mdu_wayleave_data_v2_6 ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);


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

CREATE FOREIGN TABLE strategy.newham_cppp (
    project_id integer,
    cppp_low numeric,
    total_premises bigint,
    sprn integer,
    geom public.geometry(Point,27700),
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'newham_cppp'
);
ALTER FOREIGN TABLE strategy.newham_cppp ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.newham_cppp ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.newham_cppp ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.newham_cppp ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.newham_cppp ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.newham_cppp ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.olt_summary (
    row_id numeric(6,1),
    olt_pc_id smallint,
    olt_pc_name character varying(25),
    device_name character varying(17),
    qgis_cab_status smallint,
    qgis_date_cab_live date,
    design_type character varying(8),
    aux_capacity_percent character varying(15),
    aux_audit_date date,
    cabinet_audit_rag character varying(11),
    olt_cards_max smallint,
    olt_cards_installed smallint,
    spare_cards_req smallint,
    netops_upgrade_ticket_raised character varying(10),
    olt_cards_spare_slots character varying(4),
    auxfibres_max_capacity character varying(4),
    auxfibres_allocated character varying(4),
    auxfibres_spare character varying(4),
    auxfibres_no_service character varying(4),
    auxfibres_strap_req character varying(4),
    aux_upgrade_req character varying(10),
    olt_build_type character varying(9),
    olt_vendor character varying(7),
    card_type character varying(8)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'olt_summary'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN row_id OPTIONS (
    column_name 'row_id'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_pc_id OPTIONS (
    column_name 'olt_pc_id'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_pc_name OPTIONS (
    column_name 'olt_pc_name'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN device_name OPTIONS (
    column_name 'device_name'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN qgis_cab_status OPTIONS (
    column_name 'qgis_cab_status'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN qgis_date_cab_live OPTIONS (
    column_name 'qgis_date_cab_live'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN design_type OPTIONS (
    column_name 'design_type'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN aux_capacity_percent OPTIONS (
    column_name 'aux_capacity_percent'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN aux_audit_date OPTIONS (
    column_name 'aux_audit_date'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN cabinet_audit_rag OPTIONS (
    column_name 'cabinet_audit_rag'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_cards_max OPTIONS (
    column_name 'olt_cards_max'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_cards_installed OPTIONS (
    column_name 'olt_cards_installed'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN spare_cards_req OPTIONS (
    column_name 'spare_cards_req'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN netops_upgrade_ticket_raised OPTIONS (
    column_name 'netops_upgrade_ticket_raised'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_cards_spare_slots OPTIONS (
    column_name 'olt_cards_spare_slots'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN auxfibres_max_capacity OPTIONS (
    column_name 'auxfibres_max_capacity'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN auxfibres_allocated OPTIONS (
    column_name 'auxfibres_allocated'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN auxfibres_spare OPTIONS (
    column_name 'auxfibres_spare'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN auxfibres_no_service OPTIONS (
    column_name 'auxfibres_no_service'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN auxfibres_strap_req OPTIONS (
    column_name 'auxfibres_strap_req'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN aux_upgrade_req OPTIONS (
    column_name 'aux_upgrade_req'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_build_type OPTIONS (
    column_name 'olt_build_type'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN olt_vendor OPTIONS (
    column_name 'olt_vendor'
);
ALTER FOREIGN TABLE strategy.olt_summary ALTER COLUMN card_type OPTIONS (
    column_name 'card_type'
);


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

CREATE FOREIGN TABLE strategy.openreach_chamber (
    objectid bigint,
    geom public.geometry(Point,27700),
    longitude character varying(200),
    latitude character varying(200),
    "CATEGORY_NAME" character varying(200),
    "DP_IDENTIFIER" character varying(200),
    "EXCHANGE_1141_CODE" character varying(200),
    "INVENTORY_STATUS_CODE" character varying(200),
    "OBJECT_CLASS" character varying(200),
    "OBJECT_ID" character varying(200),
    "OPIS_SERIAL_NO" character varying(200),
    "PLANT_ITEM" character varying(200),
    "STRUCTURE_NAME" character varying(200),
    "TYPE_NAME" character varying(200),
    geometry_coordinates character varying(2048),
    id character varying(20),
    globalid character varying(2048)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_chamber'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN longitude OPTIONS (
    column_name 'longitude'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN latitude OPTIONS (
    column_name 'latitude'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "CATEGORY_NAME" OPTIONS (
    column_name 'CATEGORY_NAME'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "DP_IDENTIFIER" OPTIONS (
    column_name 'DP_IDENTIFIER'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "EXCHANGE_1141_CODE" OPTIONS (
    column_name 'EXCHANGE_1141_CODE'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "INVENTORY_STATUS_CODE" OPTIONS (
    column_name 'INVENTORY_STATUS_CODE'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "OBJECT_CLASS" OPTIONS (
    column_name 'OBJECT_CLASS'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "OBJECT_ID" OPTIONS (
    column_name 'OBJECT_ID'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "OPIS_SERIAL_NO" OPTIONS (
    column_name 'OPIS_SERIAL_NO'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "PLANT_ITEM" OPTIONS (
    column_name 'PLANT_ITEM'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "STRUCTURE_NAME" OPTIONS (
    column_name 'STRUCTURE_NAME'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN "TYPE_NAME" OPTIONS (
    column_name 'TYPE_NAME'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN geometry_coordinates OPTIONS (
    column_name 'geometry_coordinates'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.openreach_chamber ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);


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

CREATE FOREIGN TABLE strategy.openreach_import_duct (
    exchange_1141_code character varying(255),
    section_number character varying(255),
    measured_length numeric(10,2),
    number_of_ways integer,
    rag_status character(1),
    plant_item character varying(255),
    inventory_status_code character varying(255),
    type_name character varying(255),
    object_class character varying(255),
    category_name character varying(255),
    ownership_type_code character varying(255),
    span_name character varying(255),
    objectid bigint,
    shape public.geometry,
    shape_length double precision,
    import_id bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_import_duct'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN exchange_1141_code OPTIONS (
    column_name 'exchange_1141_code'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN section_number OPTIONS (
    column_name 'section_number'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN measured_length OPTIONS (
    column_name 'measured_length'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN number_of_ways OPTIONS (
    column_name 'number_of_ways'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN rag_status OPTIONS (
    column_name 'rag_status'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN plant_item OPTIONS (
    column_name 'plant_item'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN inventory_status_code OPTIONS (
    column_name 'inventory_status_code'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN type_name OPTIONS (
    column_name 'type_name'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN object_class OPTIONS (
    column_name 'object_class'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN category_name OPTIONS (
    column_name 'category_name'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN ownership_type_code OPTIONS (
    column_name 'ownership_type_code'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN span_name OPTIONS (
    column_name 'span_name'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.openreach_import_duct ALTER COLUMN import_id OPTIONS (
    column_name 'import_id'
);


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

CREATE FOREIGN TABLE strategy.openreach_import_structure (
    exchange_1141_code character varying(255),
    object_id character varying(255),
    plant_item character varying(255),
    object_class character varying(255),
    inventory_status_code character varying(255),
    type_name character varying(255),
    category_name character varying(255),
    structure_name character varying(255),
    ownership_type_code character varying(255),
    objectid bigint,
    dp_identifier character varying(255),
    opis_serial_no character varying(255),
    pole_type character varying(255),
    insp_date date,
    result_description text,
    result character varying(255),
    pole_year character varying(255),
    pole_class character varying(255),
    depot character varying(255),
    species character varying(255),
    sub_pole character varying(255),
    a1024_exists boolean,
    pole_age integer,
    shape public.geometry,
    import_id bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_import_structure'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN exchange_1141_code OPTIONS (
    column_name 'exchange_1141_code'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN object_id OPTIONS (
    column_name 'object_id'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN plant_item OPTIONS (
    column_name 'plant_item'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN object_class OPTIONS (
    column_name 'object_class'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN inventory_status_code OPTIONS (
    column_name 'inventory_status_code'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN type_name OPTIONS (
    column_name 'type_name'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN category_name OPTIONS (
    column_name 'category_name'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN structure_name OPTIONS (
    column_name 'structure_name'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN ownership_type_code OPTIONS (
    column_name 'ownership_type_code'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN dp_identifier OPTIONS (
    column_name 'dp_identifier'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN opis_serial_no OPTIONS (
    column_name 'opis_serial_no'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN pole_type OPTIONS (
    column_name 'pole_type'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN insp_date OPTIONS (
    column_name 'insp_date'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN result_description OPTIONS (
    column_name 'result_description'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN result OPTIONS (
    column_name 'result'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN pole_year OPTIONS (
    column_name 'pole_year'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN pole_class OPTIONS (
    column_name 'pole_class'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN depot OPTIONS (
    column_name 'depot'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN species OPTIONS (
    column_name 'species'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN sub_pole OPTIONS (
    column_name 'sub_pole'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN a1024_exists OPTIONS (
    column_name 'a1024_exists'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN pole_age OPTIONS (
    column_name 'pole_age'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);
ALTER FOREIGN TABLE strategy.openreach_import_structure ALTER COLUMN import_id OPTIONS (
    column_name 'import_id'
);


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

CREATE FOREIGN TABLE strategy.openreach_pole (
    objectid bigint,
    geom public.geometry(Point,27700),
    longitude character varying(200),
    latitude character varying(200),
    "A1024_EXISTS" character varying(200),
    "CATEGORY_NAME" character varying(200),
    "DEPOT" character varying(200),
    "DP_IDENTIFIER" character varying(200),
    "EXCHANGE_1141_CODE" character varying(200),
    "INSP_DATE" character varying(200),
    "INVENTORY_STATUS_CODE" character varying(200),
    "OBJECT_CLASS" character varying(200),
    "OPIS_SERIAL_NO" character varying(200),
    "PLANT_ITEM" character varying(200),
    "POLE_AGE" character varying(200),
    "POLE_CLASS" character varying(200),
    "POLE_TYPE" character varying(200),
    "POLE_YEAR" character varying(200),
    "RESULT" character varying(200),
    "RESULT_DESCRIPTION" character varying(200),
    "SPECIES" character varying(200),
    "STRUCTURE_NAME" character varying(200),
    "SUB_POLE" character varying(200),
    "TYPE_NAME" character varying(200),
    geometry_coordinates character varying(2048),
    id character varying(20),
    globalid character varying(2048)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_pole'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN longitude OPTIONS (
    column_name 'longitude'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN latitude OPTIONS (
    column_name 'latitude'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "A1024_EXISTS" OPTIONS (
    column_name 'A1024_EXISTS'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "CATEGORY_NAME" OPTIONS (
    column_name 'CATEGORY_NAME'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "DEPOT" OPTIONS (
    column_name 'DEPOT'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "DP_IDENTIFIER" OPTIONS (
    column_name 'DP_IDENTIFIER'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "EXCHANGE_1141_CODE" OPTIONS (
    column_name 'EXCHANGE_1141_CODE'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "INSP_DATE" OPTIONS (
    column_name 'INSP_DATE'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "INVENTORY_STATUS_CODE" OPTIONS (
    column_name 'INVENTORY_STATUS_CODE'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "OBJECT_CLASS" OPTIONS (
    column_name 'OBJECT_CLASS'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "OPIS_SERIAL_NO" OPTIONS (
    column_name 'OPIS_SERIAL_NO'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "PLANT_ITEM" OPTIONS (
    column_name 'PLANT_ITEM'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "POLE_AGE" OPTIONS (
    column_name 'POLE_AGE'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "POLE_CLASS" OPTIONS (
    column_name 'POLE_CLASS'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "POLE_TYPE" OPTIONS (
    column_name 'POLE_TYPE'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "POLE_YEAR" OPTIONS (
    column_name 'POLE_YEAR'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "RESULT" OPTIONS (
    column_name 'RESULT'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "RESULT_DESCRIPTION" OPTIONS (
    column_name 'RESULT_DESCRIPTION'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "SPECIES" OPTIONS (
    column_name 'SPECIES'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "STRUCTURE_NAME" OPTIONS (
    column_name 'STRUCTURE_NAME'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "SUB_POLE" OPTIONS (
    column_name 'SUB_POLE'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN "TYPE_NAME" OPTIONS (
    column_name 'TYPE_NAME'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN geometry_coordinates OPTIONS (
    column_name 'geometry_coordinates'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.openreach_pole ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);


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

CREATE FOREIGN TABLE strategy.openreach_span_coupler (
    fid integer,
    objectid bigint,
    longitude character varying(200),
    latitude character varying(200),
    category_name character varying(200),
    exchange_1141_code character varying(200),
    inventory_status_code character varying(200),
    object_class character varying(200),
    opis_serial_no character varying(200),
    plant_item character varying(200),
    result character varying(200),
    result_description character varying(200),
    structure_name character varying(200),
    type_name character varying(200),
    geometry_coordinates character varying(2048),
    id character varying(20),
    globalid character varying(2048),
    geom public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_span_coupler'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN longitude OPTIONS (
    column_name 'longitude'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN latitude OPTIONS (
    column_name 'latitude'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN category_name OPTIONS (
    column_name 'category_name'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN exchange_1141_code OPTIONS (
    column_name 'exchange_1141_code'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN inventory_status_code OPTIONS (
    column_name 'inventory_status_code'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN object_class OPTIONS (
    column_name 'object_class'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN opis_serial_no OPTIONS (
    column_name 'opis_serial_no'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN plant_item OPTIONS (
    column_name 'plant_item'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN result OPTIONS (
    column_name 'result'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN result_description OPTIONS (
    column_name 'result_description'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN structure_name OPTIONS (
    column_name 'structure_name'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN type_name OPTIONS (
    column_name 'type_name'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN geometry_coordinates OPTIONS (
    column_name 'geometry_coordinates'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);
ALTER FOREIGN TABLE strategy.openreach_span_coupler ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.openreach_spans (
    id integer,
    objectid bigint,
    category_name character varying(200),
    exchange_1141_code character varying(200),
    inventory_status_code character varying(200),
    measured_length character varying(200),
    number_of_ways character varying(200),
    object_class character varying(200),
    plant_item character varying(200),
    rag_status character varying(200),
    section_number character varying(200),
    span_name character varying(200),
    type_name character varying(200),
    id2 character varying(20),
    globalid character varying(2048),
    shape_length double precision,
    cost_factor integer,
    the_geom public.geometry(MultiLineString,27700),
    dir character varying,
    source bigint,
    target bigint,
    cost double precision,
    reverse_cost double precision,
    capacity bigint,
    reverse_capacity bigint,
    category_id integer,
    reverse_category_id integer,
    x1 double precision,
    y1 double precision,
    x2 double precision,
    y2 double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_spans'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN category_name OPTIONS (
    column_name 'category_name'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN exchange_1141_code OPTIONS (
    column_name 'exchange_1141_code'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN inventory_status_code OPTIONS (
    column_name 'inventory_status_code'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN measured_length OPTIONS (
    column_name 'measured_length'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN number_of_ways OPTIONS (
    column_name 'number_of_ways'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN object_class OPTIONS (
    column_name 'object_class'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN plant_item OPTIONS (
    column_name 'plant_item'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN rag_status OPTIONS (
    column_name 'rag_status'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN section_number OPTIONS (
    column_name 'section_number'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN span_name OPTIONS (
    column_name 'span_name'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN type_name OPTIONS (
    column_name 'type_name'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN id2 OPTIONS (
    column_name 'id2'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN cost_factor OPTIONS (
    column_name 'cost_factor'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN the_geom OPTIONS (
    column_name 'the_geom'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN dir OPTIONS (
    column_name 'dir'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN source OPTIONS (
    column_name 'source'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN target OPTIONS (
    column_name 'target'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN cost OPTIONS (
    column_name 'cost'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN reverse_cost OPTIONS (
    column_name 'reverse_cost'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN capacity OPTIONS (
    column_name 'capacity'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN reverse_capacity OPTIONS (
    column_name 'reverse_capacity'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN category_id OPTIONS (
    column_name 'category_id'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN reverse_category_id OPTIONS (
    column_name 'reverse_category_id'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN x1 OPTIONS (
    column_name 'x1'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN y1 OPTIONS (
    column_name 'y1'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN x2 OPTIONS (
    column_name 'x2'
);
ALTER FOREIGN TABLE strategy.openreach_spans ALTER COLUMN y2 OPTIONS (
    column_name 'y2'
);


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

CREATE FOREIGN TABLE strategy.openreach_spans_vertices_cab_map (
    cab_id bigint,
    id bigint,
    distance double precision,
    linegeom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'openreach_spans_vertices_cab_map'
);
ALTER FOREIGN TABLE strategy.openreach_spans_vertices_cab_map ALTER COLUMN cab_id OPTIONS (
    column_name 'cab_id'
);
ALTER FOREIGN TABLE strategy.openreach_spans_vertices_cab_map ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.openreach_spans_vertices_cab_map ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.openreach_spans_vertices_cab_map ALTER COLUMN linegeom OPTIONS (
    column_name 'linegeom'
);


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

CREATE FOREIGN TABLE strategy.or_pia_type (
    toid character varying(20),
    building_geom public.geometry,
    pia_type text,
    span_coupler_objectid bigint,
    pole_objectid bigint,
    chamber_objectid bigint,
    distance double precision,
    geom public.geometry,
    node_id bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_pia_type'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN building_geom OPTIONS (
    column_name 'building_geom'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN span_coupler_objectid OPTIONS (
    column_name 'span_coupler_objectid'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN pole_objectid OPTIONS (
    column_name 'pole_objectid'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN chamber_objectid OPTIONS (
    column_name 'chamber_objectid'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_pia_type ALTER COLUMN node_id OPTIONS (
    column_name 'node_id'
);


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

CREATE FOREIGN TABLE strategy.or_ways_chamber (
    toid character varying(20),
    geom public.geometry,
    objectid bigint,
    chamber_type text,
    chamber_geom public.geometry,
    chamber_distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_chamber'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber ALTER COLUMN chamber_type OPTIONS (
    column_name 'chamber_type'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber ALTER COLUMN chamber_geom OPTIONS (
    column_name 'chamber_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber ALTER COLUMN chamber_distance OPTIONS (
    column_name 'chamber_distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_chamber_stg1 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    geom public.geometry(Point,27700),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_chamber_stg1'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg1 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_chamber_stg2 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    geom public.geometry(Point,27700),
    drop_geom public.geometry,
    distance double precision,
    check_line text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_chamber_stg2'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg2 ALTER COLUMN check_line OPTIONS (
    column_name 'check_line'
);


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

CREATE FOREIGN TABLE strategy.or_ways_chamber_stg3 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    geom public.geometry(Point,27700),
    drop_geom public.geometry,
    distance double precision,
    check_line text,
    droporder bigint,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_chamber_stg3'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN check_line OPTIONS (
    column_name 'check_line'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN droporder OPTIONS (
    column_name 'droporder'
);
ALTER FOREIGN TABLE strategy.or_ways_chamber_stg3 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pia_ug_stg1 (
    objectid bigint,
    geom public.geometry(MultiLineString,27700),
    end_geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pia_ug_stg1'
);
ALTER FOREIGN TABLE strategy.or_ways_pia_ug_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pia_ug_stg1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pia_ug_stg1 ALTER COLUMN end_geom OPTIONS (
    column_name 'end_geom'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_pass2'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2 ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_pass2_stg1'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1a (
    objectid integer,
    toid character varying(20),
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_pass2_stg1a'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1a ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1a ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg1a ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    geom public.geometry,
    l double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_pass2_stg2'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg2 ALTER COLUMN l OPTIONS (
    column_name 'l'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg3 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_pass2_stg3'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg3 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg3 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test (
    reason integer,
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_pass2_update_test'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN reason OPTIONS (
    column_name 'reason'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_pass2_update_test ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_stg1 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_stg1'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg1 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    geom public.geometry,
    l double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_stg2'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg2 ALTER COLUMN l OPTIONS (
    column_name 'l'
);


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

CREATE FOREIGN TABLE strategy.or_ways_pole_feeds_stg3 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_pole_feeds_stg3'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg3 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg3 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_pole_feeds_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_span_coupler (
    toid character varying(20),
    geom public.geometry,
    objectid bigint,
    coupler_type text,
    coupler_geom public.geometry,
    coupler_distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_span_coupler'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler ALTER COLUMN coupler_type OPTIONS (
    column_name 'coupler_type'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler ALTER COLUMN coupler_geom OPTIONS (
    column_name 'coupler_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler ALTER COLUMN coupler_distance OPTIONS (
    column_name 'coupler_distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_span_coupler_stg2 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_span_coupler_stg2'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg2 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.or_ways_span_coupler_stg3 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    check_line text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_span_coupler_stg3'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg3 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg3 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg3 ALTER COLUMN check_line OPTIONS (
    column_name 'check_line'
);


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

CREATE FOREIGN TABLE strategy.or_ways_span_coupler_stg4 (
    drop_id bigint,
    objectid bigint,
    toid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    check_line text,
    droporder bigint,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'or_ways_span_coupler_stg4'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN check_line OPTIONS (
    column_name 'check_line'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN droporder OPTIONS (
    column_name 'droporder'
);
ALTER FOREIGN TABLE strategy.or_ways_span_coupler_stg4 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.osmmanfc (
    objectid integer NOT NULL,
    featureid integer,
    zorder integer,
    annotationclassid integer,
    element bytea,
    symbolid integer,
    status smallint,
    textstring character varying(255),
    fontname character varying(255),
    fontsize double precision,
    bold smallint,
    italic smallint,
    underline smallint,
    verticalalignment smallint,
    horizontalalignment smallint,
    xoffset double precision,
    yoffset double precision,
    angle double precision,
    fontleading double precision,
    wordspacing double precision,
    characterwidth double precision,
    characterspacing double precision,
    flipangle double precision,
    override integer,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    textangle double precision,
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(15),
    text character varying(250),
    textfont integer,
    textpos integer,
    textheight double precision,
    loaddate timestamp with time zone,
    shape_length double precision,
    shape_area double precision,
    shape public.geometry(MultiPolygon,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmanfc'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN featureid OPTIONS (
    column_name 'featureid'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN zorder OPTIONS (
    column_name 'zorder'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN annotationclassid OPTIONS (
    column_name 'annotationclassid'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN element OPTIONS (
    column_name 'element'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN symbolid OPTIONS (
    column_name 'symbolid'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN textstring OPTIONS (
    column_name 'textstring'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN fontname OPTIONS (
    column_name 'fontname'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN fontsize OPTIONS (
    column_name 'fontsize'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN bold OPTIONS (
    column_name 'bold'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN italic OPTIONS (
    column_name 'italic'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN underline OPTIONS (
    column_name 'underline'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN verticalalignment OPTIONS (
    column_name 'verticalalignment'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN horizontalalignment OPTIONS (
    column_name 'horizontalalignment'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN xoffset OPTIONS (
    column_name 'xoffset'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN yoffset OPTIONS (
    column_name 'yoffset'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN angle OPTIONS (
    column_name 'angle'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN fontleading OPTIONS (
    column_name 'fontleading'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN wordspacing OPTIONS (
    column_name 'wordspacing'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN characterwidth OPTIONS (
    column_name 'characterwidth'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN characterspacing OPTIONS (
    column_name 'characterspacing'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN flipangle OPTIONS (
    column_name 'flipangle'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN override OPTIONS (
    column_name 'override'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN textangle OPTIONS (
    column_name 'textangle'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN text OPTIONS (
    column_name 'text'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN textfont OPTIONS (
    column_name 'textfont'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN textpos OPTIONS (
    column_name 'textpos'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN textheight OPTIONS (
    column_name 'textheight'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN shape_area OPTIONS (
    column_name 'shape_area'
);
ALTER FOREIGN TABLE strategy.osmmanfc ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmannoline (
    objectid integer NOT NULL,
    featureid integer,
    zorder integer,
    annotationclassid integer,
    symbolid integer,
    status character varying(8),
    textstring character varying(255),
    fontname character varying(255),
    fontsize double precision,
    bold character varying(3),
    italic character varying(3),
    underline character varying(3),
    verticalalignment character varying(8),
    horizontalalignment character varying(6),
    xoffset double precision,
    yoffset double precision,
    angle double precision,
    fontleading double precision,
    wordspacing double precision,
    characterwidth double precision,
    characterspacing double precision,
    flipangle double precision,
    override integer,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(15),
    loaddate timestamp with time zone,
    shape_length double precision,
    shape public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmannoline'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN featureid OPTIONS (
    column_name 'featureid'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN zorder OPTIONS (
    column_name 'zorder'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN annotationclassid OPTIONS (
    column_name 'annotationclassid'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN symbolid OPTIONS (
    column_name 'symbolid'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN textstring OPTIONS (
    column_name 'textstring'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN fontname OPTIONS (
    column_name 'fontname'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN fontsize OPTIONS (
    column_name 'fontsize'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN bold OPTIONS (
    column_name 'bold'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN italic OPTIONS (
    column_name 'italic'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN underline OPTIONS (
    column_name 'underline'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN verticalalignment OPTIONS (
    column_name 'verticalalignment'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN horizontalalignment OPTIONS (
    column_name 'horizontalalignment'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN xoffset OPTIONS (
    column_name 'xoffset'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN yoffset OPTIONS (
    column_name 'yoffset'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN angle OPTIONS (
    column_name 'angle'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN fontleading OPTIONS (
    column_name 'fontleading'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN wordspacing OPTIONS (
    column_name 'wordspacing'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN characterwidth OPTIONS (
    column_name 'characterwidth'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN characterspacing OPTIONS (
    column_name 'characterspacing'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN flipangle OPTIONS (
    column_name 'flipangle'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN override OPTIONS (
    column_name 'override'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmannoline ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmannopoint (
    objectid integer NOT NULL,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    textangle double precision,
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(15),
    textstring character varying(250),
    textfont integer,
    textpos integer,
    height double precision,
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    font_code smallint,
    colour_code smallint,
    rotation real,
    geo_x integer,
    geo_y integer,
    anchor character varying(255),
    orig_fid integer,
    shape public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmannopoint'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN textangle OPTIONS (
    column_name 'textangle'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN textstring OPTIONS (
    column_name 'textstring'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN textfont OPTIONS (
    column_name 'textfont'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN textpos OPTIONS (
    column_name 'textpos'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN height OPTIONS (
    column_name 'height'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN font_code OPTIONS (
    column_name 'font_code'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN colour_code OPTIONS (
    column_name 'colour_code'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN rotation OPTIONS (
    column_name 'rotation'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN geo_x OPTIONS (
    column_name 'geo_x'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN geo_y OPTIONS (
    column_name 'geo_y'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN anchor OPTIONS (
    column_name 'anchor'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN orig_fid OPTIONS (
    column_name 'orig_fid'
);
ALTER FOREIGN TABLE strategy.osmmannopoint ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmarea (
    objectid integer NOT NULL,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    calcarea double precision,
    change character varying(80),
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(20),
    broken smallint,
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    abshmin double precision,
    absh2 double precision,
    abshmax double precision,
    relh2 double precision,
    relhmax double precision,
    bha_conf integer,
    shape_length double precision,
    shape_area double precision,
    shape public.geometry(MultiPolygon,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmarea'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN calcarea OPTIONS (
    column_name 'calcarea'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN broken OPTIONS (
    column_name 'broken'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN abshmin OPTIONS (
    column_name 'abshmin'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN absh2 OPTIONS (
    column_name 'absh2'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN abshmax OPTIONS (
    column_name 'abshmax'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN relh2 OPTIONS (
    column_name 'relh2'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN relhmax OPTIONS (
    column_name 'relhmax'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN bha_conf OPTIONS (
    column_name 'bha_conf'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN shape_area OPTIONS (
    column_name 'shape_area'
);
ALTER FOREIGN TABLE strategy.osmmarea ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmareaofinterest (
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmareaofinterest'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.osmmareaofinterest_extra (
    id_0 integer NOT NULL,
    geom public.geometry(MultiPolygon,27700),
    objectid integer,
    lad21cd character varying(9),
    lad21nm character varying(36),
    bng_e integer,
    bng_n integer,
    long double precision,
    lat double precision,
    shape_leng double precision,
    shape_area double precision,
    id bigint,
    borough character varying(22),
    gss_code character varying(9),
    hectares double precision,
    nonld_area double precision,
    area double precision,
    total_unit bigint,
    total_wayl bigint,
    total_wa_1 bigint,
    total_coun bigint,
    percentage double precision,
    other_prop bigint,
    total_wa_2 bigint,
    total_buil bigint,
    total_un_1 bigint,
    total_bu_1 bigint,
    total_un_2 bigint,
    total_bu_2 bigint,
    total_un_3 bigint,
    total_bu_3 bigint,
    total_un_4 bigint,
    total_bu_4 bigint,
    total_un_5 bigint,
    exchanges bigint,
    units bigint,
    unitperexc double precision,
    inner_lond integer,
    live_units bigint,
    customers bigint,
    total_road double precision,
    total_bu_5 double precision,
    total_mdu bigint,
    total_sdu bigint,
    pia_in_pro double precision,
    pia_rfb double precision,
    landlords_ bigint,
    total_pf_m bigint,
    wayleave bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmareaofinterest_extra'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN id_0 OPTIONS (
    column_name 'id_0'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN lad21cd OPTIONS (
    column_name 'lad21cd'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN lad21nm OPTIONS (
    column_name 'lad21nm'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN bng_e OPTIONS (
    column_name 'bng_e'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN bng_n OPTIONS (
    column_name 'bng_n'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN long OPTIONS (
    column_name 'long'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN lat OPTIONS (
    column_name 'lat'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN shape_leng OPTIONS (
    column_name 'shape_leng'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN shape_area OPTIONS (
    column_name 'shape_area'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN gss_code OPTIONS (
    column_name 'gss_code'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN hectares OPTIONS (
    column_name 'hectares'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN nonld_area OPTIONS (
    column_name 'nonld_area'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN area OPTIONS (
    column_name 'area'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_unit OPTIONS (
    column_name 'total_unit'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_wayl OPTIONS (
    column_name 'total_wayl'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_wa_1 OPTIONS (
    column_name 'total_wa_1'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_coun OPTIONS (
    column_name 'total_coun'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN percentage OPTIONS (
    column_name 'percentage'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN other_prop OPTIONS (
    column_name 'other_prop'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_wa_2 OPTIONS (
    column_name 'total_wa_2'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_buil OPTIONS (
    column_name 'total_buil'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_un_1 OPTIONS (
    column_name 'total_un_1'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_bu_1 OPTIONS (
    column_name 'total_bu_1'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_un_2 OPTIONS (
    column_name 'total_un_2'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_bu_2 OPTIONS (
    column_name 'total_bu_2'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_un_3 OPTIONS (
    column_name 'total_un_3'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_bu_3 OPTIONS (
    column_name 'total_bu_3'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_un_4 OPTIONS (
    column_name 'total_un_4'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_bu_4 OPTIONS (
    column_name 'total_bu_4'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_un_5 OPTIONS (
    column_name 'total_un_5'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN exchanges OPTIONS (
    column_name 'exchanges'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN units OPTIONS (
    column_name 'units'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN unitperexc OPTIONS (
    column_name 'unitperexc'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN inner_lond OPTIONS (
    column_name 'inner_lond'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN live_units OPTIONS (
    column_name 'live_units'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN customers OPTIONS (
    column_name 'customers'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_road OPTIONS (
    column_name 'total_road'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_bu_5 OPTIONS (
    column_name 'total_bu_5'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_mdu OPTIONS (
    column_name 'total_mdu'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_sdu OPTIONS (
    column_name 'total_sdu'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN pia_in_pro OPTIONS (
    column_name 'pia_in_pro'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN pia_rfb OPTIONS (
    column_name 'pia_rfb'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN landlords_ OPTIONS (
    column_name 'landlords_'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN total_pf_m OPTIONS (
    column_name 'total_pf_m'
);
ALTER FOREIGN TABLE strategy.osmmareaofinterest_extra ALTER COLUMN wayleave OPTIONS (
    column_name 'wayleave'
);


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

CREATE FOREIGN TABLE strategy.osmmbnd (
    objectid integer NOT NULL,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    accuracy character varying(20),
    descgroup character varying(150),
    descterm character varying(150),
    physlevel integer,
    physpres character varying(15),
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    shape_length double precision,
    shape public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmbnd'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN accuracy OPTIONS (
    column_name 'accuracy'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmbnd ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmbuildings (
    objectid integer,
    toid character varying(20),
    featcode integer,
    version integer,
    versiondate date,
    theme character varying,
    calcarea double precision,
    change character varying,
    descgroup character varying,
    descterm character varying,
    make character varying,
    physlevel integer,
    physpres character varying,
    broken integer,
    loaddate timestamp with time zone,
    style_description character varying,
    style_code double precision,
    abshmin double precision,
    absh2 double precision,
    abshmax double precision,
    relh2 double precision,
    relhmax double precision,
    bha_conf integer,
    shape_length double precision,
    shape_area double precision,
    geom public.geometry,
    data_source text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmbuildings'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN versiondate OPTIONS (
    column_name 'versiondate'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN calcarea OPTIONS (
    column_name 'calcarea'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN broken OPTIONS (
    column_name 'broken'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN abshmin OPTIONS (
    column_name 'abshmin'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN absh2 OPTIONS (
    column_name 'absh2'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN abshmax OPTIONS (
    column_name 'abshmax'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN relh2 OPTIONS (
    column_name 'relh2'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN relhmax OPTIONS (
    column_name 'relhmax'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN bha_conf OPTIONS (
    column_name 'bha_conf'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN shape_area OPTIONS (
    column_name 'shape_area'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.osmmbuildings ALTER COLUMN data_source OPTIONS (
    column_name 'data_source'
);


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

CREATE FOREIGN TABLE strategy.osmmbuildings_latest_data (
    objectid integer,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    calcarea double precision,
    change character varying(80),
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(20),
    broken smallint,
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    abshmin double precision,
    absh2 double precision,
    abshmax double precision,
    relh2 double precision,
    relhmax double precision,
    bha_conf integer,
    shape_length double precision,
    shape_area double precision,
    shape public.geometry(MultiPolygon,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmbuildings_latest_data'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN calcarea OPTIONS (
    column_name 'calcarea'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN broken OPTIONS (
    column_name 'broken'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN abshmin OPTIONS (
    column_name 'abshmin'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN absh2 OPTIONS (
    column_name 'absh2'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN abshmax OPTIONS (
    column_name 'abshmax'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN relh2 OPTIONS (
    column_name 'relh2'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN relhmax OPTIONS (
    column_name 'relhmax'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN bha_conf OPTIONS (
    column_name 'bha_conf'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN shape_area OPTIONS (
    column_name 'shape_area'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_latest_data ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmbuildings_old_data (
    id integer,
    geom public.geometry(Polygon,27700),
    featurecode integer,
    version integer,
    versiondate character varying(10),
    theme character varying[],
    calculatedareavalue double precision,
    changedate character varying[],
    reasonforchange character varying[],
    descriptivegroup character varying[],
    descriptiveterm character varying[],
    make character varying(12),
    physicallevel integer,
    fid character varying(20),
    filename character varying(17),
    themes character varying(34),
    descriptivegroups character varying(255),
    descriptiveterms character varying(255),
    stylecode integer,
    styledescription character varying(23),
    physicalpresence character varying(8),
    building_height real
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmbuildings_old_data'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN featurecode OPTIONS (
    column_name 'featurecode'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN versiondate OPTIONS (
    column_name 'versiondate'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN calculatedareavalue OPTIONS (
    column_name 'calculatedareavalue'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN changedate OPTIONS (
    column_name 'changedate'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN reasonforchange OPTIONS (
    column_name 'reasonforchange'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN descriptivegroup OPTIONS (
    column_name 'descriptivegroup'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN descriptiveterm OPTIONS (
    column_name 'descriptiveterm'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN physicallevel OPTIONS (
    column_name 'physicallevel'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN filename OPTIONS (
    column_name 'filename'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN themes OPTIONS (
    column_name 'themes'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN descriptivegroups OPTIONS (
    column_name 'descriptivegroups'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN descriptiveterms OPTIONS (
    column_name 'descriptiveterms'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN stylecode OPTIONS (
    column_name 'stylecode'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN styledescription OPTIONS (
    column_name 'styledescription'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN physicalpresence OPTIONS (
    column_name 'physicalpresence'
);
ALTER FOREIGN TABLE strategy.osmmbuildings_old_data ALTER COLUMN building_height OPTIONS (
    column_name 'building_height'
);


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

CREATE FOREIGN TABLE strategy.osmmline (
    objectid integer NOT NULL,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    accuracy character varying(15),
    heightdat double precision,
    dataccur character varying(20),
    heightgrnd double precision,
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(15),
    reftofeat character varying(20),
    lninpoly smallint,
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    shape_length double precision,
    shape public.geometry(MultiLineString,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmline'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN accuracy OPTIONS (
    column_name 'accuracy'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN heightdat OPTIONS (
    column_name 'heightdat'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN dataccur OPTIONS (
    column_name 'dataccur'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN heightgrnd OPTIONS (
    column_name 'heightgrnd'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN reftofeat OPTIONS (
    column_name 'reftofeat'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN lninpoly OPTIONS (
    column_name 'lninpoly'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN shape_length OPTIONS (
    column_name 'shape_length'
);
ALTER FOREIGN TABLE strategy.osmmline ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmpnt (
    objectid integer NOT NULL,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    accuracy character varying(20),
    heightdat double precision,
    dataccur character varying(10),
    heightgrnd double precision,
    descgroup character varying(150),
    descterm character varying(150),
    make character varying(20),
    physlevel integer,
    physpres character varying(15),
    reftofeat character varying(20),
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    shape public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmpnt'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN accuracy OPTIONS (
    column_name 'accuracy'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN heightdat OPTIONS (
    column_name 'heightdat'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN dataccur OPTIONS (
    column_name 'dataccur'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN heightgrnd OPTIONS (
    column_name 'heightgrnd'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN make OPTIONS (
    column_name 'make'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN reftofeat OPTIONS (
    column_name 'reftofeat'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmpnt ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.osmmsym (
    objectid integer NOT NULL,
    toid character varying(20),
    featcode integer,
    version integer,
    verdate timestamp with time zone,
    theme character varying(80),
    change character varying(80),
    angle double precision,
    orientation integer,
    descgroup character varying(150),
    descterm character varying(150),
    physlevel integer,
    physpres character varying(15),
    reftofeat character varying(20),
    loaddate timestamp with time zone,
    style_description character varying(255),
    style_code double precision,
    shape public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'osmmsym'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN toid OPTIONS (
    column_name 'toid'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN featcode OPTIONS (
    column_name 'featcode'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN version OPTIONS (
    column_name 'version'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN verdate OPTIONS (
    column_name 'verdate'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN theme OPTIONS (
    column_name 'theme'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN change OPTIONS (
    column_name 'change'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN angle OPTIONS (
    column_name 'angle'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN orientation OPTIONS (
    column_name 'orientation'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN descgroup OPTIONS (
    column_name 'descgroup'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN descterm OPTIONS (
    column_name 'descterm'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN physlevel OPTIONS (
    column_name 'physlevel'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN physpres OPTIONS (
    column_name 'physpres'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN reftofeat OPTIONS (
    column_name 'reftofeat'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN loaddate OPTIONS (
    column_name 'loaddate'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN style_description OPTIONS (
    column_name 'style_description'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN style_code OPTIONS (
    column_name 'style_code'
);
ALTER FOREIGN TABLE strategy.osmmsym ALTER COLUMN shape OPTIONS (
    column_name 'shape'
);


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

CREATE FOREIGN TABLE strategy.pia_type_harrow (
    sprn integer,
    uprn bigint,
    fid character varying(20),
    building_type text,
    pia_type text,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pia_type_harrow'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.pia_type_harrow ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.pia_type_havering (
    sprn integer,
    uprn bigint,
    fid character varying(20),
    building_type text,
    pia_type text,
    address text,
    postcode character varying(8),
    geom public.geometry(Point,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pia_type_havering'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN building_type OPTIONS (
    column_name 'building_type'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN pia_type OPTIONS (
    column_name 'pia_type'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.pia_type_havering ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.pole_feeds (
    drop_id bigint,
    pole_id bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_feeds'
);
ALTER FOREIGN TABLE strategy.pole_feeds ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds ALTER COLUMN pole_id OPTIONS (
    column_name 'pole_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_feeds ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_feeds ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_feeds ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);


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

CREATE FOREIGN TABLE strategy.pole_feeds_stg1 (
    drop_id bigint,
    pole_id bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_feeds_stg1'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg1 ALTER COLUMN pole_id OPTIONS (
    column_name 'pole_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.pole_feeds_stg2 (
    drop_id bigint,
    pole_id bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    geom public.geometry(Polygon,27700),
    l double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_feeds_stg2'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN pole_id OPTIONS (
    column_name 'pole_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg2 ALTER COLUMN l OPTIONS (
    column_name 'l'
);


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

CREATE FOREIGN TABLE strategy.pole_feeds_stg3 (
    drop_id bigint,
    pole_id bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_feeds_stg3'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg3 ALTER COLUMN pole_id OPTIONS (
    column_name 'pole_id'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg3 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_feeds_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint,
    pass integer,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN pass OPTIONS (
    column_name 'pass'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_pass1 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_pass1'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass1 ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_pass2 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    shortest_drop bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_pass2'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2 ALTER COLUMN shortest_drop OPTIONS (
    column_name 'shortest_drop'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_pass2_stg1'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1a (
    id integer,
    fid character varying(20),
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_pass2_stg1a'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1a ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1a ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg1a ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    geom public.geometry(Polygon,27700),
    l double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_pass2_stg2'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg2 ALTER COLUMN l OPTIONS (
    column_name 'l'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg3 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_pass2_stg3'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg3 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg3 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_pass2_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_premises (
    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,
    objectid bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_premises'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN classification_code OPTIONS (
    column_name 'classification_code'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN class_description OPTIONS (
    column_name 'class_description'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN parent_uprn OPTIONS (
    column_name 'parent_uprn'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN block OPTIONS (
    column_name 'block'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN business_name OPTIONS (
    column_name 'business_name'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN main_proprietor OPTIONS (
    column_name 'main_proprietor'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN title_no OPTIONS (
    column_name 'title_no'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN property_type OPTIONS (
    column_name 'property_type'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN cross_reference OPTIONS (
    column_name 'cross_reference'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN udprn OPTIONS (
    column_name 'udprn'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN umprn OPTIONS (
    column_name 'umprn'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN leasehold_portfolio_id OPTIONS (
    column_name 'leasehold_portfolio_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN class_type OPTIONS (
    column_name 'class_type'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN category_code OPTIONS (
    column_name 'category_code'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN wayleave_portfolio_id OPTIONS (
    column_name 'wayleave_portfolio_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN main_leaseholder OPTIONS (
    column_name 'main_leaseholder'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN leaseholder_managed OPTIONS (
    column_name 'leaseholder_managed'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_premises ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_stg1 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_stg1'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg1 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg1 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg1 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg1 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_stg2 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision,
    geom public.geometry(Polygon,27700),
    l double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_stg2'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg2 ALTER COLUMN l OPTIONS (
    column_name 'l'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_feeds_stg3 (
    drop_id bigint,
    objectid bigint,
    fid character varying(20),
    drop_geom public.geometry,
    distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_feeds_stg3'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg3 ALTER COLUMN drop_id OPTIONS (
    column_name 'drop_id'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg3 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg3 ALTER COLUMN fid OPTIONS (
    column_name 'fid'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg3 ALTER COLUMN drop_geom OPTIONS (
    column_name 'drop_geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_feeds_stg3 ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_stg1 (
    objectid bigint,
    geom public.geometry(Point,27700),
    longitude character varying(200),
    latitude character varying(200),
    "CATEGORY_NAME" character varying(200),
    "DP_IDENTIFIER" character varying(200),
    "EXCHANGE_1141_CODE" character varying(200),
    "INVENTORY_STATUS_CODE" character varying(200),
    "OBJECT_CLASS" character varying(200),
    "OBJECT_ID" character varying(200),
    "OPIS_SERIAL_NO" character varying(200),
    "PLANT_ITEM" character varying(200),
    "STRUCTURE_NAME" character varying(200),
    "TYPE_NAME" character varying(200),
    geometry_coordinates character varying(2048),
    id character varying(20),
    globalid character varying(2048),
    chamber_distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_stg1'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN longitude OPTIONS (
    column_name 'longitude'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN latitude OPTIONS (
    column_name 'latitude'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "CATEGORY_NAME" OPTIONS (
    column_name 'CATEGORY_NAME'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "DP_IDENTIFIER" OPTIONS (
    column_name 'DP_IDENTIFIER'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "EXCHANGE_1141_CODE" OPTIONS (
    column_name 'EXCHANGE_1141_CODE'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "INVENTORY_STATUS_CODE" OPTIONS (
    column_name 'INVENTORY_STATUS_CODE'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "OBJECT_CLASS" OPTIONS (
    column_name 'OBJECT_CLASS'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "OBJECT_ID" OPTIONS (
    column_name 'OBJECT_ID'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "OPIS_SERIAL_NO" OPTIONS (
    column_name 'OPIS_SERIAL_NO'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "PLANT_ITEM" OPTIONS (
    column_name 'PLANT_ITEM'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "STRUCTURE_NAME" OPTIONS (
    column_name 'STRUCTURE_NAME'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN "TYPE_NAME" OPTIONS (
    column_name 'TYPE_NAME'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN geometry_coordinates OPTIONS (
    column_name 'geometry_coordinates'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg1 ALTER COLUMN chamber_distance OPTIONS (
    column_name 'chamber_distance'
);


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

CREATE FOREIGN TABLE strategy.pole_planting_stg2 (
    objectid bigint,
    geom public.geometry(Point,27700),
    longitude character varying(200),
    latitude character varying(200),
    "CATEGORY_NAME" character varying(200),
    "DP_IDENTIFIER" character varying(200),
    "EXCHANGE_1141_CODE" character varying(200),
    "INVENTORY_STATUS_CODE" character varying(200),
    "OBJECT_CLASS" character varying(200),
    "OBJECT_ID" character varying(200),
    "OPIS_SERIAL_NO" character varying(200),
    "PLANT_ITEM" character varying(200),
    "STRUCTURE_NAME" character varying(200),
    "TYPE_NAME" character varying(200),
    geometry_coordinates character varying(2048),
    id character varying(20),
    globalid character varying(2048),
    chamber_distance double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'pole_planting_stg2'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN objectid OPTIONS (
    column_name 'objectid'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN longitude OPTIONS (
    column_name 'longitude'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN latitude OPTIONS (
    column_name 'latitude'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "CATEGORY_NAME" OPTIONS (
    column_name 'CATEGORY_NAME'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "DP_IDENTIFIER" OPTIONS (
    column_name 'DP_IDENTIFIER'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "EXCHANGE_1141_CODE" OPTIONS (
    column_name 'EXCHANGE_1141_CODE'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "INVENTORY_STATUS_CODE" OPTIONS (
    column_name 'INVENTORY_STATUS_CODE'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "OBJECT_CLASS" OPTIONS (
    column_name 'OBJECT_CLASS'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "OBJECT_ID" OPTIONS (
    column_name 'OBJECT_ID'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "OPIS_SERIAL_NO" OPTIONS (
    column_name 'OPIS_SERIAL_NO'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "PLANT_ITEM" OPTIONS (
    column_name 'PLANT_ITEM'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "STRUCTURE_NAME" OPTIONS (
    column_name 'STRUCTURE_NAME'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN "TYPE_NAME" OPTIONS (
    column_name 'TYPE_NAME'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN geometry_coordinates OPTIONS (
    column_name 'geometry_coordinates'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN globalid OPTIONS (
    column_name 'globalid'
);
ALTER FOREIGN TABLE strategy.pole_planting_stg2 ALTER COLUMN chamber_distance OPTIONS (
    column_name 'chamber_distance'
);


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

CREATE FOREIGN TABLE strategy.postcode_sectors_geom (
    id bigint NOT NULL,
    geom public.geometry(MultiPolygon,27700),
    postsect character varying(254),
    postdist character varying(254),
    postarea character varying(254),
    adminarea character varying(254),
    sortsect character varying(254)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'postcode_sectors_geom'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN postsect OPTIONS (
    column_name 'postsect'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN postdist OPTIONS (
    column_name 'postdist'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN postarea OPTIONS (
    column_name 'postarea'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN adminarea OPTIONS (
    column_name 'adminarea'
);
ALTER FOREIGN TABLE strategy.postcode_sectors_geom ALTER COLUMN sortsect OPTIONS (
    column_name 'sortsect'
);


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

CREATE FOREIGN TABLE strategy.project_boundaries (
    id integer,
    ref character varying(30),
    date_added date,
    ward_id integer,
    ward character varying(70),
    overlaparea double precision,
    geom public.geometry(MultiPolygon,27700)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_boundaries'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN ref OPTIONS (
    column_name 'ref'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN date_added OPTIONS (
    column_name 'date_added'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN ward_id OPTIONS (
    column_name 'ward_id'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN ward OPTIONS (
    column_name 'ward'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN overlaparea OPTIONS (
    column_name 'overlaparea'
);
ALTER FOREIGN TABLE strategy.project_boundaries ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.project_clusters (
    cluster_id text,
    project_id integer,
    name text,
    classification text,
    borough text,
    cluster_project_type_count bigint,
    cluster_project_count bigint,
    cluster_premise_count numeric,
    cluster_mdu_premise_count numeric,
    cluster_sdu_premise_count numeric,
    cluster_projects_not_planned bigint,
    cluster_projects_planned bigint,
    cluster_projects_released bigint,
    cluster_projects_planned_percent numeric,
    cluster_projects_released_percent numeric,
    cluster_premises_with_wayleave numeric,
    cluster_percent_premises_with_wayleave numeric,
    project_premises bigint,
    project_mdu_premises bigint,
    project_sdu_premises bigint,
    project_status_count bigint,
    project_released_premises bigint,
    project_released_percent numeric,
    project_status_check text,
    project_status smallint,
    project_percent_at_status numeric,
    portfolio_id integer,
    portfolio_name character varying,
    project_premises_with_wayleave numeric,
    project_wayleave_percent numeric,
    min_dist_to_live double precision,
    avg_dist_to_live double precision,
    max_dist_to_live double precision,
    cab_status integer,
    cab_live_date date,
    min_dist_to_cab double precision,
    avg_dist_to_cab double precision,
    max_dist_to_cab double precision,
    priority text,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN classification OPTIONS (
    column_name 'classification'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_project_type_count OPTIONS (
    column_name 'cluster_project_type_count'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_project_count OPTIONS (
    column_name 'cluster_project_count'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_mdu_premise_count OPTIONS (
    column_name 'cluster_mdu_premise_count'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_sdu_premise_count OPTIONS (
    column_name 'cluster_sdu_premise_count'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_projects_not_planned OPTIONS (
    column_name 'cluster_projects_not_planned'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_projects_planned OPTIONS (
    column_name 'cluster_projects_planned'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_projects_released OPTIONS (
    column_name 'cluster_projects_released'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_projects_planned_percent OPTIONS (
    column_name 'cluster_projects_planned_percent'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_projects_released_percent OPTIONS (
    column_name 'cluster_projects_released_percent'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_premises_with_wayleave OPTIONS (
    column_name 'cluster_premises_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cluster_percent_premises_with_wayleave OPTIONS (
    column_name 'cluster_percent_premises_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_premises OPTIONS (
    column_name 'project_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_mdu_premises OPTIONS (
    column_name 'project_mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_sdu_premises OPTIONS (
    column_name 'project_sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_status_count OPTIONS (
    column_name 'project_status_count'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_released_premises OPTIONS (
    column_name 'project_released_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_released_percent OPTIONS (
    column_name 'project_released_percent'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_status_check OPTIONS (
    column_name 'project_status_check'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_status OPTIONS (
    column_name 'project_status'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_percent_at_status OPTIONS (
    column_name 'project_percent_at_status'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN portfolio_name OPTIONS (
    column_name 'portfolio_name'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_premises_with_wayleave OPTIONS (
    column_name 'project_premises_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN project_wayleave_percent OPTIONS (
    column_name 'project_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN min_dist_to_live OPTIONS (
    column_name 'min_dist_to_live'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN avg_dist_to_live OPTIONS (
    column_name 'avg_dist_to_live'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN max_dist_to_live OPTIONS (
    column_name 'max_dist_to_live'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN cab_live_date OPTIONS (
    column_name 'cab_live_date'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN min_dist_to_cab OPTIONS (
    column_name 'min_dist_to_cab'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN avg_dist_to_cab OPTIONS (
    column_name 'avg_dist_to_cab'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN max_dist_to_cab OPTIONS (
    column_name 'max_dist_to_cab'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN priority OPTIONS (
    column_name 'priority'
);
ALTER FOREIGN TABLE strategy.project_clusters ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.project_clusters_stg0 (
    project_id integer,
    project_chunk text,
    project_premises bigint,
    mdu_premises bigint,
    sdu_premises bigint,
    released_premises bigint,
    released_percent numeric,
    project_status_count bigint,
    geom public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters_stg0'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN project_chunk OPTIONS (
    column_name 'project_chunk'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN project_premises OPTIONS (
    column_name 'project_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN released_percent OPTIONS (
    column_name 'released_percent'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN project_status_count OPTIONS (
    column_name 'project_status_count'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg0 ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.project_clusters_stg1 (
    project_id integer,
    borough text,
    premises bigint,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters_stg1'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg1 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg1 ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg1 ALTER COLUMN premises OPTIONS (
    column_name 'premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg1 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.project_clusters_stg2 (
    project_id integer,
    status smallint,
    premises bigint,
    project_premises numeric,
    status_percent numeric,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters_stg2'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg2 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg2 ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg2 ALTER COLUMN premises OPTIONS (
    column_name 'premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg2 ALTER COLUMN project_premises OPTIONS (
    column_name 'project_premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg2 ALTER COLUMN status_percent OPTIONS (
    column_name 'status_percent'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg2 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.project_clusters_stg3 (
    project_id integer,
    wayleave_date date,
    portfolio_id integer,
    portfolio_name character varying,
    premises bigint,
    premises_with_wayleave bigint,
    project_premises_with_wayleave numeric,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters_stg3'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN portfolio_name OPTIONS (
    column_name 'portfolio_name'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN premises OPTIONS (
    column_name 'premises'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN premises_with_wayleave OPTIONS (
    column_name 'premises_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN project_premises_with_wayleave OPTIONS (
    column_name 'project_premises_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg3 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.project_clusters_stg4 (
    project_id integer,
    min_dist_to_live double precision,
    avg_dist_to_live double precision,
    max_dist_to_live double precision
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters_stg4'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg4 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg4 ALTER COLUMN min_dist_to_live OPTIONS (
    column_name 'min_dist_to_live'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg4 ALTER COLUMN avg_dist_to_live OPTIONS (
    column_name 'avg_dist_to_live'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg4 ALTER COLUMN max_dist_to_live OPTIONS (
    column_name 'max_dist_to_live'
);


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

CREATE FOREIGN TABLE strategy.project_clusters_stg5 (
    project_id integer,
    closestcab_id integer,
    closestcab_name character varying,
    closestcab_type text,
    cab_status integer,
    cab_live_date date,
    min_dist_to_cab double precision,
    avg_dist_to_cab double precision,
    max_dist_to_cab double precision,
    r bigint
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_clusters_stg5'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN closestcab_id OPTIONS (
    column_name 'closestcab_id'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN closestcab_name OPTIONS (
    column_name 'closestcab_name'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN closestcab_type OPTIONS (
    column_name 'closestcab_type'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN cab_status OPTIONS (
    column_name 'cab_status'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN cab_live_date OPTIONS (
    column_name 'cab_live_date'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN min_dist_to_cab OPTIONS (
    column_name 'min_dist_to_cab'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN avg_dist_to_cab OPTIONS (
    column_name 'avg_dist_to_cab'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN max_dist_to_cab OPTIONS (
    column_name 'max_dist_to_cab'
);
ALTER FOREIGN TABLE strategy.project_clusters_stg5 ALTER COLUMN r OPTIONS (
    column_name 'r'
);


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

CREATE FOREIGN TABLE strategy.project_costing (
    cluster_id integer,
    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_l_premises bigint,
    pia_ug_c_premises bigint,
    civils_premises bigint,
    pia_oh_mdu_premises bigint,
    pia_oh_sdu_premises bigint,
    pia_ug_l_mdu_premises bigint,
    pia_ug_l_sdu_premises bigint,
    pia_ug_c_mdu_premises bigint,
    pia_ug_c_sdu_premises bigint,
    civils_mdu_premises bigint,
    civils_sdu_premises bigint,
    in_project_premises bigint,
    released_premises bigint,
    cab_name character varying,
    total_distance numeric,
    cluster_capex_budget bigint,
    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,
    costing_datetime timestamp with time zone
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_costing'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.project_costing ALTER COLUMN costing_datetime OPTIONS (
    column_name 'costing_datetime'
);


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

CREATE FOREIGN TABLE strategy.project_costing_access_routes (
    cluster_id integer,
    edge_count bigint,
    distance double precision,
    geom public.geometry,
    costing_datetime timestamp with time zone
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_costing_access_routes'
);
ALTER FOREIGN TABLE strategy.project_costing_access_routes ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.project_costing_access_routes ALTER COLUMN edge_count OPTIONS (
    column_name 'edge_count'
);
ALTER FOREIGN TABLE strategy.project_costing_access_routes ALTER COLUMN distance OPTIONS (
    column_name 'distance'
);
ALTER FOREIGN TABLE strategy.project_costing_access_routes ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.project_costing_access_routes ALTER COLUMN costing_datetime OPTIONS (
    column_name 'costing_datetime'
);


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

CREATE FOREIGN TABLE strategy.project_costing_core_routes (
    core_route_id bigint,
    cluster_id integer,
    cab_name character varying,
    core_route_distance double precision,
    geom public.geometry,
    route_rank bigint,
    costing_datetime timestamp with time zone
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_costing_core_routes'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN core_route_id OPTIONS (
    column_name 'core_route_id'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN core_route_distance OPTIONS (
    column_name 'core_route_distance'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN route_rank OPTIONS (
    column_name 'route_rank'
);
ALTER FOREIGN TABLE strategy.project_costing_core_routes ALTER COLUMN costing_datetime OPTIONS (
    column_name 'costing_datetime'
);


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

CREATE FOREIGN TABLE strategy.project_premise_count_summary (
    project_id integer,
    name text,
    classification text,
    project_premises bigint,
    mdu_premises bigint,
    sdu_premises bigint,
    released_premises bigint,
    released_percent numeric,
    project_status_count bigint,
    status smallint,
    status_percent numeric,
    wayleave_date date,
    project_premises_with_wayleave numeric,
    portfolio_id integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'project_premise_count_summary'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN name OPTIONS (
    column_name 'name'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN classification OPTIONS (
    column_name 'classification'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN project_premises OPTIONS (
    column_name 'project_premises'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN released_percent OPTIONS (
    column_name 'released_percent'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN project_status_count OPTIONS (
    column_name 'project_status_count'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN status_percent OPTIONS (
    column_name 'status_percent'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN project_premises_with_wayleave OPTIONS (
    column_name 'project_premises_with_wayleave'
);
ALTER FOREIGN TABLE strategy.project_premise_count_summary ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);


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

CREATE FOREIGN TABLE strategy.pt_build_plan (
    plan_type text,
    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 'pt_build_plan'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN plan_type OPTIONS (
    column_name 'plan_type'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN hp_date OPTIONS (
    column_name 'hp_date'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN door_number OPTIONS (
    column_name 'door_number'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN block OPTIONS (
    column_name 'block'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN business_name OPTIONS (
    column_name 'business_name'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN main_proprietor OPTIONS (
    column_name 'main_proprietor'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN last_status_update OPTIONS (
    column_name 'last_status_update'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN comment OPTIONS (
    column_name 'comment'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN date_added OPTIONS (
    column_name 'date_added'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN business_live OPTIONS (
    column_name 'business_live'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN splitter_id OPTIONS (
    column_name 'splitter_id'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN sales_status OPTIONS (
    column_name 'sales_status'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN declared_live_date OPTIONS (
    column_name 'declared_live_date'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN install_type OPTIONS (
    column_name 'install_type'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN planning_ecd OPTIONS (
    column_name 'planning_ecd'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN civils_done OPTIONS (
    column_name 'civils_done'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN cabled OPTIONS (
    column_name 'cabled'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN spliced OPTIONS (
    column_name 'spliced'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN tested OPTIONS (
    column_name 'tested'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN on_hold OPTIONS (
    column_name 'on_hold'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN on_hold_category OPTIONS (
    column_name 'on_hold_category'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN on_hold_subcategory OPTIONS (
    column_name 'on_hold_subcategory'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN on_hold_start OPTIONS (
    column_name 'on_hold_start'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN on_hold_revisit OPTIONS (
    column_name 'on_hold_revisit'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN on_hold_stop OPTIONS (
    column_name 'on_hold_stop'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN last_updater OPTIONS (
    column_name 'last_updater'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN last_update_timestamp OPTIONS (
    column_name 'last_update_timestamp'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN forecast_live_date OPTIONS (
    column_name 'forecast_live_date'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN main_leaseholder OPTIONS (
    column_name 'main_leaseholder'
);
ALTER FOREIGN TABLE strategy.pt_build_plan ALTER COLUMN leaseholder_managed OPTIONS (
    column_name 'leaseholder_managed'
);


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

CREATE FOREIGN TABLE strategy.pt_sdu_build (
    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 'pt_sdu_build'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN hp_date OPTIONS (
    column_name 'hp_date'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN uprn OPTIONS (
    column_name 'uprn'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN door_number OPTIONS (
    column_name 'door_number'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN postcode OPTIONS (
    column_name 'postcode'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN type OPTIONS (
    column_name 'type'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN block OPTIONS (
    column_name 'block'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN address OPTIONS (
    column_name 'address'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN status OPTIONS (
    column_name 'status'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN business_name OPTIONS (
    column_name 'business_name'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN main_proprietor OPTIONS (
    column_name 'main_proprietor'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN last_status_update OPTIONS (
    column_name 'last_status_update'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN comment OPTIONS (
    column_name 'comment'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN date_added OPTIONS (
    column_name 'date_added'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN portfolio_id OPTIONS (
    column_name 'portfolio_id'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN business_live OPTIONS (
    column_name 'business_live'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN bd_status OPTIONS (
    column_name 'bd_status'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN sprn OPTIONS (
    column_name 'sprn'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN splitter_id OPTIONS (
    column_name 'splitter_id'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN sales_status OPTIONS (
    column_name 'sales_status'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN declared_live_date OPTIONS (
    column_name 'declared_live_date'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN install_type OPTIONS (
    column_name 'install_type'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN planning_ecd OPTIONS (
    column_name 'planning_ecd'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN civils_done OPTIONS (
    column_name 'civils_done'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN cabled OPTIONS (
    column_name 'cabled'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN spliced OPTIONS (
    column_name 'spliced'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN tested OPTIONS (
    column_name 'tested'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN on_hold OPTIONS (
    column_name 'on_hold'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN on_hold_category OPTIONS (
    column_name 'on_hold_category'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN on_hold_subcategory OPTIONS (
    column_name 'on_hold_subcategory'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN on_hold_start OPTIONS (
    column_name 'on_hold_start'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN on_hold_revisit OPTIONS (
    column_name 'on_hold_revisit'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN on_hold_stop OPTIONS (
    column_name 'on_hold_stop'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN last_updater OPTIONS (
    column_name 'last_updater'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN last_update_timestamp OPTIONS (
    column_name 'last_update_timestamp'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN mdu_id OPTIONS (
    column_name 'mdu_id'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN forecast_live_date OPTIONS (
    column_name 'forecast_live_date'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN wayleave_date OPTIONS (
    column_name 'wayleave_date'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN main_leaseholder OPTIONS (
    column_name 'main_leaseholder'
);
ALTER FOREIGN TABLE strategy.pt_sdu_build ALTER COLUMN leaseholder_managed OPTIONS (
    column_name 'leaseholder_managed'
);


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

CREATE FOREIGN TABLE strategy.ref_dates (
    id integer NOT NULL,
    date date,
    year integer,
    month integer,
    day integer,
    monthname character varying(3),
    quarter character varying(2)
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'ref_dates'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN date OPTIONS (
    column_name 'date'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN year OPTIONS (
    column_name 'year'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN month OPTIONS (
    column_name 'month'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN day OPTIONS (
    column_name 'day'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN monthname OPTIONS (
    column_name 'monthname'
);
ALTER FOREIGN TABLE strategy.ref_dates ALTER COLUMN quarter OPTIONS (
    column_name 'quarter'
);


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

CREATE FOREIGN TABLE strategy.sdu_clusters (
    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 'sdu_clusters'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_l_premises OPTIONS (
    column_name 'pia_ug_l_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_c_premises OPTIONS (
    column_name 'pia_ug_c_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_l_mdu_premises OPTIONS (
    column_name 'pia_ug_l_mdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_l_sdu_premises OPTIONS (
    column_name 'pia_ug_l_sdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_c_mdu_premises OPTIONS (
    column_name 'pia_ug_c_mdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_c_sdu_premises OPTIONS (
    column_name 'pia_ug_c_sdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.sdu_clusters ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


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

CREATE FOREIGN TABLE strategy.sdu_plan (
    project_id integer
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'sdu_plan'
);
ALTER FOREIGN TABLE strategy.sdu_plan ALTER COLUMN project_id OPTIONS (
    column_name 'project_id'
);


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

CREATE FOREIGN TABLE strategy.strategic_boroughs (
    borough character varying(80),
    ward_count bigint,
    geom public.geometry,
    cfl_interest integer,
    cfl_interest_type text,
    region text
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_boroughs'
);
ALTER FOREIGN TABLE strategy.strategic_boroughs ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_boroughs ALTER COLUMN ward_count OPTIONS (
    column_name 'ward_count'
);
ALTER FOREIGN TABLE strategy.strategic_boroughs ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_boroughs ALTER COLUMN cfl_interest OPTIONS (
    column_name 'cfl_interest'
);
ALTER FOREIGN TABLE strategy.strategic_boroughs ALTER COLUMN cfl_interest_type OPTIONS (
    column_name 'cfl_interest_type'
);
ALTER FOREIGN TABLE strategy.strategic_boroughs ALTER COLUMN region OPTIONS (
    column_name 'region'
);


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

CREATE FOREIGN TABLE strategy.strategic_clusters_hld_intersect (
    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_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,
    geom_intersection public.geometry
)
SERVER geo_db
OPTIONS (
    schema_name 'strategy',
    table_name 'strategic_clusters_hld_intersect'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN borough OPTIONS (
    column_name 'borough'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN cluster_premise_count OPTIONS (
    column_name 'cluster_premise_count'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN pia_oh_percent OPTIONS (
    column_name 'pia_oh_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_hld_intersect ALTER COLUMN geom_intersection OPTIONS (
    column_name 'geom_intersection'
);


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

CREATE FOREIGN TABLE strategy.strategic_clusters_output_cluster (
    id integer NOT NULL,
    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'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN id OPTIONS (
    column_name 'id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cluster_run_id OPTIONS (
    column_name 'cluster_run_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cluster_run_datetime OPTIONS (
    column_name 'cluster_run_datetime'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cluster_id OPTIONS (
    column_name 'cluster_id'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN total_premises OPTIONS (
    column_name 'total_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_premises OPTIONS (
    column_name 'mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_with_wayleave OPTIONS (
    column_name 'mdu_with_wayleave'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_with_wayleave_t50 OPTIONS (
    column_name 'mdu_with_wayleave_t50'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_with_wayleave_other OPTIONS (
    column_name 'mdu_with_wayleave_other'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN sdu_premises OPTIONS (
    column_name 'sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_buildings OPTIONS (
    column_name 'mdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN sdu_buildings OPTIONS (
    column_name 'sdu_buildings'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_oh_premises OPTIONS (
    column_name 'pia_oh_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_ug_premises OPTIONS (
    column_name 'pia_ug_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN civils_premises OPTIONS (
    column_name 'civils_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_oh_mdu_premises OPTIONS (
    column_name 'pia_oh_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_oh_sdu_premises OPTIONS (
    column_name 'pia_oh_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_ug_mdu_premises OPTIONS (
    column_name 'pia_ug_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_ug_sdu_premises OPTIONS (
    column_name 'pia_ug_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN civils_mdu_premises OPTIONS (
    column_name 'civils_mdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN civils_sdu_premises OPTIONS (
    column_name 'civils_sdu_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN in_project_premises OPTIONS (
    column_name 'in_project_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN released_premises OPTIONS (
    column_name 'released_premises'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cab_name OPTIONS (
    column_name 'cab_name'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pole_distance OPTIONS (
    column_name 'pole_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN duct_distance OPTIONS (
    column_name 'duct_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN civils_distance OPTIONS (
    column_name 'civils_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN total_distance OPTIONS (
    column_name 'total_distance'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cluster_capex_budget OPTIONS (
    column_name 'cluster_capex_budget'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_low_capex OPTIONS (
    column_name 'mdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN sdu_low_capex OPTIONS (
    column_name 'sdu_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN capacity_low_capex OPTIONS (
    column_name 'capacity_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN civils_low_capex OPTIONS (
    column_name 'civils_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_ug_low_capex OPTIONS (
    column_name 'pia_ug_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_oh_low_capex OPTIONS (
    column_name 'pia_oh_low_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_high_capex OPTIONS (
    column_name 'mdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN sdu_high_capex OPTIONS (
    column_name 'sdu_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN capacity_high_capex OPTIONS (
    column_name 'capacity_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN civils_high_capex OPTIONS (
    column_name 'civils_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_ug_high_capex OPTIONS (
    column_name 'pia_ug_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN pia_oh_high_capex OPTIONS (
    column_name 'pia_oh_high_capex'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN mdu_wayleave_percent OPTIONS (
    column_name 'mdu_wayleave_percent'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN capex_low OPTIONS (
    column_name 'capex_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cppp_low OPTIONS (
    column_name 'cppp_low'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN capex_high OPTIONS (
    column_name 'capex_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN cppp_high OPTIONS (
    column_name 'cppp_high'
);
ALTER FOREIGN TABLE strategy.strategic_clusters_output_cluster ALTER COLUMN geom OPTIONS (
    column_name 'geom'
);


--
