X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fdocs%2Fupgrade10.html;h=6f7924fb67299d8b312cf10954830b4bc1411d9b;hb=6db0053308daae19135066c5bf4d20e82f0a5780;hp=4460905035cef07b55d5693d5927b076b82cd1b8;hpb=ea1d9968a9439272b58593e6b2ccbb3869002b20;p=freeside.git diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html index 446090503..6f7924fb6 100644 --- a/httemplate/docs/upgrade10.html +++ b/httemplate/docs/upgrade10.html @@ -1,9 +1,12 @@
this is incomplete -install DBIx::DBSchema 0.21 +install DBD::Pg 1.32 (or, if you're using a Perl version before 5.6, you could try installing DBD::Pg 1.22 with this patch and commenting out the "use DBD::Pg 1.32" at the top of DBIx/DBSchema/DBD/Pg.pm) +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 and Chart::Base +install NetAddr::IP, Chart::Base, IPC::ShareLite and Locale::SubCountry CREATE TABLE cust_bill_pkg_detail ( detailnum serial, @@ -73,6 +76,13 @@ CREATE TABLE acct_snarf ( ); 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, @@ -86,15 +96,22 @@ CREATE TABLE part_pkg_temp ( plandata text NULL, disabled char(1) NULL, taxclass varchar(80) NULL, - PRIMARY KEY (pkgpart), + 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); -CREATE INDEX part_pkg1 ON part_pkg(disabled); -select setval('public.part_pkg_temp_pkgpart_seq', ( select max(pkgpart) from part_pkg) ); #? +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, @@ -118,11 +135,18 @@ CREATE TABLE h_part_pkg_temp ( 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); -CREATE INDEX h_part_pkg1 ON h_part_pkg(disabled); 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) ); + DROP INDEX cust_bill_pkg1; @@ -142,16 +166,35 @@ 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; - -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 +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 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; + +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' ) ); + +If you created your database with a version before 1.4.2, dump database, edit: +- cust_main and h_cust_main: increase otaker from 8 to 32 +- cust_main and h_cust_main: change ss from char(11) to varchar(11) +- cust_credit and h_cust_credit: increase otaker from 8 to 32 +- cust_pkg and h_cust_pkg: increase otaker from 8 to 32 +- cust_refund and h_cust_refund: increase otaker from 8 to 32 +- domain_record and h_domain_record: increase reczone from 80 to 255 +- domain_record and h_domain_record: change rectype from char to varchar +- domain_record and h_domain_record: increase recdata from 80 to 255 then reload optionally: @@ -162,13 +205,16 @@ optionally: 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 ); + CREATE INDEX cust_pay4 ON cust_pay (_date); 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 +create-history-tables username cust_bill_pkg_detail router part_svc_router addr_block svc_broadband acct_snarf svc_external dbdef-create username apache - fixsections to include .html also