From 10223cf72f77a8aae90604a499fd2f3b7170c305 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 20 Sep 2018 15:57:02 -0400 Subject: [PATCH] period mods --- db_deploy.sql | 7 ++++++- schema/suggested_date/periods.sql | 2 +- schema/tables/fspr.sql | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/db_deploy.sql b/db_deploy.sql index 6db7edf..2a87b5b 100644 --- a/db_deploy.sql +++ b/db_deploy.sql @@ -34,7 +34,12 @@ COMMENT ON COLUMN evt.acct.prop IS 'properties'; CREATE TABLE evt.fspr ( id ltree ,dur tstzrange -); +) + +COMMENT ON COLUMN evt.fspr.id IS 'fiscal period'; +COMMENT ON COLUMN evt.fspr.dur IS 'duration of period as timestamp range'; + +CREATE INDEX id_gist ON evt.fspr USING GIST (id); --------------------------relational ledger------------------------------------------ diff --git a/schema/suggested_date/periods.sql b/schema/suggested_date/periods.sql index 8a66161..dcfee0d 100644 --- a/schema/suggested_date/periods.sql +++ b/schema/suggested_date/periods.sql @@ -36,6 +36,6 @@ SELECT )::ltree t2 ,tstzrange(gs.d,gs.d + '1 month'::interval) r FROM - generate_series('2018-01-01 00:00'::timestamptz,'2099-12-01 00:00'::timestamptz,'1 month') gs(d) + generate_series('2018-01-01 00:00'::timestamptz,'2099-12-01 00:00'::timestamptz,'1 day') gs(d) INNER JOIN m ON m.cm = extract(month from gs.d) \ No newline at end of file diff --git a/schema/tables/fspr.sql b/schema/tables/fspr.sql index b967650..ea1a48a 100644 --- a/schema/tables/fspr.sql +++ b/schema/tables/fspr.sql @@ -2,4 +2,7 @@ CREATE TABLE evt.fspr ( id ltree ,dur tstzrange -) \ No newline at end of file +) + + +CREATE INDEX id_gist ON evt.fspr USING GIST (id); \ No newline at end of file