[vhffs-dev] [2151] small mirror tables improvements

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2151
Author:   gradator
Date:     2012-04-16 01:11:19 +0200 (Mon, 16 Apr 2012)
Log Message:
-----------
small mirror tables improvements

Modified Paths:
--------------
    trunk/vhffs-backend/src/mirror/mx2-mirror.sql
    trunk/vhffs-backend/src/mirror/mydns-mirror.sql

Modified: trunk/vhffs-backend/src/mirror/mx2-mirror.sql
===================================================================
--- trunk/vhffs-backend/src/mirror/mx2-mirror.sql	2012-04-15 22:57:52 UTC (rev 2150)
+++ trunk/vhffs-backend/src/mirror/mx2-mirror.sql	2012-04-15 23:11:19 UTC (rev 2151)
@@ -3,11 +3,11 @@
 	domain varchar NOT NULL,
 	CONSTRAINT vhffs_mx2_unique_mx_id PRIMARY KEY (mx_id),
 	CONSTRAINT vhffs_mx2_unique_domain UNIQUE (domain)
-);
+) WITH (OIDS);
 
 CREATE TABLE vhffs_mx2_localpart (
 	mx_id int4 NOT NULL,
 	localpart varchar NOT NULL,
 	CONSTRAINT vhffs_mx2_localpart_unique_mx_id_localpart PRIMARY KEY (mx_id, localpart),
 	CONSTRAINT fk_vhffs_mx2_localpart_vhffs_mx2 FOREIGN KEY (mx_id) REFERENCES vhffs_mx2(mx_id) ON DELETE CASCADE
-);
+) WITH (OIDS);

Modified: trunk/vhffs-backend/src/mirror/mydns-mirror.sql
===================================================================
--- trunk/vhffs-backend/src/mirror/mydns-mirror.sql	2012-04-15 22:57:52 UTC (rev 2150)
+++ trunk/vhffs-backend/src/mirror/mydns-mirror.sql	2012-04-15 23:11:19 UTC (rev 2151)
@@ -1,33 +1,30 @@
-CREATE TABLE vhffs_dns_soa
-(
-    id serial,
-    origin varchar(255) NOT NULL,
-    ns varchar(255) NOT NULL,
-    mbox varchar(255) NOT NULL,
-    serial INTEGER NOT NULL DEFAULT 1,
-    refresh INTEGER NOT NULL DEFAULT 28800,
-    retry INTEGER NOT NULL DEFAULT 7200,
-    expire INTEGER NOT NULL DEFAULT 604800,
-    minimum INTEGER NOT NULL DEFAULT 86400,
-    ttl INTEGER NOT NULL DEFAULT 86400,
-    CONSTRAINT vhffs_dns_soa_pkey PRIMARY KEY (id)
-) WITH OIDS;
+CREATE TABLE vhffs_dns_soa (
+	id INTEGER NOT NULL,
+	origin varchar(255) NOT NULL,
+	ns varchar(255) NOT NULL,
+	mbox varchar(255) NOT NULL,
+	serial INTEGER NOT NULL DEFAULT 1,
+	refresh INTEGER NOT NULL DEFAULT 28800,
+	retry INTEGER NOT NULL DEFAULT 7200,
+	expire INTEGER NOT NULL DEFAULT 604800,
+	minimum INTEGER NOT NULL DEFAULT 86400,
+	ttl INTEGER NOT NULL DEFAULT 86400,
+	CONSTRAINT vhffs_dns_soa_pkey PRIMARY KEY (id),
+	CONSTRAINT vhffs_dns_unique_origin UNIQUE (origin)
+) WITH (OIDS);
 
 CREATE TABLE vhffs_dns_rr (
-    id serial,
-    zone INTEGER NOT NULL,
-    name varchar(64) NOT NULL,
-    type VARCHAR(5) NOT NULL,
-    data varchar(512) NOT NULL,
-    aux INTEGER NOT NULL DEFAULT 0,
-    ttl INTEGER NOT NULL DEFAULT 86400,
-    CONSTRAINT vhffs_dns_rr_pkey PRIMARY KEY (id)
-) WITH OIDS;
-
-ALTER TABLE vhffs_dns_rr ADD CONSTRAINT fk_vhffs_dns_rr_vhffs_dns_soa FOREIGN KEY (zone) REFERENCES vhffs_dns_soa(id) ON DELETE CASCADE;
-ALTER TABLE vhffs_dns_rr ADD CONSTRAINT fk_vhffs_dns_rr_chk_type CHECK (type='A' OR type='AAAA' OR type='CNAME' OR type='HINFO' OR type='MX' OR type='NS' OR type='PTR' OR type='RP' OR type='SRV' OR type='TXT');
+	id INTEGER NOT NULL,
+	zone INTEGER NOT NULL,
+	name varchar(64) NOT NULL,
+	type VARCHAR(5) NOT NULL,
+	data varchar(512) NOT NULL,
+	aux INTEGER NOT NULL DEFAULT 0,
+	ttl INTEGER NOT NULL DEFAULT 86400,
+	CONSTRAINT vhffs_dns_rr_pkey PRIMARY KEY (id),
+	CONSTRAINT fk_vhffs_dns_rr_chk_type CHECK (type='A' OR type='AAAA' OR type='CNAME' OR type='HINFO' OR type='MX' OR type='NS' OR type='PTR' OR type='RP' OR type='SRV' OR type='TXT'),
+	CONSTRAINT fk_vhffs_dns_rr_vhffs_dns_soa FOREIGN KEY (zone) REFERENCES vhffs_dns_soa(id) ON DELETE CASCADE
+) WITH (OIDS);
 CREATE INDEX idx_vhffs_dns_rr_zone ON vhffs_dns_rr(zone);
 CREATE INDEX idx_vhffs_dns_rr_type ON vhffs_dns_rr(type);
 CREATE INDEX idx_vhffs_dns_rr_name ON vhffs_dns_rr(name);
-
-ALTER TABLE vhffs_dns_soa ADD CONSTRAINT vhffs_dns_unique_origin UNIQUE (origin);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/