X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fdocs%2Fupgrade10.html;h=8d90ab7a23f14bb3da2ce9a033265f052a958e1e;hb=6ec96b1f3300543268ac49e2f97af1d0524195ab;hp=47399c3b19adffb770285c0ad6f09b78dc8e53bd;hpb=0718d6c7bc61075243d2f44f0df30fe6431f0f72;p=freeside.git diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html index 47399c3b1..8d90ab7a2 100644 --- a/httemplate/docs/upgrade10.html +++ b/httemplate/docs/upgrade10.html @@ -1,221 +1,107 @@ +
+-this is incomplete - -install DBD::Pg 1.32 -install DBIx::DBSchema 0.23 -install Net::SSH 0.08 -- If using Apache::ASP, add PerlSetVar RequestBinaryRead Off to your Apache configuration and make sure you are using Apache::ASP minimum version 2.55. - -install NetAddr::IP, Chart::Base, IPC::ShareLite and Locale::SubCountry - -CREATE TABLE cust_bill_pkg_detail ( - detailnum serial, - pkgnum int NOT NULL, - invnum int NOT NULL, - detail varchar(80), - PRIMARY KEY (detailnum) -); -CREATE INDEX cust_bill_pkg_detail1 ON cust_bill_pkg_detail ( pkgnum, invnum ); - -CREATE TABLE part_virtual_field ( - vfieldpart int NOT NULL, - dbtable varchar(32) NOT NULL, - name varchar(32) NOT NULL, - check_block text, - list_source text, - length integer, - label varchar(80), - PRIMARY KEY (vfieldpart) -); - -CREATE TABLE virtual_field ( - recnum integer NOT NULL, - vfieldpart integer NOT NULL, - value varchar(128) NOT NULL, - PRIMARY KEY (vfieldpart, recnum) -); - -CREATE TABLE router ( - routernum serial, - routername varchar(80), - svcnum int, - PRIMARY KEY (routernum) -); - -CREATE TABLE part_svc_router ( - svcpart int NOT NULL, - routernum int NOT NULL -); - -CREATE TABLE addr_block ( - blocknum serial, - routernum int NOT NULL, - ip_gateway varchar(15) NOT NULL, - ip_netmask int NOT NULL, - PRIMARY KEY (blocknum) -); -CREATE UNIQUE INDEX addr_block1 ON addr_block ( blocknum, routernum ); - -CREATE TABLE svc_broadband ( - svcnum int NOT NULL, - blocknum int NOT NULL, - speed_up int NOT NULL, - speed_down int NOT NULL, - ip_addr varchar(15), - PRIMARY KEY (svcnum) -); - -CREATE TABLE acct_snarf ( - snarfnum serial, - svcnum int NOT NULL, - machine varchar(255) NULL, - protocol varchar(80) NULL, - username varchar(80) NULL, - _password varchar(80) NULL, - PRIMARY KEY (snarfnum) -); -CREATE INDEX acct_snarf1 ON acct_snarf ( svcnum ); - -CREATE TABLE svc_external ( - svcnum int NOT NULL, - id int NOT NULL, - title varchar(80), - PRIMARY KEY (svcnum) -); - -CREATE TABLE part_pkg_temp ( - pkgpart serial NOT NULL, - pkg varchar(80) NOT NULL, - "comment" varchar(80) NOT NULL, - setup text NULL, - freq varchar(80) NOT NULL, - recur text NULL, - setuptax char(1) NULL, - recurtax char(1) NULL, - plan varchar(80) NULL, - plandata text NULL, - disabled char(1) NULL, - taxclass varchar(80) NULL, - PRIMARY KEY (pkgpart) -); -INSERT INTO part_pkg_temp SELECT * from part_pkg; -DROP TABLE part_pkg; -ALTER TABLE part_pkg_temp RENAME TO part_pkg; -CREATE INDEX part_pkg1 ON part_pkg(disabled); - -On modern Pg: -ALTER TABLE part_pkg DROP CONSTRAINT part_pkg_temp_pkey; -ALTER TABLE part_pkg ADD PRIMARY KEY (pkgpart); -select setval('public.part_pkg_temp_pkgpart_seq', ( select max(pkgpart) from part_pkg) ); - -Or on Pg versions that don't support DROP CONSTRAINT and ADD PRIMARY KEY (tested on 7.1 so far): -DROP INDEX part_pkg_temp_pkey; -CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg (pkgpart); -select setval('part_pkg_temp_pkgpart_seq', ( select max(pkgpart) from part_pkg) ); - -CREATE TABLE h_part_pkg_temp ( - historynum serial NOT NULL, - history_date int, - history_user varchar(80) NOT NULL, - history_action varchar(80) NOT NULL, - pkgpart int NOT NULL, - pkg varchar(80) NOT NULL, - "comment" varchar(80) NOT NULL, - setup text NULL, - freq varchar(80) NOT NULL, - recur text NULL, - setuptax char(1) NULL, - recurtax char(1) NULL, - plan varchar(80) NULL, - plandata text NULL, - disabled char(1) NULL, - taxclass varchar(80) NULL, - PRIMARY KEY (historynum) -); -INSERT INTO h_part_pkg_temp SELECT * from h_part_pkg; -DROP TABLE h_part_pkg; -ALTER TABLE h_part_pkg_temp RENAME TO h_part_pkg; -CREATE INDEX h_part_pkg1 ON h_part_pkg(disabled); - -On modern Pg: -ALTER TABLE h_part_pkg DROP CONSTRAINT h_part_pkg_temp_pkey; -ALTER TABLE h_part_pkg ADD PRIMARY KEY (historynum); -select setval('public.h_part_pkg_temp_historynum_seq', ( select max(historynum) from h_part_pkg) ); - -Or on Pg versions that don't support DROP CONSTRAINT and ADD PRIMARY KEY (tested on 7.1 so far): -DROP INDEX h_part_pkg_temp_pkey; -CREATE UNIQUE INDEX h_part_pkg_pkey ON h_part_pkg (historynum); -select setval('h_part_pkg_temp_historynum_seq', ( select max(historynum) from h_part_pkg) ); - +INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 20, 'svc_external-id', 'en_US', 'External ID' ); +INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 21, 'svc_external-title', 'en_US', 'Title' ); DROP INDEX cust_bill_pkg1; +-ALTER TABLE cust_bill_pkg ADD itemdesc varchar(80) NULL; -ALTER TABLE h_cust_bill_pkg ADD itemdesc varchar(80) NULL; -ALTER TABLE cust_main_county ADD taxname varchar(80) NULL; -ALTER TABLE h_cust_main_county ADD taxname varchar(80) NULL; -ALTER TABLE cust_main_county ADD setuptax char(1) NULL; -ALTER TABLE h_cust_main_county ADD setuptax char(1) NULL; -ALTER TABLE cust_main_county ADD recurtax char(1) NULL; -ALTER TABLE h_cust_main_county ADD recurtax char(1) NULL; -ALTER TABLE cust_pkg ADD last_bill int NULL; -ALTER TABLE h_cust_pkg ADD last_bill int NULL; -ALTER TABLE agent ADD disabled char(1) NULL; -ALTER TABLE h_agent ADD disabled char(1) NULL; -ALTER TABLE agent ADD username varchar(80) NULL; -ALTER TABLE h_agent ADD username varchar(80) NULL; -ALTER TABLE agent ADD _password varchar(80) NULL; -ALTER TABLE h_agent ADD _password varchar(80) NULL; -ALTER TABLE cust_main ADD paycvv varchar(4) NULL; -ALTER TABLE h_cust_main ADD paycvv varchar(4) NULL; -ALTER TABLE part_referral ADD disabled char(1) NULL; -ALTER TABLE h_part_referral ADD disabled char(1) NULL; -CREATE INDEX part_referral1 ON part_referral ( disabled ); -ALTER TABLE pkg_svc ADD primary_svc char(1) NULL; -ALTER TABLE h_pkg_svc ADD primary_svc char(1) NULL; -ALTER TABLE svc_forward ADD src varchar(255) NULL; -ALTER TABLE h_svc_forward ADD src varchar(255) NULL; - -On recent Pg versions: +
+ALTER TABLE cust_main ALTER COLUMN payinfo varchar(512) NULL; +ALTER TABLE h_cust_main ALTER COLUMN payinfo varchar(512) NULL; ++On older Pg versions that don't support altering columns directly, you will need to dump the database, edit the schema definitions in the dump file, and reload. +
ALTER TABLE svc_forward ALTER COLUMN srcsvc DROP NOT NULL; ALTER TABLE h_svc_forward ALTER COLUMN srcsvc DROP NOT NULL; ALTER TABLE svc_forward ALTER COLUMN dstsvc DROP NOT NULL; ALTER TABLE h_svc_forward ALTER COLUMN dstsvc DROP NOT NULL; - +ALTER TABLE cust_main ALTER COLUMN zip DROP NOT NULL; +ALTER TABLE h_cust_main ALTER COLUMN zip DROP NOT NULL; +Or on Pg versions that don't support DROP NOT NULL (tested on 7.1 and 7.2 so far): +
UPDATE pg_attribute SET attnotnull = FALSE WHERE ( attname = 'srcsvc' OR attname = 'dstsvc' ) AND ( attrelid = ( SELECT oid FROM pg_class WHERE relname = 'svc_forward' ) OR attrelid = ( SELECT oid FROM pg_class WHERE relname = 'h_svc_forward' ) ); +UPDATE pg_attribute SET attnotnull = FALSE WHERE ( attname = 'zip' ) AND ( attrelid = ( SELECT oid FROM pg_class WHERE relname = 'cust_main' ) OR attrelid = ( SELECT oid FROM pg_class WHERE relname = 'h_cust_main' ) ); +-If you created your database with a version before 1.4.2, dump database, edit: -- cust_main: increase otaker from 8 to 32 -- cust_main: change ss from char(11) to varchar(11) -- cust_credit: increase otaker from 8 to 32 -- cust_pkg: increase otaker from 8 to 32 -- cust_refund: increase otaker from 8 to 32 -- domain_record: increase reczone from 80 to 255 -- domain_record: change rectype from char to varchar -- domain_record: increase recdata from 80 to 255 -then reload - -optionally: - - CREATE INDEX cust_main6 ON cust_main ( daytime ); - CREATE INDEX cust_main7 ON cust_main ( night ); - CREATE INDEX cust_main8 ON cust_main ( fax ); - CREATE INDEX cust_main9 ON cust_main ( ship_daytime ); - CREATE INDEX cust_main10 ON cust_main ( ship_night ); - CREATE INDEX cust_main11 ON cust_main ( ship_fax ); - CREATE INDEX agent2 ON agent ( disabled ); - CREATE INDEX part_bill_event2 ON part_bill_event ( disabled ); - - serial columns - -mandatory again: - -dbdef-create username -create-history-tables username cust_bill_pkg_detail router part_svc_router addr_block svc_broadband acct_snarf svc_external -dbdef-create username +
+CREATE INDEX cust_main4 ON cust_main ( daytime ); +CREATE INDEX cust_main5 ON cust_main ( night ); +CREATE INDEX cust_main6 ON cust_main ( fax ); +CREATE INDEX cust_main7 ON cust_main ( refnum ); +CREATE INDEX cust_main8 ON cust_main ( county ); +CREATE INDEX cust_main9 ON cust_main ( state ); +CREATE INDEX cust_main10 ON cust_main ( country ); +CREATE INDEX cust_main11 ON cust_main ( ship_last ); +CREATE INDEX cust_main12 ON cust_main ( ship_company ); +CREATE INDEX cust_main13 ON cust_main ( ship_daytime ); +CREATE INDEX cust_main14 ON cust_main ( ship_night ); +CREATE INDEX cust_main15 ON cust_main ( ship_fax ); +CREATE INDEX agent2 ON agent ( disabled ); +CREATE INDEX part_bill_event2 ON part_bill_event ( disabled ); +CREATE INDEX cust_pay4 ON cust_pay (_date); +CREATE INDEX part_referral1 ON part_referral ( disabled ); +CREATE INDEX part_pkg2 ON part_pkg ( promo_code ); +CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code ); +-apache - fix