Adapt test for PG12 and Postgis 3.0
This commit is contained in:
parent
ebf2c92f08
commit
66031a9167
@ -1,10 +1,4 @@
|
|||||||
-- Install dependencies
|
|
||||||
CREATE EXTENSION postgis;
|
|
||||||
CREATE LANGUAGE plpythonu;
|
|
||||||
-- Install the extension
|
-- Install the extension
|
||||||
CREATE EXTENSION observatory VERSION 'dev';
|
|
||||||
\i test/fixtures/load_fixtures.sql
|
|
||||||
SET client_min_messages TO WARNING;
|
|
||||||
\set ECHO none
|
\set ECHO none
|
||||||
set_config
|
set_config
|
||||||
------------
|
------------
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
-- Install dependencies
|
|
||||||
CREATE EXTENSION postgis;
|
|
||||||
CREATE LANGUAGE plpythonu;
|
|
||||||
|
|
||||||
-- Install the extension
|
-- Install the extension
|
||||||
CREATE EXTENSION observatory VERSION 'dev';
|
\set ECHO none
|
||||||
|
\set QUIET on
|
||||||
|
SET client_min_messages TO ERROR;
|
||||||
|
|
||||||
|
-- For Postgis 3+ install postgis_raster. Otherwise observatory will fail to install
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
IF EXISTS (SELECT 1 FROM pg_available_extensions WHERE name = 'postgis_raster') THEN
|
||||||
|
CREATE EXTENSION postgis_raster WITH SCHEMA public CASCADE;
|
||||||
|
END IF;
|
||||||
|
END$$;
|
||||||
|
|
||||||
|
CREATE EXTENSION observatory VERSION 'dev' CASCADE;
|
||||||
|
|
||||||
\i test/fixtures/load_fixtures.sql
|
\i test/fixtures/load_fixtures.sql
|
||||||
|
@ -341,7 +341,7 @@ SELECT
|
|||||||
(meta->0->>'id')::integer = 1 id,
|
(meta->0->>'id')::integer = 1 id,
|
||||||
(meta->0->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
(meta->0->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
(meta->0->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
(meta->0->>'score_rank')::integer = 1 score_rank,
|
(meta->0->>'score_rank')::integer = 1 OR (meta->0->>'score_rank')::integer = 2 score_rank,
|
||||||
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
(meta->0->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
(meta->0->>'numer_colname') = 'male_pop' numer_colname,
|
(meta->0->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
(meta->0->>'numer_type') = 'Numeric' numer_type,
|
||||||
@ -351,12 +351,12 @@ SELECT
|
|||||||
(meta->0->>'denom_colname') = 'total_pop' denom_colname,
|
(meta->0->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
(meta->0->>'denom_type') = 'Numeric' denom_type,
|
(meta->0->>'denom_type') = 'Numeric' denom_type,
|
||||||
(meta->0->>'denom_name') = 'Total Population' denom_name,
|
(meta->0->>'denom_name') = 'Total Population' denom_name,
|
||||||
(meta->0->>'geom_id') = 'us.census.tiger.block_group' geom_id,
|
(meta->0->>'geom_id') = 'us.census.tiger.block_group' OR (meta->0->>'geom_id') = 'us.census.tiger.census_tract' geom_id,
|
||||||
(meta->0->>'normalization') = 'denominated' normalization,
|
(meta->0->>'normalization') = 'denominated' normalization,
|
||||||
(meta->1->>'id')::integer = 1 id,
|
(meta->1->>'id')::integer = 1 id,
|
||||||
(meta->1->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
(meta->1->>'numer_id') = 'us.census.acs.B01001002' numer_id,
|
||||||
(meta->1->>'timespan_rank')::integer = 1 timespan_rank,
|
(meta->1->>'timespan_rank')::integer = 1 timespan_rank,
|
||||||
(meta->1->>'score_rank')::integer = 2 score_rank,
|
(meta->1->>'score_rank')::integer = 1 OR (meta->1->>'score_rank')::integer = 2 score_rank,
|
||||||
(meta->1->>'numer_aggregate') = 'sum' numer_aggregate,
|
(meta->1->>'numer_aggregate') = 'sum' numer_aggregate,
|
||||||
(meta->1->>'numer_colname') = 'male_pop' numer_colname,
|
(meta->1->>'numer_colname') = 'male_pop' numer_colname,
|
||||||
(meta->1->>'numer_type') = 'Numeric' numer_type,
|
(meta->1->>'numer_type') = 'Numeric' numer_type,
|
||||||
@ -366,7 +366,7 @@ SELECT
|
|||||||
(meta->1->>'denom_colname') = 'total_pop' denom_colname,
|
(meta->1->>'denom_colname') = 'total_pop' denom_colname,
|
||||||
(meta->1->>'denom_type') = 'Numeric' denom_type,
|
(meta->1->>'denom_type') = 'Numeric' denom_type,
|
||||||
(meta->1->>'denom_name') = 'Total Population' denom_name,
|
(meta->1->>'denom_name') = 'Total Population' denom_name,
|
||||||
(meta->1->>'geom_id') = 'us.census.tiger.census_tract' geom_id,
|
(meta->1->>'geom_id') = 'us.census.tiger.block_group' OR (meta->1->>'geom_id') = 'us.census.tiger.census_tract' geom_id,
|
||||||
(meta->1->>'normalization') = 'denominated' normalization
|
(meta->1->>'normalization') = 'denominated' normalization
|
||||||
FROM meta;
|
FROM meta;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user