freeside/httemplate/docs upgrade10.html,1.47,1.48 schema.html,1.48,1.49
ivan
ivan at pouncequick.420.am
Sat Apr 2 14:46:47 PST 2005
Update of /home/cvs/cvsroot/freeside/httemplate/docs
In directory pouncequick:/tmp/cvs-serv16493/httemplate/docs
Modified Files:
upgrade10.html schema.html
Log Message:
herding elephants: add primary keys to *all* tables for slony
Index: upgrade10.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/docs/upgrade10.html,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- upgrade10.html 31 Mar 2005 05:02:51 -0000 1.47
+++ upgrade10.html 2 Apr 2005 22:46:44 -0000 1.48
@@ -52,8 +52,10 @@
);
CREATE TABLE part_svc_router (
+ svcrouternum serial,
svcpart int NOT NULL,
- routernum int NOT NULL
+ routernum int NOT NULL,
+ PRIMARY KEY (svcrouternum),
);
CREATE TABLE addr_block (
@@ -186,10 +188,11 @@
CREATE INDEX cust_pay_void1 ON cust_pay_void(custnum);
CREATE TABLE part_pkg_option (
- optionnum int primary key,
+ optionnum serial,
pkgpart int not null,
optionname varchar(80) not null,
optionvalue text NULL
+ PRIMARY KEY (optionnum),
);
CREATE INDEX part_pkg_option1 ON part_pkg_option ( pkgpart );
CREATE INDEX part_pkg_option2 ON part_pkg_option ( optionname );
@@ -201,12 +204,14 @@
);
CREATE TABLE rate_detail (
+ ratedetailnum serial NOT NULL,
ratenum int NOT NULL,
orig_regionnum int NULL,
dest_regionnum int NOT NULL,
min_included int NOT NULL,
min_charge decimal(10,2) NOT NULL,
- sec_granularity int NOT NULL
+ sec_granularity int NOT NULL,
+ PRIMARY KEY (ratedetailnum)
);
CREATE UNIQUE INDEX rate_detail1 ON rate_detail ( ratenum, orig_regionnum, dest_regionnum );
@@ -237,8 +242,10 @@
CREATE INDEX reg_code2 ON reg_code ( agentnum );
CREATE TABLE reg_code_pkg (
+ codepkgnum serial,
codenum int NOT NULL,
pkgpart int NOT NULL
+ PRIMARY KEY (codepkgnum)
);
CREATE UNIQUE INDEX reg_code_pkg1 ON reg_code_pkg ( codenum, pkgpart );
CREATE INDEX reg_code_pkg2 ON reg_code_pkg ( codenum );
@@ -297,6 +304,24 @@
CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code );
ALTER TABLE prepay_credit ADD agentnum integer NULL;
ALTER TABLE h_prepay_credit ADD agentnum integer NULL;
+
+ALTER TABLE type_pkgs ADD typepkgnum int;
+ALTER TABLE type_pkgs ALTER COLUMN typepkgnum SET DEFAULT nextval('public.type_pkgs_typepkgnum_seq'::text);
+CREATE SEQUENCE type_pkgs_typepkgnum_seq;
+ALTER TABLE type_pkgs ALTER typepkgnum SET NOT NULL;
+ALTER TABLE type_pkgs ADD PRIMARY KEY (typepkgnum);
+
+ALTER TABLE cust_bill_pkg ADD billpkgnum int;
+ALTER TABLE cust_bill_pkg ALTER COLUMN billpkgnum SET DEFAULT nextval('public.cust_bill_pkg_billpkgnum_seq'::text);
+CREATE SEQUENCE cust_bill_pkg_billpkgnum_seq;
+ALTER TABLE cust_bill_pkg ALTER billpkgnum SET NOT NULL;
+ALTER TABLE cust_bill_pkg ADD PRIMARY KEY (billpkgnum);
+
+ALTER TABLE pkg_svc ADD pkgsvcnum int;
+ALTER TABLE pkg_svc ALTER COLUMN pkgsvcnum SET DEFAULT nextval('public.pkg_svc_pkgsvcnum_seq'::text);
+CREATE SEQUENCE pkg_svc_pkgsvcnum_seq;
+ALTER TABLE pkg_svc ALTER pkgsvcnum SET NOT NULL;
+ALTER TABLE pkg_svc ADD PRIMARY KEY (pkgsvcnum);
On recent Pg versions:
Index: schema.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/docs/schema.html,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- schema.html 12 Mar 2005 14:31:45 -0000 1.48
+++ schema.html 2 Apr 2005 22:46:44 -0000 1.49
@@ -23,6 +23,7 @@
</ul>
<li><a name="cust_bill" href="man/FS/cust_bill.html">cust_bill</a> - Invoices. Declarations that a customer owes you money. The specific charges are itemized in <a href="#cust_bill_pkg">cust_bill_pkg</a>.
<ul>
+ <li>billpkgnum - primary_key
<li>invnum - primary key
<li>custnum - <a href="#cust_main">customer</a>
<li>_date
@@ -293,6 +294,7 @@
</ul>
<li><a name="reg_code_pkg" href="man/FS/reg_code_pkg.html">reg_code_pkg</A> - Registration code link to package definitions
<ul>
+ <li>codepkgnum - primary key
<li>codenum - <a href="#reg_code">Registration code</a>
<li>pkgpart - <a href="#part_pkg">Package definition</a>
</ul>
@@ -321,6 +323,7 @@
</ul>
<li><a name="pkg_svc" href="man/FS/pkg_svc.html">pkg_svc</a>
<ul>
+ <li>pkgsvcnum - primary key
<li>pkgpart - <a href="#part_pkg">Package definition</a>
<li>svcpart - <a href="#part_svc">Service definition</a>
<li>quantity - quantity of this service that this package includes
@@ -437,6 +440,7 @@
</ul>
<li><a name="type_pkgs" href="man/FS/type_pkgs.html">type_pkgs</a>
<ul>
+ <li>typepkgnum - primary key
<li>typenum - <a href="#agent_type">agent type</a>
<li>pkgpart - <a href="#part_pkg">Package definition</a>
</ul>
@@ -474,6 +478,7 @@
</ul>
<li><a name="rate_detail" href="man/FS/rate_detail.html">rate_detail</a> - Call rate detail
<ul>
+ <li>ratedetailnum - primary key
<li>ratenum - <a href="#rate">rate plan</a>
<li>orig_regionnum - call origination <a href="#rate_region">region</a>
<li>dest_regionnum - call destination <a href="#rate_region">region</a>
More information about the freeside-commits
mailing list