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