DROP SCHEMA fc CASCADE;
CREATE SCHEMA IF NOT EXISTS fc;
CREATE TABLE fc.dcard AS (SELECT * FROM tpsv.dcard_mapped) WITH DATA;

--DROP TABLE IF EXISTS fc.target_meta;
CREATE TABLE IF NOT EXISTS fc.target_meta (
    schema      text
    ,tname       text
    ,cname      text
    ,opos       int
    ,func       text
    ,fkey       text
    ,fcol       text
    ,dtype      text
    ,appcol     text
    ,pretty     text
);

--ALTER TABLE fc.target_meta DROP CONSTRAINT IF EXISTS target_meta_pk;
ALTER TABLE fc.target_meta ADD CONSTRAINT target_meta_pk PRIMARY KEY (schema, tname, cname);

COMMENT ON TABLE fc.target_meta IS 'target table layout info';
COMMENT ON COLUMN fc.target_meta.schema IS 'schema of target sales data table';
COMMENT ON COLUMN fc.target_meta.tname IS 'table_name of target sales data table';
COMMENT ON COLUMN fc.target_meta.cname IS 'column name';
COMMENT ON COLUMN fc.target_meta.opos IS 'ordinal position of column';
COMMENT ON COLUMN fc.target_meta.func IS 'a functional entity (like customer, part number) that master tables will be build from';
COMMENT ON COLUMN fc.target_meta.fcol IS 'associated field from the master data table if it is different (oseas would refer to ssyr in fc.perd)';
COMMENT ON COLUMN fc.target_meta.fkey IS 'primary key for functional entity';
COMMENT ON COLUMN fc.target_meta.dtype IS 'data type of the sales table column';
COMMENT ON COLUMN fc.target_meta.appcol IS 'supply column name to be used for application variables - (specifcy the order date column)';
COMMENT ON COLUMN fc.target_meta.pretty IS 'the presentation name of the column';

CREATE TABLE IF NOT EXISTS fc.appcols (
    col text,
    dtype text,
    required boolean,
    dflt text
);
ALTER TABLE fc.appcols DROP CONSTRAINT IF EXISTS appcols_pkey CASCADE;
ALTER TABLE fc.appcols ADD CONSTRAINT appcols_pkey PRIMARY KEY (col, dtype);
COMMENT ON TABLE fc.appcols IS 'hard-coded columns names searched for by the application';
INSERT INTO 
    fc.appcols (col, dtype, required, dflt) 
VALUES 
    ('value'        ,'numeric',true,    null),
    ('cost'         ,'numeric',true,   '0'),
    ('units'        ,'numeric',true,   '0'),
    ('order_date'   ,'date'   ,true,    null),
    ('ship_date'    ,'date'   ,false,   null),
    ('order_status' ,'text'   ,true,   'CLOSED'),
    ('version'      ,'text'   ,true,   'ACTUALS'),
    ('iter'         ,'text'   ,true,   'ACTUALS'),
    ('logid'        ,'bigint' ,true,   null),
    ('tag'          ,'text'   ,true,   null),
    ('comment'      ,'text'   ,true,   null),
    ('customer'     ,'text'   ,false,   null),
    ('item'         ,'text'   ,false,   null)
ON CONFLICT ON CONSTRAINT appcols_pkey DO UPDATE SET
    dtype = EXCLUDED.dtype
    ,required = EXCLUDED.required
    ,dflt = EXCLUDED.dflt;

ALTER TABLE fc.target_meta ADD CONSTRAINT fk_appcol FOREIGN KEY (appcol,dtype) REFERENCES fc.appcols(col, dtype);

CREATE TABLE IF NOT EXISTS fc.log  (
    id int GENERATED ALWAYS AS IDENTITY
    ,doc jsonb
);

COMMENT ON TABLE fc.log IS 'forecast change log';

CREATE TABLE IF NOT EXISTS fc.sql(cmd text PRIMARY KEY, t text );

CREATE TABLE fc.perd (
    comp numeric(2,0),
    fsyr numeric(4,0),
    perds numeric(2,0),
    perd numeric(2,0),
    fspr text,
    sdat date,
    edat date,
    drange daterange,
    capr text,
    ndays integer,
    ssyr double precision,
    sspr text
);

