From e73d69ad65d702e2af868d2d166b03554604329f Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 15 Feb 2023 14:21:49 -0500 Subject: [PATCH] include pool ddl --- .gitignore | 1 + build/osm_pool.sql | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 build/osm_pool.sql diff --git a/.gitignore b/.gitignore index eeff6a6..9a014a8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ changes.html /.dbeaver .project /.settings +/Scripts diff --git a/build/osm_pool.sql b/build/osm_pool.sql new file mode 100644 index 0000000..541fb37 --- /dev/null +++ b/build/osm_pool.sql @@ -0,0 +1,78 @@ +-- rlarp.osm_pool definition + +-- Drop table + +-- DROP TABLE rlarp.osm_pool; + +CREATE TABLE rlarp.osm_pool ( + fspr text NULL, + plnt text NULL, + promo text NULL, + terms text NULL, + bill_cust_descr text NULL, + ship_cust_descr text NULL, + dsm text NULL, + quota_rep_descr text NULL, + director text NULL, + billto_group text NULL, + shipto_group text NULL, + chan text NULL, + chansub text NULL, + chan_retail text NULL, + part text NULL, + part_descr text NULL, + part_group text NULL, + branding text NULL, + majg_descr text NULL, + ming_descr text NULL, + majs_descr text NULL, + mins_descr text NULL, + segm text NULL, + substance text NULL, + fs_line text NULL, + r_currency text NULL, + r_rate numeric(31, 10) NULL, + c_currency text NULL, + c_rate numeric(31, 10) NULL, + units numeric(31, 10) NULL, + value_loc numeric(31, 10) NULL, + value_usd numeric NULL, + cost_loc numeric(31, 10) NULL, + cost_usd numeric NULL, + calc_status text NULL, + flag text NULL, + order_date date NULL, + order_month text NULL, + order_season int4 NULL, + request_date date NULL, + request_month text NULL, + request_season int4 NULL, + ship_date date NULL, + ship_month text NULL, + ship_season int4 NULL, + "version" text NULL, + iter text NULL, + logid int4 NULL, + tag text NULL, + "comment" text NULL, + "module" text NULL +); +CREATE INDEX osm_pool_logid ON rlarp.osm_pool USING btree (logid); +CREATE INDEX osm_qr ON rlarp.osm_pool USING btree (quota_rep_descr, bill_cust_descr, ship_cust_descr); + + +-- rlarp.osm_pool foreign keys + +ALTER TABLE rlarp.osm_pool ADD CONSTRAINT logfk FOREIGN KEY (logid) REFERENCES rlarp.osm_log(id); + +-- rlarp.osm_log definition + +-- Drop table + +-- DROP TABLE rlarp.osm_log; + +CREATE TABLE rlarp.osm_log ( + id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY, + doc jsonb NULL, + CONSTRAINT osm_log_pkey PRIMARY KEY (id) + );