From 7af9d46b7d9324c88790ac6529252ae2e492a6e8 Mon Sep 17 00:00:00 2001 From: pratishta Date: Mon, 16 Mar 2026 15:17:15 -0400 Subject: [PATCH] Add census tract model tables --- db/pg/model-create/all.sh | 1 + db/pg/model-create/all.sql | 3 ++- db/pg/model-create/census-tracts.sh | 25 +++++++++++++++++++++++++ db/pg/model-create/census-tracts.sql | 3 +++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 db/pg/model-create/census-tracts.sh create mode 100644 db/pg/model-create/census-tracts.sql diff --git a/db/pg/model-create/all.sh b/db/pg/model-create/all.sh index 69dabc4..69e2a7d 100644 --- a/db/pg/model-create/all.sh +++ b/db/pg/model-create/all.sh @@ -38,6 +38,7 @@ pg_dump --host=$TARGET_DATABASE_HOST \ -t budget_line \ -t capital_commitment \ -t capital_commitment_fund \ + -t census_tract \ --file ./data/all_dump.sql PGPASSWORD=$POSTGRES_PASSWORD \ diff --git a/db/pg/model-create/all.sql b/db/pg/model-create/all.sql index 689d607..5c189de 100644 --- a/db/pg/model-create/all.sql +++ b/db/pg/model-create/all.sql @@ -23,5 +23,6 @@ DROP TABLE IF EXISTS agency_budget, budget_line, capital_commitment, - capital_commitment_fund + capital_commitment_fund, + census_tract CASCADE diff --git a/db/pg/model-create/census-tracts.sh b/db/pg/model-create/census-tracts.sh new file mode 100644 index 0000000..b181a00 --- /dev/null +++ b/db/pg/model-create/census-tracts.sh @@ -0,0 +1,25 @@ +PGPASSWORD=$POSTGRES_PASSWORD \ +psql --host=localhost \ + --port=5432 \ + -U $POSTGRES_USER \ + -d $POSTGRES_DB \ + --single-transaction \ + --file ./flow/model-create/census-tracts.sql + +PGPASSWORD=$TARGET_DATABASE_PASSWORD \ +pg_dump --host=$TARGET_DATABASE_HOST \ + --port=$TARGET_DATABASE_PORT \ + -U $TARGET_DATABASE_USER \ + -d $TARGET_DATABASE_NAME \ + -s \ + --no-owner \ + -t census_tract \ + --file ./data/census-tracts_dump.sql + +PGPASSWORD=$POSTGRES_PASSWORD \ +psql --host=localhost \ + --port=5432 \ + -U $POSTGRES_USER \ + -d $POSTGRES_DB \ + --single-transaction \ + --file ./data/census-tracts_dump.sql \ No newline at end of file diff --git a/db/pg/model-create/census-tracts.sql b/db/pg/model-create/census-tracts.sql new file mode 100644 index 0000000..8118df3 --- /dev/null +++ b/db/pg/model-create/census-tracts.sql @@ -0,0 +1,3 @@ +DROP TABLE IF EXISTS + census_tract + CASCADE \ No newline at end of file