From f9e262b2103100f7a6b63a0241a9fdf1f42f8e8c Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Tue, 12 Apr 2016 16:10:01 -0400 Subject: [PATCH] updated to create tables to specif schema --- src/pg/test/fixtures/obs_column.sql | 26 +++----------------- src/pg/test/fixtures/obs_column_table.sql | 30 +++-------------------- src/pg/test/fixtures/obs_table.sql | 26 +++----------------- 3 files changed, 9 insertions(+), 73 deletions(-) diff --git a/src/pg/test/fixtures/obs_column.sql b/src/pg/test/fixtures/obs_column.sql index 8d9e1cc..412fe3b 100644 --- a/src/pg/test/fixtures/obs_column.sql +++ b/src/pg/test/fixtures/obs_column.sql @@ -2,18 +2,7 @@ -- PostgreSQL database dump -- -SET statement_timeout = 0; -SET lock_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SET check_function_bodies = false; -SET client_min_messages = warning; - -SET search_path = observatory, pg_catalog; - --- --- Data for Name: obs_column; Type: TABLE DATA; Schema: observatory; Owner: cartodb_user_d377e55d-4326-4faf-97c7-503535e81667 --- +CREATE TABLE obs_column (cartodb_id bigint, the_geom geometry, the_geom_webmercator geometry, id text, type text, name text, description text, weight numeric, aggregate text, version text, extra json); INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (594, NULL, NULL, '"us.census.tiger".geom', 'Geometry', NULL, NULL, 0, NULL, '0', NULL); INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (796, NULL, NULL, '"us.ny.nyc.opendata".crfn', 'Text', 'City Reel File Number', NULL, 0, NULL, '3', NULL); @@ -968,14 +957,5 @@ INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, na INSERT INTO obs_column (cartodb_id, the_geom, the_geom_webmercator, id, type, name, description, weight, aggregate, version, extra) VALUES (933, NULL, NULL, '"us.census.acs"."us.census.acs".B19001017_quantile', 'Numeric', 'Quantile:Households with income of $200,000 Or More', 'The number of households in a geographic area whose annual income was more than $200,000.', 0, 'quantile', '0', NULL); --- --- Name: obs_column_cartodb_id_seq; Type: SEQUENCE SET; Schema: observatory; Owner: cartodb_user_d377e55d-4326-4faf-97c7-503535e81667 --- - -SELECT pg_catalog.setval('obs_column_cartodb_id_seq', 933, true); - - --- --- PostgreSQL database dump complete --- - +CREATE SCHEMA IF NOT EXISTS observatory; +ALTER TABLE obs_column SET SCHEMA observatory; diff --git a/src/pg/test/fixtures/obs_column_table.sql b/src/pg/test/fixtures/obs_column_table.sql index e8382c7..6b29eae 100644 --- a/src/pg/test/fixtures/obs_column_table.sql +++ b/src/pg/test/fixtures/obs_column_table.sql @@ -1,19 +1,5 @@ --- --- PostgreSQL database dump --- -SET statement_timeout = 0; -SET lock_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SET check_function_bodies = false; -SET client_min_messages = warning; - -SET search_path = observatory, pg_catalog; - --- --- Data for Name: obs_column_table; Type: TABLE DATA; Schema: observatory; Owner: cartodb_user_d377e55d-4326-4faf-97c7-503535e81667 --- +CREATE TABLE obs_column_table(cartodb_id bigint, the_geom geometry, the_geom_webmercator geometry, column_id text, table_id text, colname text, extra json); INSERT INTO obs_column_table (cartodb_id, the_geom, the_geom_webmercator, column_id, table_id, colname, extra) VALUES (2, NULL, NULL, '"us.bls".own_code', '"us.bls".raw_qcew_2013_dd20d99063', 'own_code', NULL); INSERT INTO obs_column_table (cartodb_id, the_geom, the_geom_webmercator, column_id, table_id, colname, extra) VALUES (463, NULL, NULL, '"us.ny.nyc.opendata".lot', '"us.ny.nyc.opendata".acris_legals_99914b932b', 'lot', NULL); @@ -1472,15 +1458,5 @@ INSERT INTO obs_column_table (cartodb_id, the_geom, the_geom_webmercator, column INSERT INTO obs_column_table (cartodb_id, the_geom, the_geom_webmercator, column_id, table_id, colname, extra) VALUES (1928, NULL, NULL, '"us.census.acs"."us.census.acs".B19001016_quantile', '"us.census.acs".quantiles_block_group_5yr_2013_69b156927c', 'income_150000_199999_quantile', NULL); INSERT INTO obs_column_table (cartodb_id, the_geom, the_geom_webmercator, column_id, table_id, colname, extra) VALUES (1929, NULL, NULL, '"us.census.acs"."us.census.acs".B19001017_quantile', '"us.census.acs".quantiles_block_group_5yr_2013_69b156927c', 'income_200000_or_more_quantile', NULL); - --- --- Name: obs_column_table_cartodb_id_seq; Type: SEQUENCE SET; Schema: observatory; Owner: cartodb_user_d377e55d-4326-4faf-97c7-503535e81667 --- - -SELECT pg_catalog.setval('obs_column_table_cartodb_id_seq', 1929, true); - - --- --- PostgreSQL database dump complete --- - +CREATE SCHEMA IF NOT EXISTS observatory; +ALTER TABLE obs_column_table SET SCHEMA observatory; diff --git a/src/pg/test/fixtures/obs_table.sql b/src/pg/test/fixtures/obs_table.sql index 8b98561..20bbd2b 100644 --- a/src/pg/test/fixtures/obs_table.sql +++ b/src/pg/test/fixtures/obs_table.sql @@ -2,18 +2,7 @@ -- PostgreSQL database dump -- -SET statement_timeout = 0; -SET lock_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SET check_function_bodies = false; -SET client_min_messages = warning; - -SET search_path = observatory, pg_catalog; - --- --- Data for Name: obs_table; Type: TABLE DATA; Schema: observatory; Owner: cartodb_user_d377e55d-4326-4faf-97c7-503535e81667 --- +CREATE TABLE obs_table(cartodb_id bigint, the_geom geometry, the_geom_webmercator geometry, id text, tablename text, timespan text, bounds text, description text, version text); INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (1, NULL, NULL, '"us.census.spielman_singleton_segments".spielman_singleton_table_99914b932b', 'obs_65f29658e096ca1485bf683f65fdbc9f05ec3c5d', '2009 - 2013', 'BOX(0 0,0 0)', NULL, '5'); INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (2, NULL, NULL, '"us.census.acs".extract_block_group_5yr_2013_69b156927c', 'obs_3e7cc9cfd403b912c57b42d5f9195af9ce2f3cdb', '2009 - 2013', 'BOX(-179.231086 -14.601813,179.859681 71.441059)', NULL, '1'); @@ -47,14 +36,5 @@ INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (30, NULL, NULL, '"us.census.acs".quantiles_zcta5_5yr_2013_dc39ebe0d5', 'obs_a31255ed256a27d69a9ea777621ad218f6f1f030', '2009 - 2013', 'BOX(0 0,0 0)', NULL, '0'); INSERT INTO obs_table (cartodb_id, the_geom, the_geom_webmercator, id, tablename, timespan, bounds, description, version) VALUES (31, NULL, NULL, '"us.census.acs".quantiles_block_group_5yr_2013_69b156927c', 'obs_0932dc0392ca14a6b43e6e131943de9af2ee46b2', '2009 - 2013', 'BOX(0 0,0 0)', NULL, '2'); - --- --- Name: obs_table_cartodb_id_seq; Type: SEQUENCE SET; Schema: observatory; Owner: cartodb_user_d377e55d-4326-4faf-97c7-503535e81667 --- - -SELECT pg_catalog.setval('obs_table_cartodb_id_seq', 31, true); - - --- --- PostgreSQL database dump complete --- +CREATE SCHEMA IF NOT EXISTS observatory; +ALTER TABLE obs_table SET SCHEMA observatory;