Skip to content

Commit

Permalink
#66 Add the real parent table structure, previous commit was a functi…
Browse files Browse the repository at this point in the history
…on to create yearly ones
  • Loading branch information
chmnata committed Oct 11, 2022
1 parent 0836846 commit 16be330
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions data_aggregation/sql/centreline_monthly.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- Parent table structure

CREATE TABLE IF NOT EXISTS congestion.centreline_monthly
(
uid integer NOT NULL,
mth date NOT NULL,
hr integer NOT NULL,
day_type text,
avg_tt numeric NOT NULL,
median_tt numeric NOT NULL,
pct_85_tt numeric NOT NULL,
pct_95_tt numeric NOT NULL,
min_tt numeric NOT NULL,
max_tt numeric NOT NULL,
std_dev numeric NOT NULL,
num_bins integer NOT NULL
) PARTITION BY RANGE (mth);

ALTER TABLE congestion.centreline_monthly OWNER TO congestion_admins;
GRANT SELECT ON TABLE congestion.centreline_monthly TO bdit_humans;

COMMENT ON TABLE congestion.centreline_monthly
IS 'Table that contains centreline sets equivalent of network segments hourly travel time and travel time index for each monthly. Partition yearly using mth column. New monthly data automatically aggregated through an airflow process.';

0 comments on commit 16be330

Please sign in to comment.