reload from ubm

This commit is contained in:
Paul Trowbridge 2018-05-29 23:47:24 -04:00
parent 0301883d49
commit 8fee2548a4
5 changed files with 4357 additions and 1 deletions

17
reload/hunt.sql Normal file
View File

@ -0,0 +1,17 @@
copy (
select
to_char(r."Date",'mm/dd/yy') "Date"
,r."Reference Number"
,r."Payee Name"
,r."Memo"
,r."Amount"
,r."Category Name"
from
tps.trans
join lateral jsonb_populate_record(null::tps.hunt, rec) r on true
where
srce = 'HUNT'
order by
r."Date" asc
) to
'C:\users\fleet\downloads\hunt.csv' with (format csv, header true);

40
reload/huntdef.json Normal file
View File

@ -0,0 +1,40 @@
{
"name": "hunt",
"source": "client_file",
"loading_function": "csv",
"constraint": [
"{Date}"
],
"schema": [
{
"key": "Date",
"type": "date",
"column_name":"Date"
},
{
"key": "Reference Number",
"type": "numeric",
"column_name":"Reference Number"
},
{
"key": "Payee Name",
"type": "text",
"column_name":"Payee Name"
},
{
"key": "Memo",
"type": "text",
"column_name":"Memo"
},
{
"key": "Amount",
"type": "text",
"column_name":"Amount"
},
{
"key": "Category Name",
"type": "text",
"column_name":"Cateogry Name"
}
]
}

4299
reload/mapval.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
curl -H "Content-Type: application/json" -X POST -d@./vals.json http://localhost:81/mapval_set
curl -H "Content-Type: application/json" -X POST -d@//mnt/c/Users/fleet/Documents/tps_etl/reload/mapval.json http://localhost:81/mapval_set