Merge branch 'release-v-0.0.6' into fix-geom_geoid_colname

This commit is contained in:
John Krauss 2016-06-27 12:39:09 -04:00
commit cf7c115a76
7 changed files with 10137 additions and 8794 deletions

View File

@ -33,7 +33,8 @@ def select_star(tablename):
cdb = Dumpr('observatory.cartodb.com','') cdb = Dumpr('observatory.cartodb.com','')
metadata = ['obs_table', 'obs_column_table', 'obs_column', 'obs_column_tag', 'obs_tag', 'obs_column_to_column'] metadata = ['obs_table', 'obs_column_table', 'obs_column', 'obs_column_tag',
'obs_tag', 'obs_column_to_column', 'obs_dump_version']
fixtures = [ fixtures = [
('us.census.tiger.census_tract', 'us.census.tiger.census_tract', '2014'), ('us.census.tiger.census_tract', 'us.census.tiger.census_tract', '2014'),

View File

@ -199,3 +199,20 @@ BEGIN
RETURN result; RETURN result;
END; END;
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
-- Function that returns the currently deployed obs_dump_version from the
-- remote table of the same name.
CREATE OR REPLACE FUNCTION cdb_observatory.OBS_DumpVersion(
)
RETURNS TEXT
AS $$
DECLARE
result text;
BEGIN
EXECUTE '
SELECT MAX(dump_id) FROM observatory.obs_dump_version
' INTO result;
RETURN result;
END;
$$ LANGUAGE plpgsql;

View File

@ -114,7 +114,7 @@ BEGIN
AND AND
observatory.OBS_column.type = 'Geometry' observatory.OBS_column.type = 'Geometry'
AND AND
$1 && bounds::box2d ST_Intersects($1, observatory.obs_table.the_geom)
$string$ || timespan_query $string$ || timespan_query
USING geom; USING geom;
RETURN; RETURN;

View File

@ -27,3 +27,6 @@ t
_obs_standardizemeasurename_test _obs_standardizemeasurename_test
t t
(1 row) (1 row)
obs_dumpversion_notnull
t
(1 row)

View File

@ -6,6 +6,7 @@ DROP TABLE IF EXISTS observatory.obs_column;
DROP TABLE IF EXISTS observatory.obs_column_tag; DROP TABLE IF EXISTS observatory.obs_column_tag;
DROP TABLE IF EXISTS observatory.obs_tag; DROP TABLE IF EXISTS observatory.obs_tag;
DROP TABLE IF EXISTS observatory.obs_column_to_column; DROP TABLE IF EXISTS observatory.obs_column_to_column;
DROP TABLE IF EXISTS observatory.obs_dump_version;
DROP TABLE IF EXISTS observatory.obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d; DROP TABLE IF EXISTS observatory.obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d;
DROP TABLE IF EXISTS observatory.obs_1746e37b7cd28cb131971ea4187d42d71f09c5f3; DROP TABLE IF EXISTS observatory.obs_1746e37b7cd28cb131971ea4187d42d71f09c5f3;
DROP TABLE IF EXISTS observatory.obs_1a098da56badf5f32e336002b0a81708c40d29cd; DROP TABLE IF EXISTS observatory.obs_1a098da56badf5f32e336002b0a81708c40d29cd;

File diff suppressed because one or more lines are too long

View File

@ -75,4 +75,7 @@ SELECT cdb_observatory._OBS_GetRelatedColumn(
-- should give back a standardized measure name -- should give back a standardized measure name
SELECT cdb_observatory._OBS_StandardizeMeasureName('test 343 %% 2 qqq }}{{}}') = 'test_343_2_qqq' As _OBS_StandardizeMeasureName_test; SELECT cdb_observatory._OBS_StandardizeMeasureName('test 343 %% 2 qqq }}{{}}') = 'test_343_2_qqq' As _OBS_StandardizeMeasureName_test;
SELECT cdb_observatory.OBS_DumpVersion()
IS NOT NULL AS OBS_DumpVersion_notnull;
\i test/fixtures/drop_fixtures.sql \i test/fixtures/drop_fixtures.sql