1 NOTE: Version numbering has been simplified. 1.5.7 is the version after
2 1.5.0pre6. It is still a development version - releases with odd numbered
3 middle parts (NN in x.NN.x) are development versions, like Perl or Linux.
7 ratenum serial NOT NULL,
8 ratename varchar(80) NOT NULL,
12 CREATE TABLE rate_detail (
14 orig_regionnum int NULL,
15 dest_regionnum int NOT NULL,
16 min_included int NOT NULL,
17 min_charge decimal(10,2) NOT NULL,
18 sec_granularity int NOT NULL
20 CREATE UNIQUE INDEX rate_detail1 ON rate_detail ( ratenum, orig_regionnum, dest_regionnum );
22 CREATE TABLE rate_region (
23 regionnum serial NOT NULL,
24 regionname varchar(80) NOT NULL,
25 PRIMARY KEY (regionnum)
28 CREATE TABLE rate_prefix (
29 prefixnum serial NOT NULL,
30 regionnum int NOT NULL,
31 countrycode varchar(3) NOT NULL,
34 PRIMARY KEY (prefixnum)
36 CREATE INDEX rate_prefix1 ON rate_prefix ( countrycode );
37 CREATE INDEX rate_prefix2 ON rate_prefix ( regionnum );
39 CREATE TABLE reg_code (
40 codenum serial NOT NULL,
41 code varchar(80) NOT NULL,
42 agentnum int NOT NULL,
45 CREATE UNIQUE INDEX reg_code1 ON reg_code ( agentnum, code );
46 CREATE INDEX reg_code2 ON reg_code ( agentnum );
48 CREATE TABLE reg_code_pkg (
52 CREATE UNIQUE INDEX reg_code_pkg1 ON reg_code_pkg ( codenum, pkgpart );
53 CREATE INDEX reg_code_pkg2 ON reg_code_pkg ( codenum );
55 CREATE TABLE clientapi_session (
56 sessionnum serial NOT NULL,
57 sessionid varchar(80) NOT NULL,
58 namespace varchar(80) NOT NULL,
59 PRIMARY KEY (sessionnum)
61 CREATE UNIQUE INDEX clientapi_session1 ON clientapi_session ( sessionid, namespace );
63 CREATE TABLE clientapi_session_field (
64 fieldnum serial NOT NULL,
65 sessionnum int NOT NULL,
66 fieldname varchar(80) NOT NULL,
68 PRIMARY KEY (fieldnum)
70 CREATE UNIQUE INDEX clientapi_session_field1 ON clientapi_session_field ( sessionnum, fieldname );
72 ALTER TABLE part_pkg ADD promo_code varchar(80) NULL;
73 ALTER TABLE h_part_pkg ADD promo_code varchar(80) NULL;
74 CREATE INDEX part_pkg2 ON part_pkg ( promo_code );
75 CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code );
77 ALTER TABLE cust_main ALTER COLUMN zip DROP NOT NULL;
78 ALTER TABLE h_cust_main ALTER COLUMN zip DROP NOT NULL;
80 Installs w/integrated RT:
81 CREATE SEQUENCE attributes_id_seq;
83 CREATE TABLE Attributes (
84 id INTEGER DEFAULT nextval('attributes_id_seq'),
85 Name varchar(255) NOT NULL ,
86 Description varchar(255) NULL ,
88 ContentType varchar(16),
89 ObjectType varchar(64),
90 ObjectId integer, -- foreign key to anything
91 Creator integer NOT NULL DEFAULT 0 ,
92 Created TIMESTAMP NULL ,
93 LastUpdatedBy integer NOT NULL DEFAULT 0 ,
94 LastUpdated TIMESTAMP NULL ,
99 CREATE INDEX Attributes1 on Attributes(Name);
100 CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
103 dbdef-create username
104 create-history-tables username rate rate_detail rate_region rate_prefix reg_code reg_code_pkg
105 dbdef-create username
107 install Javascript::RPC (JavaScript::RPC::Server::CGI), Text::CSV_XS,
108 Spreadsheet::WriteExcel and IO-stringy (IO::Scalar)
110 afterwords (for installs w/integrated RT):
113 /opt/rt3/sbin/rt-setup-database --action insert --datadir etc/upgrade/3.1.15
114 /opt/rt3/sbin/rt-setup-database --action insert --datadir etc/upgrade/3.1.17