Freeside talk:1.7:Documentation:Upgrading

From Freeside
Revision as of 14:26, 25 January 2007 by Ivan (talk | contribs)

Jump to: navigation, search

int->bigint for the byte counting stuff

clear; t=svc_acct; for c in upbytes upbytes_threshold downbytes downbytes_threshold totalbytes totalbytes_threshold; do echo "ALTER TABLE $t ADD COLUMN ${c}_new bigint; UPDATE $t SET ${c}_new = CAST($c AS bigint); ALTER TABLE $t DROP COLUMN $c;

ALTER TABLE $t RENAME COLUMN ${c}_new TO $c; "; done

clear; t=prepay_credit; for c in upbytes downbytes totalbytes; do echo "ALTER TABLE $t ADD COLUMN ${c}_new bigint; UPDATE $t SET ${c}_new = CAST($c AS bigint); ALTER TABLE $t DROP COLUMN $c; ALTER TABLE $t RENAME COLUMN ${c}_new TO $c; "; done

bigger payinfo fields for encryption

ALTER TABLE cust_main ADD payinfo_new varchar(512); UPDATE cust_main SET payinfo_new = payinfo; ALTER TABLE cust_main DROP payinfo; ALTER TABLE cust_main RENAME payinfo_new TO payinfo;

ALTER TABLE cust_main ADD paycvv_new varchar(512); UPDATE cust_main SET paycvv_new = paycvv; ALTER TABLE cust_main DROP paycvv; ALTER TABLE cust_main RENAME paycvv_new TO paycvv;

ALTER TABLE h_cust_main ADD payinfo_new varchar(512); UPDATE h_cust_main SET payinfo_new = payinfo; ALTER TABLE h_cust_main DROP payinfo; ALTER TABLE h_cust_main RENAME payinfo_new TO payinfo;

ALTER TABLE h_cust_main ADD paycvv_new varchar(512); UPDATE h_cust_main SET paycvv_new = paycvv; ALTER TABLE h_cust_main DROP paycvv; ALTER TABLE h_cust_main RENAME paycvv_new TO paycvv;

ALTER TABLE cust_pay ADD payinfo_new varchar(512); UPDATE cust_pay SET payinfo_new = payinfo; ALTER TABLE cust_pay DROP payinfo; ALTER TABLE cust_pay RENAME payinfo_new TO payinfo;

ALTER TABLE h_cust_pay ADD payinfo_new varchar(512); UPDATE h_cust_pay SET payinfo_new = payinfo; ALTER TABLE h_cust_pay DROP payinfo ALTER TABLE h_cust_pay RENAME payinfo_new TO payinfo;


ALTER TABLE cust_pay_void ADD payinfo_new varchar(512); UPDATE cust_pay_void SET payinfo_new = payinfo; ALTER TABLE cust_pay_void DROP payinfo; ALTER TABLE cust_pay_void RENAME payinfo_new TO payinfo;

ALTER TABLE h_cust_pay_void ADD payinfo_new varchar(512); UPDATE h_cust_pay_void SET payinfo_new = payinfo; ALTER TABLE h_cust_pay_void DROP payinfo ALTER TABLE h_cust_pay_void RENAME payinfo_new TO payinfo;


ALTER TABLE cust_pay_batch ADD payinfo_new varchar(512); UPDATE cust_pay_batch SET payinfo_new = payinfo; ALTER TABLE cust_pay_batch DROP payinfo; ALTER TABLE cust_pay_batch RENAME payinfo_new TO payinfo;

ALTER TABLE h_cust_pay_batch ADD payinfo_new varchar(512); UPDATE h_cust_pay_batch SET payinfo_new = payinfo; ALTER TABLE h_cust_pay_batch DROP payinfo ALTER TABLE h_cust_pay_batch RENAME payinfo_new TO payinfo;


ALTER TABLE cust_refund ADD payinfo_new varchar(512); UPDATE cust_refund SET payinfo_new = payinfo; ALTER TABLE cust_refund DROP payinfo; ALTER TABLE cust_refund RENAME payinfo_new TO payinfo;

ALTER TABLE h_cust_refund ADD payinfo_new varchar(512); UPDATE h_cust_refund SET payinfo_new = payinfo; ALTER TABLE h_cust_refund DROP payinfo ALTER TABLE h_cust_refund RENAME payinfo_new TO payinfo;