Last active
August 29, 2015 14:13
-
-
Save komsit37/5a867c6ce253daffd505 to your computer and use it in GitHub Desktop.
migrate hdb from old server to new server. runs this in new server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //run this on q session in a new server | |
| h: hopen`$":192.241.231.75:5012::"; | |
| h ({tables `.}; ()); | |
| sel: {[t; d] select from t where date=d}; | |
| getdata: {[src; dst; query; transform; d] dst set transform delete date from h (query; src; d)}; | |
| write: {[dst; d] .Q.dpft[`:/apps/bnb/data; d; `id; dst]}; | |
| d: 2015.01.12; | |
| //booking | |
| getdata[`booking;`booking; sel; {select id, time, on: cal, (`book`cancel!`book`open) action, price from x}] d; | |
| write[`booking] d; | |
| //booking2 | |
| //getdata[`booking2;`booking2; sel; ::] d | |
| getdata[`booking2;`booking2; sel; {flip "stsddiif"$flip select id, time, (`book`cancel!`book`open) action, checkin, checkout, nights, rev, adr:revpar from x}] d; | |
| write[`booking2] d; | |
| //prop | |
| getdata[`prop;`prop; sel; ::] d; | |
| write[`prop;] d; | |
| //search | |
| getdata[`search;`search; sel; ::] d; | |
| write[`search] d; | |
| //future //previously cal | |
| getdata[`cal;`future; {[t; d] select from t where date=d, cal >= date}; `id`time`on xcol] d; | |
| write[`future] d; | |
| hclose h; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment