some cleanup and modify gl columns
This commit is contained in:
parent
a487b12b38
commit
f96a540210
@ -31,21 +31,25 @@ COMMENT ON COLUMN evt.acct.prop IS 'properties';
|
||||
|
||||
------------------------fiscal periods------------------------
|
||||
CREATE TABLE evt.fspr (
|
||||
id ltree
|
||||
id ltree PRIMARY KEY
|
||||
,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------------------------------------------
|
||||
|
||||
CREATE TABLE evt.gl (
|
||||
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
|
||||
,bprid INT REFERENCES evt.bpr (id)
|
||||
,acct text REFERENCES evt.acct (acct)
|
||||
,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP
|
||||
--populates by trigger join to evt.fspr
|
||||
,tstmp timestamptz
|
||||
,fspr ltree REFERENCES evt.fspr (id)
|
||||
,amount numeric (12,2)
|
||||
,glline INT
|
||||
,bprkeys JSONB
|
||||
@ -53,6 +57,9 @@ CREATE TABLE evt.gl (
|
||||
COMMENT ON COLUMN evt.gl.id IS 'gl id';
|
||||
COMMENT ON COLUMN evt.gl.bprid IS 'id of initial basic pecuniary record';
|
||||
COMMENT ON COLUMN evt.gl.acct IS 'account code';
|
||||
COMMENT ON COLUMN evt.gl.pstmp IS 'post time stamp';
|
||||
COMMENT ON COLUMN evt.gl.tstmp IS 'transaction time stamp';
|
||||
COMMENT ON COLUMN evt.gl.fspr IS 'fiscal period';
|
||||
COMMENT ON COLUMN evt.gl.amount IS 'amount';
|
||||
COMMENT ON COLUMN evt.gl.glline IS 'gl line number';
|
||||
COMMENT ON COLUMN evt.gl.bprkeys IS 'extract from initial basic pecuniary record';
|
||||
|
@ -1,10 +1,9 @@
|
||||
------------------------fiscal periods------------------------
|
||||
CREATE TABLE evt.fspr (
|
||||
id ltree
|
||||
id ltree PRIMARY KEY
|
||||
,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);
|
||||
|
@ -7,7 +7,7 @@ CREATE TABLE evt.gl (
|
||||
,pstmp timestamptz DEFAULT CURRENT_TIMESTAMP
|
||||
--populates by trigger join to evt.fspr
|
||||
,tstmp timestamptz
|
||||
,fspr ltree REFERENCES evt.fspr (id);
|
||||
,fspr ltree REFERENCES evt.fspr (id)
|
||||
,amount numeric (12,2)
|
||||
,glline INT
|
||||
,bprkeys JSONB
|
||||
|
Loading…
Reference in New Issue
Block a user