From 0d4b8a91141a361fbc42111a10148211126c32cf Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 19 Sep 2018 22:24:27 -0400 Subject: [PATCH] periods --- db_deploy.sql | 15 ++++++++++++++- schema/tables/fspr.sql | 9 +++++++++ schema/tables/perd.sql | 5 ----- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 schema/tables/fspr.sql delete mode 100644 schema/tables/perd.sql diff --git a/db_deploy.sql b/db_deploy.sql index 3970cb3..382c993 100644 --- a/db_deploy.sql +++ b/db_deploy.sql @@ -1,8 +1,11 @@ BEGIN TRANSACTION; --\conninfo -drop schema evt cascade; + --------------------------build schema---------------------------------------------- +DROP EXTENSTION IF EXISTS ltree; +CREATE EXTENSTION ltree; +DROP SCHEMA IF EXISTS evt cascade; CREATE SCHEMA evt; COMMENT ON SCHEMA evt IS 'event log'; @@ -28,6 +31,16 @@ CREATE TABLE evt.acct ( COMMENT ON COLUMN evt.acct.acct IS 'account'; COMMENT ON COLUMN evt.acct.prop IS 'properties'; +------------------------fiscal periods------------------------ +CREATE TABLE evt.fspr ( + id ltree + ,dur tstzrange +) + +CREATE INDEX fspr_id ON evt.fspr USING GIST (id); +COMMENT ON COLUMN evt.fspr.id IS 'fiscal period id'; +COMMENT ON COLUMN evt.fspr.dur IS 'fiscal period dutation in timestamp range'; + --------------------------relational ledger------------------------------------------ CREATE TABLE evt.gl ( diff --git a/schema/tables/fspr.sql b/schema/tables/fspr.sql new file mode 100644 index 0000000..037dc95 --- /dev/null +++ b/schema/tables/fspr.sql @@ -0,0 +1,9 @@ +------------------------fiscal periods------------------------ +CREATE TABLE evt.fspr ( + id ltree + ,dur tstzrange +) + +CREATE INDEX fspr_id ON evt.fspr USING GIST (id); +COMMENT ON COLUMN evt.fspr.id IS 'fiscal period id'; +COMMENT ON COLUMN evt.fspr.dur IS 'fiscal period dutation in timestamp range'; \ No newline at end of file diff --git a/schema/tables/perd.sql b/schema/tables/perd.sql deleted file mode 100644 index b967650..0000000 --- a/schema/tables/perd.sql +++ /dev/null @@ -1,5 +0,0 @@ -------------------------fiscal periods------------------------ -CREATE TABLE evt.fspr ( - id ltree - ,dur tstzrange -) \ No newline at end of file