add re constraint from yeclose
This commit is contained in:
parent
9fa7dd7e04
commit
bc331be07c
@ -31,6 +31,9 @@ COMMENT ON TABLE evt.acct IS 'account master list';
|
|||||||
COMMENT ON COLUMN evt.acct.acct IS 'account';
|
COMMENT ON COLUMN evt.acct.acct IS 'account';
|
||||||
COMMENT ON COLUMN evt.acct.prop IS 'properties';
|
COMMENT ON COLUMN evt.acct.prop IS 'properties';
|
||||||
|
|
||||||
|
--this should effectively only allow one instance of an account where retained_earnings = set per top level account (trial balance)
|
||||||
|
CREATE UNIQUE INDEX acct_re ON evt.acct (subpath(acct,0,1)) WHERE prop ->> 'retained_earnings' = 'set';
|
||||||
|
|
||||||
------------------------fiscal periods------------------------
|
------------------------fiscal periods------------------------
|
||||||
CREATE TABLE evt.fspr (
|
CREATE TABLE evt.fspr (
|
||||||
id ltree PRIMARY KEY
|
id ltree PRIMARY KEY
|
||||||
|
@ -8,3 +8,6 @@ CREATE TABLE evt.acct (
|
|||||||
COMMENT ON TABLE evt.acct IS 'account master list';
|
COMMENT ON TABLE evt.acct IS 'account master list';
|
||||||
COMMENT ON COLUMN evt.acct.acct IS 'account';
|
COMMENT ON COLUMN evt.acct.acct IS 'account';
|
||||||
COMMENT ON COLUMN evt.acct.prop IS 'properties';
|
COMMENT ON COLUMN evt.acct.prop IS 'properties';
|
||||||
|
|
||||||
|
--this should effectively only allow one instance of an account where retained_earnings = set per top level account (trial balance)
|
||||||
|
CREATE UNIQUE INDEX acct_re ON evt.acct (subpath(acct,0,1)) WHERE prop ->> 'retained_earnings' = 'set';
|
||||||
|
Loading…
Reference in New Issue
Block a user