2 ratenum serial NOT NULL,
3 ratename varchar(80) NOT NULL,
7 CREATE TABLE rate_detail (
9 orig_regionnum int NULL,
10 dest_regionnum int NOT NULL,
11 min_included int NOT NULL,
12 min_charge decimal(10,2) NOT NULL,
13 sec_granularity int NOT NULL
15 CREATE UNIQUE INDEX rate_detail1 ON rate_detail ( ratenum, orig_regionnum, dest_regionnum );
17 CREATE TABLE rate_region (
18 regionnum serial NOT NULL,
19 regionname varchar(80) NOT NULL,
20 PRIMARY KEY (regionnum)
23 CREATE TABLE rate_prefix (
24 prefixnum serial NOT NULL,
25 regionnum int NOT NULL,
26 countrycode varchar(3) NOT NULL,
29 PRIMARY KEY (prefixnum)
31 CREATE INDEX rate_prefix1 ON rate_prefix ( countrycode );
32 CREATE INDEX rate_prefix2 ON rate_prefix ( regionnum );
34 ALTER TABLE part_pkg ADD promo_code varchar(80) NULL;
35 ALTER TABLE h_part_pkg ADD promo_code varchar(80) NULL;
36 CREATE INDEX part_pkg2 ON part_pkg ( promo_code );
37 CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code );
39 Installs w/integrated RT:
40 CREATE SEQUENCE attributes_id_seq;
42 CREATE TABLE Attributes (
43 id INTEGER DEFAULT nextval('attributes_id_seq'),
44 Name varchar(255) NOT NULL ,
45 Description varchar(255) NULL ,
47 ContentType varchar(16),
48 ObjectType varchar(64),
49 ObjectId integer, -- foreign key to anything
50 Creator integer NOT NULL DEFAULT 0 ,
51 Created TIMESTAMP NULL ,
52 LastUpdatedBy integer NOT NULL DEFAULT 0 ,
53 LastUpdated TIMESTAMP NULL ,
58 CREATE INDEX Attributes1 on Attributes(Name);
59 CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
63 create-history-tables username rate rate_detail rate_region rate_prefix
67 afterwords (for installs w/integrated RT):
70 /opt/rt3/sbin/rt-setup-database --action insert --datadir etc/upgrade/3.1.15
71 /opt/rt3/sbin/rt-setup-database --action insert --datadir etc/upgrade/3.1.17