Apache::ASP | Mason |
---|---|
|
|
$ su # make install-perl-modules
CREATE TABLE svc_forward ( svcnum int NOT NULL, srcsvc int NOT NULL, dstsvc int NOT NULL, dst varchar(80), PRIMARY KEY (svcnum) ); CREATE TABLE cust_credit_bill ( creditbillnum int primary key, crednum int not null, invnum int not null, _date int not null, amount decimal(10,2) not null ); CREATE TABLE cust_bill_pay ( billpaynum int primary key, invnum int not null, paynum int not null, _date int not null, amount decimal(10,2) not null ); CREATE TABLE cust_credit_refund ( creditrefundnum int primary key, crednum int not null, refundnum int not null, _date int not null, amount decimal(10,2) not null ); CREATE TABLE part_svc_column ( columnnum int primary key, svcpart int not null, columnname varchar(64) not null, columnvalue varchar(80) null, columnflag char(1) null ); CREATE TABLE queue ( jobnum int primary key, job varchar not null, _date int not null, status varchar(80) not null ); CREATE TABLE queue_arg ( argnum int primary key, jobnum int not null, arg varchar null ); CREATE INDEX queue_arg1 ON queue_arg ( jobnum ); CREATE TABLE part_pop_local ( localnum int primary key, popnum int not null, city varchar(80) null, state char(2) null, npa char(3) not null, nxx char(3) not null ); CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx ); ALTER TABLE svc_acct ADD domsvc integer NOT NULL; ALTER TABLE svc_domain ADD catchall integer NULL; ALTER TABLE cust_main ADD referral_custnum integer NULL; ALTER TABLE cust_pay ADD custnum integer; ALTER TABLE cust_pay_batch ADD paybatchnum integer; ALTER TABLE cust_refund ADD custnum integer; ALTER TABLE cust_pkg ADD manual_flag char(1) NULL; ALTER TABLE part_pkg ADD plan varchar NULL; ALTER TABLE part_pkg ADD plandata varchar NULL; ALTER TABLE part_pkg ADD setuptax char(1) NULL; ALTER TABLE part_pkg ADD recurtax char(1) NULL; CREATE INDEX cust_main3 ON cust_main ( referral_custnum ); CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum ); CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum ); CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum ); CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum ); CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum ); CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum ); CREATE UNIQUE INDEX cust_pay_batch_pkey ON cust_pay_batch ( paybatchnum ); CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname );
CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum ); CREATE UNIQUE INDEX agent_type_pkey ON agent_type ( typenum ); CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum ); CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum ); CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum ); CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum ); CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum ); CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum ); CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum ); CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum ); CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum ); CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum ); CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum ); CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart ); CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum ); CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart ); CREATE UNIQUE INDEX port_pkey ON port ( portnum ); CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum ); CREATE UNIQUE INDEX session_pkey ON session ( sessionnum ); CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum ); CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum ); CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum ); CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum ); CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum ); CREATE UNIQUE INDEX type_pkgs_pkey ON type_pkgs ( typenum );
ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL; ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL; ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL; ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL; ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL; ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL; CREATE INDEX cust_main1 ON cust_main ( ship_last ); CREATE INDEX cust_main2 ON cust_main ( ship_company );
ALTER TABLE cust_main ADD COLUMN comments varchar NULL;
PostgreSQL | MySQL, others |
---|---|
CREATE TABLE cust_pay_temp ( paynum int primary key, custnum int not null, paid decimal(10,2) not null, _date int null, payby char(4) not null, payinfo varchar(16) null, paybatch varchar(80) null ); INSERT INTO cust_pay_temp SELECT * from cust_pay; DROP TABLE cust_pay; ALTER TABLE cust_pay_temp RENAME TO cust_pay; CREATE UNIQUE INDEX cust_pay1 ON cust_pay (paynum); CREATE TABLE cust_refund_temp ( refundnum int primary key, custnum int not null, _date int null, refund decimal(10,2) not null, otaker varchar(8) not null, reason varchar(80) not null, payby char(4) not null, payinfo varchar(16) null, paybatch varchar(80) null ); INSERT INTO cust_refund_temp SELECT * from cust_refund; DROP TABLE cust_refund; ALTER TABLE cust_refund_temp RENAME TO cust_refund; CREATE UNIQUE INDEX cust_refund1 ON cust_refund (refundnum); |
ALTER TABLE cust_pay DROP COLUMN invnum; ALTER TABLE cust_refund DROP COLUMN crednum; |