[vhffs-dev] [671] Removed active field from vhffs_dns_soa.

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


Revision: 671
Author:   beuss
Date:     2007-07-05 21:52:17 +0000 (Thu, 05 Jul 2007)

Log Message:
-----------
Removed active field from vhffs_dns_soa. Since it is a view, we can filter data.

Modified Paths:
--------------
    trunk/vhffs-backend/src/mirror/mydns-mirror.pl
    trunk/vhffs-backend/src/pgsql/initdb.sql.in
    trunk/vhffs-compat/4.0.sql.in


Modified: trunk/vhffs-backend/src/mirror/mydns-mirror.pl
===================================================================
--- trunk/vhffs-backend/src/mirror/mydns-mirror.pl	2007-07-05 20:59:50 UTC (rev 670)
+++ trunk/vhffs-backend/src/mirror/mydns-mirror.pl	2007-07-05 21:52:17 UTC (rev 671)
@@ -32,9 +32,7 @@
 # Mirroring script for myDNS.
 # Set master & slave DB params and put it in a cron.
 # Slave database must have at least vhffs_dns_soa and
-# vhffs_dns_rr tables (vhffs_dns_soa shouldn't have
-# the active field or it should default to true since we
-# filter before inserting).
+# vhffs_dns_rr tables
 
 use DBI;
 use strict;
@@ -75,7 +73,7 @@
 $master_dbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE') or die("Unable to set transaction level on master DB\n");
 
 # Replicate vhffs_dns_soa table
-my $msth = $master_dbh->prepare(q{SELECT id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl FROM vhffs_dns_soa WHERE active = 1});
+my $msth = $master_dbh->prepare(q{SELECT id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl FROM vhffs_dns_soa});
 my $ssth = $slave_dbh->prepare('INSERT INTO tmp_dns_soa(id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)') or die("Unable to prepare INSERT query for tmp_dns_soa\n");
 
 $msth->execute();
@@ -92,7 +90,7 @@
 
 # Replicate vhffs_dns_rr table
 
-$msth = $master_dbh->prepare(q{SELECT r.id, r.zone, r.name, r.type, r.data, r.aux, r.ttl FROM vhffs_dns_rr r INNER JOIN vhffs_dns_soa s ON r.zone = s.id WHERE s.active = 1}) or die("Unable to prepare resource records SELECT statement\n");
+$msth = $master_dbh->prepare(q{SELECT r.id, r.zone, r.name, r.type, r.data, r.aux, r.ttl FROM vhffs_dns_rr r INNER JOIN vhffs_dns_soa s ON r.zone = s.id}) or die("Unable to prepare resource records SELECT statement\n");
 $ssth = $slave_dbh->prepare(q{INSERT INTO tmp_dns_rr(id, zone, name, type, data, aux, ttl) VALUES(?, ?, ?, ?, ?, ?, ?)});
 
 $msth->execute();

Modified: trunk/vhffs-backend/src/pgsql/initdb.sql.in
===================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql.in	2007-07-05 20:59:50 UTC (rev 670)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in	2007-07-05 21:52:17 UTC (rev 671)
@@ -385,5 +385,5 @@
 WHERE object.object_id=users.object_id;
 
 CREATE VIEW vhffs_dns_soa AS
-SELECT dns.dns_id AS id, dns.domain || '.' AS origin , dns.ns, dns.mbox, dns.serial, dns.refresh, dns.retry, dns.expire, dns.minimum, dns.ttl, (o.state = 6) AS active                     
-FROM vhffs_dns dns, vhffs_object o WHERE o.object_id=dns.object_id;
+SELECT dns.dns_id AS id, dns.domain || '.' AS origin , dns.ns, dns.mbox, dns.serial, dns.refresh, dns.retry, dns.expire, dns.minimum, dns.ttl
+FROM vhffs_dns dns INNER JOIN vhffs_object o ON o.object_id=dns.object_id WHERE o.state = 6;

Modified: trunk/vhffs-compat/4.0.sql.in
===================================================================
--- trunk/vhffs-compat/4.0.sql.in	2007-07-05 20:59:50 UTC (rev 670)
+++ trunk/vhffs-compat/4.0.sql.in	2007-07-05 21:52:17 UTC (rev 671)
@@ -206,8 +206,8 @@
 
 -- create vhffs_dns_soa view
 CREATE VIEW vhffs_dns_soa AS
-SELECT dns.dns_id AS id, dns.domain || '.' AS origin , dns.ns, dns.mbox, dns.serial, dns.refresh, dns.retry, dns.expire, dns.minimum, dns.ttl, (o.state = 6) AS active
-FROM vhffs_dns dns, vhffs_object o WHERE o.object_id=dns.object_id;
+SELECT dns.dns_id AS id, dns.domain || '.' AS origin , dns.ns, dns.mbox, dns.serial, dns.refresh, dns.retry, dns.expire, dns.minimum, dns.ttl
+FROM vhffs_dns dns INNER JOIN vhffs_object o ON o.object_id=dns.object_id WHERE o.state = 6;
 
 -- update vhffs_forum view, it has been dropped by drop column state in vhffs_object
 CREATE VIEW vhffs_forum AS


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