GRANT USAGE ON SCHEMA fc TO api;
GRANT ALL ON ALL TABLES IN SCHEMA fc TO api;

COPY fc.perd (comp, fsyr, perds, perd, fspr, sdat, edat, drange, capr, ndays, ssyr, sspr) FROM stdin;
93	2008	12	1	0801	2008-01-01	2008-01-31	[2008-01-01,2008-01-31)	0801	31	2008	 08
93	2008	12	2	0802	2008-02-01	2008-02-29	[2008-02-01,2008-02-29)	0802	29	2008	 09
93	2008	12	3	0803	2008-03-01	2008-03-31	[2008-03-01,2008-03-31)	0803	31	2008	 10
93	2008	12	4	0804	2008-04-01	2008-04-30	[2008-04-01,2008-04-30)	0804	30	2008	 11
93	2008	12	5	0805	2008-05-01	2008-05-31	[2008-05-01,2008-05-31)	0805	31	2008	 12
93	2008	12	6	0806	2008-06-01	2008-06-30	[2008-06-01,2008-06-30)	0806	30	2009	 01
93	2008	12	7	0807	2008-07-01	2008-07-31	[2008-07-01,2008-07-31)	0807	31	2009	 02
93	2008	12	8	0808	2008-08-01	2008-08-31	[2008-08-01,2008-08-31)	0808	31	2009	 03
93	2008	12	9	0809	2008-09-01	2008-09-30	[2008-09-01,2008-09-30)	0809	30	2009	 04
93	2008	12	10	0810	2008-10-01	2008-10-31	[2008-10-01,2008-10-31)	0810	31	2009	 05
93	2008	12	11	0811	2008-11-01	2008-11-30	[2008-11-01,2008-11-30)	0811	30	2009	 06
93	2008	12	12	0812	2008-12-01	2008-12-31	[2008-12-01,2008-12-31)	0812	31	2009	 07
93	2009	12	1	0901	2009-01-01	2009-01-31	[2009-01-01,2009-01-31)	0901	31	2009	 08
93	2009	12	2	0902	2009-02-01	2009-02-28	[2009-02-01,2009-02-28)	0902	28	2009	 09
93	2009	12	3	0903	2009-03-01	2009-03-31	[2009-03-01,2009-03-31)	0903	31	2009	 10
93	2009	12	4	0904	2009-04-01	2009-04-30	[2009-04-01,2009-04-30)	0904	30	2009	 11
93	2009	12	5	0905	2009-05-01	2009-05-31	[2009-05-01,2009-05-31)	0905	31	2009	 12
93	2009	12	6	0906	2009-06-01	2009-06-30	[2009-06-01,2009-06-30)	0906	30	2010	 01
93	2009	12	7	0907	2009-07-01	2009-07-31	[2009-07-01,2009-07-31)	0907	31	2010	 02
93	2009	12	8	0908	2009-08-01	2009-08-31	[2009-08-01,2009-08-31)	0908	31	2010	 03
93	2009	12	9	0909	2009-09-01	2009-09-30	[2009-09-01,2009-09-30)	0909	30	2010	 04
93	2009	12	10	0910	2009-10-01	2009-10-31	[2009-10-01,2009-10-31)	0910	31	2010	 05
93	2009	12	11	0911	2009-11-01	2009-11-30	[2009-11-01,2009-11-30)	0911	30	2010	 06
93	2009	12	12	0912	2009-12-01	2009-12-31	[2009-12-01,2009-12-31)	0912	31	2010	 07
93	2010	12	1	1001	2010-01-01	2010-01-31	[2010-01-01,2010-01-31)	1001	31	2010	 08
93	2010	12	2	1002	2010-02-01	2010-02-28	[2010-02-01,2010-02-28)	1002	28	2010	 09
93	2010	12	3	1003	2010-03-01	2010-03-31	[2010-03-01,2010-03-31)	1003	31	2010	 10
93	2010	12	4	1004	2010-04-01	2010-04-30	[2010-04-01,2010-04-30)	1004	30	2010	 11
93	2010	12	5	1005	2010-05-01	2010-05-31	[2010-05-01,2010-05-31)	1005	31	2010	 12
93	2010	12	6	1006	2010-06-01	2010-06-30	[2010-06-01,2010-06-30)	1006	30	2011	 01
93	2010	12	7	1007	2010-07-01	2010-07-31	[2010-07-01,2010-07-31)	1007	31	2011	 02
93	2010	12	8	1008	2010-08-01	2010-08-31	[2010-08-01,2010-08-31)	1008	31	2011	 03
93	2010	12	9	1009	2010-09-01	2010-09-30	[2010-09-01,2010-09-30)	1009	30	2011	 04
93	2010	12	10	1010	2010-10-01	2010-10-31	[2010-10-01,2010-10-31)	1010	31	2011	 05
93	2010	12	11	1011	2010-11-01	2010-11-30	[2010-11-01,2010-11-30)	1011	30	2011	 06
93	2010	12	12	1012	2010-12-01	2010-12-31	[2010-12-01,2010-12-31)	1012	31	2011	 07
93	2011	12	1	1101	2011-01-01	2011-01-31	[2011-01-01,2011-01-31)	1101	31	2011	 08
93	2011	12	2	1102	2011-02-01	2011-02-28	[2011-02-01,2011-02-28)	1102	28	2011	 09
93	2011	12	3	1103	2011-03-01	2011-03-31	[2011-03-01,2011-03-31)	1103	31	2011	 10
93	2011	12	4	1104	2011-04-01	2011-04-30	[2011-04-01,2011-04-30)	1104	30	2011	 11
93	2011	12	5	1105	2011-05-01	2011-05-31	[2011-05-01,2011-05-31)	1105	31	2011	 12
93	2011	12	6	1106	2011-06-01	2011-06-30	[2011-06-01,2011-06-30)	1106	30	2012	 01
93	2011	12	7	1107	2011-07-01	2011-07-31	[2011-07-01,2011-07-31)	1107	31	2012	 02
93	2011	12	8	1108	2011-08-01	2011-08-31	[2011-08-01,2011-08-31)	1108	31	2012	 03
93	2011	12	9	1109	2011-09-01	2011-09-30	[2011-09-01,2011-09-30)	1109	30	2012	 04
93	2011	12	10	1110	2011-10-01	2011-10-31	[2011-10-01,2011-10-31)	1110	31	2012	 05
93	2011	12	11	1111	2011-11-01	2011-11-30	[2011-11-01,2011-11-30)	1111	30	2012	 06
93	2011	12	12	1112	2011-12-01	2011-12-31	[2011-12-01,2011-12-31)	1112	31	2012	 07
93	2012	12	1	1201	2012-01-01	2012-01-31	[2012-01-01,2012-01-31)	1201	31	2012	 08
93	2012	12	2	1202	2012-02-01	2012-02-29	[2012-02-01,2012-02-29)	1202	29	2012	 09
93	2012	12	3	1203	2012-03-01	2012-03-31	[2012-03-01,2012-03-31)	1203	31	2012	 10
93	2012	12	4	1204	2012-04-01	2012-04-30	[2012-04-01,2012-04-30)	1204	30	2012	 11
93	2012	12	5	1205	2012-05-01	2012-05-31	[2012-05-01,2012-05-31)	1205	31	2012	 12
93	2012	12	6	1206	2012-06-01	2012-06-30	[2012-06-01,2012-06-30)	1206	30	2013	 01
93	2012	12	7	1207	2012-07-01	2012-07-31	[2012-07-01,2012-07-31)	1207	31	2013	 02
93	2012	12	8	1208	2012-08-01	2012-08-31	[2012-08-01,2012-08-31)	1208	31	2013	 03
93	2012	12	9	1209	2012-09-01	2012-09-30	[2012-09-01,2012-09-30)	1209	30	2013	 04
93	2012	12	10	1210	2012-10-01	2012-10-31	[2012-10-01,2012-10-31)	1210	31	2013	 05
93	2012	12	11	1211	2012-11-01	2012-11-30	[2012-11-01,2012-11-30)	1211	30	2013	 06
93	2012	12	12	1212	2012-12-01	2012-12-31	[2012-12-01,2012-12-31)	1212	31	2013	 07
93	2013	12	1	1301	2013-01-01	2013-01-31	[2013-01-01,2013-01-31)	1301	31	2013	 08
93	2013	12	2	1302	2013-02-01	2013-02-28	[2013-02-01,2013-02-28)	1302	28	2013	 09
93	2013	12	3	1303	2013-03-01	2013-03-31	[2013-03-01,2013-03-31)	1303	31	2013	 10
93	2013	12	4	1304	2013-04-01	2013-04-30	[2013-04-01,2013-04-30)	1304	30	2013	 11
93	2013	12	5	1305	2013-05-01	2013-05-31	[2013-05-01,2013-05-31)	1305	31	2013	 12
93	2013	12	6	1306	2013-06-01	2013-06-30	[2013-06-01,2013-06-30)	1306	30	2014	 01
93	2013	12	7	1307	2013-07-01	2013-07-31	[2013-07-01,2013-07-31)	1307	31	2014	 02
93	2013	12	8	1308	2013-08-01	2013-08-31	[2013-08-01,2013-08-31)	1308	31	2014	 03
93	2013	12	9	1309	2013-09-01	2013-09-30	[2013-09-01,2013-09-30)	1309	30	2014	 04
93	2013	12	10	1310	2013-10-01	2013-10-31	[2013-10-01,2013-10-31)	1310	31	2014	 05
93	2013	12	11	1311	2013-11-01	2013-11-30	[2013-11-01,2013-11-30)	1311	30	2014	 06
93	2013	12	12	1312	2013-12-01	2013-12-31	[2013-12-01,2013-12-31)	1312	31	2014	 07
93	2014	12	1	1401	2014-01-01	2014-01-31	[2014-01-01,2014-01-31)	1401	31	2014	 08
93	2014	12	2	1402	2014-02-01	2014-02-28	[2014-02-01,2014-02-28)	1402	28	2014	 09
93	2014	12	3	1403	2014-03-01	2014-03-31	[2014-03-01,2014-03-31)	1403	31	2014	 10
93	2014	12	4	1404	2014-04-01	2014-04-30	[2014-04-01,2014-04-30)	1404	30	2014	 11
93	2014	12	5	1405	2014-05-01	2014-05-31	[2014-05-01,2014-05-31)	1405	31	2014	 12
93	2014	12	6	1406	2014-06-01	2014-06-30	[2014-06-01,2014-06-30)	1406	30	2015	 01
93	2014	12	7	1407	2014-07-01	2014-07-31	[2014-07-01,2014-07-31)	1407	31	2015	 02
93	2014	12	8	1408	2014-08-01	2014-08-31	[2014-08-01,2014-08-31)	1408	31	2015	 03
93	2014	12	9	1409	2014-09-01	2014-09-30	[2014-09-01,2014-09-30)	1409	30	2015	 04
93	2014	12	10	1410	2014-10-01	2014-10-31	[2014-10-01,2014-10-31)	1410	31	2015	 05
93	2014	12	11	1411	2014-11-01	2014-11-30	[2014-11-01,2014-11-30)	1411	30	2015	 06
93	2014	12	12	1412	2014-12-01	2014-12-31	[2014-12-01,2014-12-31)	1412	31	2015	 07
93	2015	13	1	1501	2015-01-01	2015-01-31	[2015-01-01,2015-01-31)	1501	31	2015	 08
93	2015	13	2	1502	2015-02-01	2015-02-17	[2015-02-01,2015-02-17)	1502	17	2015	 09
93	2015	13	3	1503	2015-02-18	2015-02-28	[2015-02-18,2015-02-28)	1502	11	2015	 09
93	2015	13	4	1504	2015-03-01	2015-03-31	[2015-03-01,2015-03-31)	1503	31	2015	 10
93	2015	13	5	1505	2015-04-01	2015-04-30	[2015-04-01,2015-04-30)	1504	30	2015	 11
93	2015	13	6	1506	2015-05-01	2015-05-31	[2015-05-01,2015-05-31)	1505	31	2015	 12
93	2015	13	7	1507	2015-06-01	2015-06-30	[2015-06-01,2015-06-30)	1506	30	2016	 01
93	2015	13	8	1508	2015-07-01	2015-07-31	[2015-07-01,2015-07-31)	1507	31	2016	 02
93	2015	13	9	1509	2015-08-01	2015-08-31	[2015-08-01,2015-08-31)	1508	31	2016	 03
93	2015	13	10	1510	2015-09-01	2015-09-30	[2015-09-01,2015-09-30)	1509	30	2016	 04
93	2015	13	11	1511	2015-10-01	2015-10-31	[2015-10-01,2015-10-31)	1510	31	2016	 05
93	2015	13	12	1512	2015-11-01	2015-11-30	[2015-11-01,2015-11-30)	1511	30	2016	 06
93	2015	13	13	1513	2015-12-01	2015-12-31	[2015-12-01,2015-12-31)	1512	31	2016	 07
93	2016	12	1	1601	2016-01-01	2016-01-31	[2016-01-01,2016-01-31)	1601	31	2016	 08
93	2016	12	2	1602	2016-02-01	2016-02-29	[2016-02-01,2016-02-29)	1602	29	2016	 09
93	2016	12	3	1603	2016-03-01	2016-03-31	[2016-03-01,2016-03-31)	1603	31	2016	 10
93	2016	12	4	1604	2016-04-01	2016-04-30	[2016-04-01,2016-04-30)	1604	30	2016	 11
93	2016	12	5	1605	2016-05-01	2016-05-31	[2016-05-01,2016-05-31)	1605	31	2016	 12
93	2016	12	6	1606	2016-06-01	2016-06-30	[2016-06-01,2016-06-30)	1606	30	2017	 01
93	2016	12	7	1607	2016-07-01	2016-07-31	[2016-07-01,2016-07-31)	1607	31	2017	 02
93	2016	12	8	1608	2016-08-01	2016-08-31	[2016-08-01,2016-08-31)	1608	31	2017	 03
93	2016	12	9	1609	2016-09-01	2016-09-30	[2016-09-01,2016-09-30)	1609	30	2017	 04
93	2016	12	10	1610	2016-10-01	2016-10-31	[2016-10-01,2016-10-31)	1610	31	2017	 05
93	2016	12	11	1611	2016-11-01	2016-11-30	[2016-11-01,2016-11-30)	1611	30	2017	 06
93	2016	12	12	1612	2016-12-01	2016-12-31	[2016-12-01,2016-12-31)	1612	31	2017	 07
93	2017	5	1	1701	2017-01-01	2017-01-31	[2017-01-01,2017-01-31)	1701	31	2017	 08
93	2017	5	2	1702	2017-02-01	2017-02-28	[2017-02-01,2017-02-28)	1702	28	2017	 09
93	2017	5	3	1703	2017-03-01	2017-03-31	[2017-03-01,2017-03-31)	1703	31	2017	 10
93	2017	5	4	1704	2017-04-01	2017-04-30	[2017-04-01,2017-04-30)	1704	30	2017	 11
93	2017	5	5	1705	2017-05-01	2017-05-31	[2017-05-01,2017-05-31)	1705	31	2017	 12
93	2018	12	1	1801	2017-06-01	2017-06-30	[2017-06-01,2017-06-30)	1706	30	2018	 01
93	2018	12	2	1802	2017-07-01	2017-07-31	[2017-07-01,2017-07-31)	1707	31	2018	 02
93	2018	12	3	1803	2017-08-01	2017-08-31	[2017-08-01,2017-08-31)	1708	31	2018	 03
93	2018	12	4	1804	2017-09-01	2017-09-30	[2017-09-01,2017-09-30)	1709	30	2018	 04
93	2018	12	5	1805	2017-10-01	2017-10-31	[2017-10-01,2017-10-31)	1710	31	2018	 05
93	2018	12	6	1806	2017-11-01	2017-11-30	[2017-11-01,2017-11-30)	1711	30	2018	 06
93	2018	12	7	1807	2017-12-01	2017-12-31	[2017-12-01,2017-12-31)	1712	31	2018	 07
93	2018	12	8	1808	2018-01-01	2018-01-31	[2018-01-01,2018-01-31)	1801	31	2018	 08
93	2018	12	9	1809	2018-02-01	2018-02-28	[2018-02-01,2018-02-28)	1802	28	2018	 09
93	2018	12	10	1810	2018-03-01	2018-03-31	[2018-03-01,2018-03-31)	1803	31	2018	 10
93	2018	12	11	1811	2018-04-01	2018-04-30	[2018-04-01,2018-04-30)	1804	30	2018	 11
93	2018	12	12	1812	2018-05-01	2018-05-31	[2018-05-01,2018-05-31)	1805	31	2018	 12
93	2019	12	1	1901	2018-06-01	2018-06-30	[2018-06-01,2018-06-30)	1806	30	2019	 01
93	2019	12	2	1902	2018-07-01	2018-07-31	[2018-07-01,2018-07-31)	1807	31	2019	 02
93	2019	12	3	1903	2018-08-01	2018-08-31	[2018-08-01,2018-08-31)	1808	31	2019	 03
93	2019	12	4	1904	2018-09-01	2018-09-30	[2018-09-01,2018-09-30)	1809	30	2019	 04
93	2019	12	5	1905	2018-10-01	2018-10-31	[2018-10-01,2018-10-31)	1810	31	2019	 05
93	2019	12	6	1906	2018-11-01	2018-11-30	[2018-11-01,2018-11-30)	1811	30	2019	 06
93	2019	12	7	1907	2018-12-01	2018-12-31	[2018-12-01,2018-12-31)	1812	31	2019	 07
93	2019	12	8	1908	2019-01-01	2019-01-31	[2019-01-01,2019-01-31)	1901	31	2019	 08
93	2019	12	9	1909	2019-02-01	2019-02-28	[2019-02-01,2019-02-28)	1902	28	2019	 09
93	2019	12	10	1910	2019-03-01	2019-03-31	[2019-03-01,2019-03-31)	1903	31	2019	 10
93	2019	12	11	1911	2019-04-01	2019-04-30	[2019-04-01,2019-04-30)	1904	30	2019	 11
93	2019	12	12	1912	2019-05-01	2019-05-31	[2019-05-01,2019-05-31)	1905	31	2019	 12
93	2020	12	1	2001	2019-06-01	2019-06-30	[2019-06-01,2019-06-30)	1906	30	2020	 01
93	2020	12	2	2002	2019-07-01	2019-07-31	[2019-07-01,2019-07-31)	1907	31	2020	 02
93	2020	12	3	2003	2019-08-01	2019-08-31	[2019-08-01,2019-08-31)	1908	31	2020	 03
93	2020	12	4	2004	2019-09-01	2019-09-30	[2019-09-01,2019-09-30)	1909	30	2020	 04
93	2020	12	5	2005	2019-10-01	2019-10-31	[2019-10-01,2019-10-31)	1910	31	2020	 05
93	2020	12	6	2006	2019-11-01	2019-11-30	[2019-11-01,2019-11-30)	1911	30	2020	 06
93	2020	12	7	2007	2019-12-01	2019-12-31	[2019-12-01,2019-12-31)	1912	31	2020	 07
93	2020	12	8	2008	2020-01-01	2020-01-31	[2020-01-01,2020-01-31)	2001	31	2020	 08
93	2020	12	9	2009	2020-02-01	2020-02-29	[2020-02-01,2020-02-29)	2002	29	2020	 09
93	2020	12	10	2010	2020-03-01	2020-03-31	[2020-03-01,2020-03-31)	2003	31	2020	 10
93	2020	12	11	2011	2020-04-01	2020-04-30	[2020-04-01,2020-04-30)	2004	30	2020	 11
93	2020	12	12	2012	2020-05-01	2020-05-31	[2020-05-01,2020-05-31)	2005	31	2020	 12
93	2021	12	1	2101	2020-06-01	2020-06-30	[2020-06-01,2020-06-30)	2006	30	2021	 01
93	2021	12	2	2102	2020-07-01	2020-07-31	[2020-07-01,2020-07-31)	2007	31	2021	 02
93	2021	12	3	2103	2020-08-01	2020-08-31	[2020-08-01,2020-08-31)	2008	31	2021	 03
93	2021	12	4	2104	2020-09-01	2020-09-30	[2020-09-01,2020-09-30)	2009	30	2021	 04
93	2021	12	5	2105	2020-10-01	2020-10-31	[2020-10-01,2020-10-31)	2010	31	2021	 05
93	2021	12	6	2106	2020-11-01	2020-11-30	[2020-11-01,2020-11-30)	2011	30	2021	 06
93	2021	12	7	2107	2020-12-01	2020-12-31	[2020-12-01,2020-12-31)	2012	31	2021	 07
93	2021	12	8	2108	2021-01-01	2021-01-31	[2021-01-01,2021-01-31)	2101	31	2021	 08
93	2021	12	9	2109	2021-02-01	2021-02-28	[2021-02-01,2021-02-28)	2102	28	2021	 09
93	2021	12	10	2110	2021-03-01	2021-03-31	[2021-03-01,2021-03-31)	2103	31	2021	 10
93	2021	12	11	2111	2021-04-01	2021-04-30	[2021-04-01,2021-04-30)	2104	30	2021	 11
93	2021	12	12	2112	2021-05-01	2021-05-31	[2021-05-01,2021-05-31)	2105	31	2021	 12
93	2022	12	1	2201	2021-06-01	2021-06-30	[2021-06-01,2021-06-30)	2106	30	2022	 01
93	2022	12	2	2202	2021-07-01	2021-07-31	[2021-07-01,2021-07-31)	2107	31	2022	 02
93	2022	12	3	2203	2021-08-01	2021-08-31	[2021-08-01,2021-08-31)	2108	31	2022	 03
93	2022	12	4	2204	2021-09-01	2021-09-30	[2021-09-01,2021-09-30)	2109	30	2022	 04
93	2022	12	5	2205	2021-10-01	2021-10-31	[2021-10-01,2021-10-31)	2110	31	2022	 05
93	2022	12	6	2206	2021-11-01	2021-11-30	[2021-11-01,2021-11-30)	2111	30	2022	 06
93	2022	12	7	2207	2021-12-01	2021-12-31	[2021-12-01,2021-12-31)	2112	31	2022	 07
93	2022	12	8	2208	2022-01-01	2022-01-31	[2022-01-01,2022-01-31)	2201	31	2022	 08
93	2022	12	9	2209	2022-02-01	2022-02-28	[2022-02-01,2022-02-28)	2202	28	2022	 09
93	2022	12	10	2210	2022-03-01	2022-03-31	[2022-03-01,2022-03-31)	2203	31	2022	 10
93	2022	12	11	2211	2022-04-01	2022-04-30	[2022-04-01,2022-04-30)	2204	30	2022	 11
93	2022	12	12	2212	2022-05-01	2022-05-31	[2022-05-01,2022-05-31)	2205	31	2022	 12
93	2023	12	1	2301	2022-06-01	2022-06-30	[2022-06-01,2022-06-30)	2206	30	2023	 01
93	2023	12	2	2302	2022-07-01	2022-07-31	[2022-07-01,2022-07-31)	2207	31	2023	 02
93	2023	12	3	2303	2022-08-01	2022-08-31	[2022-08-01,2022-08-31)	2208	31	2023	 03
93	2023	12	4	2304	2022-09-01	2022-09-30	[2022-09-01,2022-09-30)	2209	30	2023	 04
93	2023	12	5	2305	2022-10-01	2022-10-31	[2022-10-01,2022-10-31)	2210	31	2023	 05
93	2023	12	6	2306	2022-11-01	2022-11-30	[2022-11-01,2022-11-30)	2211	30	2023	 06
93	2023	12	7	2307	2022-12-01	2022-12-31	[2022-12-01,2022-12-31)	2212	31	2023	 07
93	2023	12	8	2308	2023-01-01	2023-01-31	[2023-01-01,2023-01-31)	2301	31	2023	 08
93	2023	12	9	2309	2023-02-01	2023-02-28	[2023-02-01,2023-02-28)	2302	28	2023	 09
93	2023	12	10	2310	2023-03-01	2023-03-31	[2023-03-01,2023-03-31)	2303	31	2023	 10
93	2023	12	11	2311	2023-04-01	2023-04-30	[2023-04-01,2023-04-30)	2304	30	2023	 11
93	2023	12	12	2312	2023-05-01	2023-05-31	[2023-05-01,2023-05-31)	2305	31	2023	 12
\.


--
-- PostgreSQL database dump complete
--

