landing RT 3.2.2
[freeside.git] / README.1.5.0pre7
1 CREATE TABLE rate (
2     ratenum serial NOT NULL,
3     ratename varchar(80) NOT NULL,
4     PRIMARY KEY (ratenum)
5 );
6
7 CREATE TABLE rate_detail (
8     ratenum int NOT NULL,
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
14 );
15 CREATE UNIQUE INDEX rate_detail1 ON rate_detail ( ratenum, orig_regionnum, dest_regionnum );
16
17 CREATE TABLE rate_region (
18     regionnum serial NOT NULL,
19     regionname varchar(80) NOT NULL,
20     PRIMARY KEY (regionnum)
21 );
22
23 CREATE TABLE rate_prefix (
24     prefixnum serial NOT NULL,
25     regionnum int NOT NULL, 
26     countrycode varchar(3) NOT NULL,
27     npa varchar(4) NULL,
28     nxx varchar(3) NULL,
29     PRIMARY KEY (prefixnum)
30 );
31 CREATE INDEX rate_prefix1 ON rate_prefix ( countrycode );
32 CREATE INDEX rate_prefix2 ON rate_prefix ( regionnum );
33
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 );
38
39 Installs w/integrated RT:
40   CREATE SEQUENCE attributes_id_seq;
41
42   CREATE TABLE Attributes (
43     id INTEGER DEFAULT nextval('attributes_id_seq'),
44     Name varchar(255) NOT NULL  ,
45     Description varchar(255) NULL  ,
46     Content text,
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  ,
54     PRIMARY KEY (id)
55   
56   );
57   
58   CREATE INDEX Attributes1 on Attributes(Name);
59   CREATE INDEX Attributes2 on Attributes(ObjectType, ObjectId);
60
61
62 dbdef-create username
63 create-history-tables username rate rate_detail rate_region rate_prefix
64 dbdef-create username
65
66
67 afterwords (for installs w/integrated RT):
68 make configure-rt
69 make deploy
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
72