diff --git a/db_deploy.sql b/db_deploy.sql index 5c34ac0..0c4b1bb 100644 --- a/db_deploy.sql +++ b/db_deploy.sql @@ -49,7 +49,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 NOT NULL REFERENCES evt.fspr (id) ,amount numeric (12,2) ,glline INT ,bprkeys JSONB diff --git a/schema/tables/gl.sql b/schema/tables/gl.sql index 7f750dc..27d23ec 100644 --- a/schema/tables/gl.sql +++ b/schema/tables/gl.sql @@ -1,5 +1,5 @@ --------------------------relational ledger------------------------------------------ - +--DROP TABLE evt.gl CREATE TABLE evt.gl ( id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY ,bprid INT REFERENCES evt.bpr (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 NOT NULL REFERENCES evt.fspr (id) ,amount numeric (12,2) ,glline INT ,bprkeys JSONB diff --git a/schema/triggers/gl_insert.sql b/schema/triggers/gl_insert.sql new file mode 100644 index 0000000..e69de29