Changeset 347


Ignore:
Timestamp:
06/15/12 18:08:14 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Clean up dns.sql a little; some of this will be more important once
automagical table upgrades are implemented

  • set primary keys so we can't even accidentally add duplicate domains or revzones
  • bump dbversion in misc table

Fix buglet in _hostparent() that triggered if the hostname passed in
started with *.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r346 r347  
    296296  my $dbh = shift;
    297297  my $hname = shift;
    298  
     298
     299  $hname =~ s/^\*\.//;  # this should be impossible to find in the domains table.
    299300  my @hostbits = split /\./, $hname;
    300301  my $sth = $dbh->prepare("SELECT count(*),domain_id FROM domains WHERE domain = ? GROUP BY domain_id");
  • trunk/dns.sql

    r342 r347  
    1414
    1515COPY misc (misc_id, key, value) FROM stdin;
    16 1       dbversion       1.0
     161       dbversion       1.2
    1717\.
    1818
     
    6060CREATE TABLE domains (
    6161    domain_id serial NOT NULL,
    62     "domain" character varying(80) NOT NULL,
     62    "domain" character varying(80) NOT NULL PRIMARY KEY,
    6363    group_id integer DEFAULT 1 NOT NULL,
    6464    description character varying(255) DEFAULT ''::character varying NOT NULL,
     
    7070CREATE TABLE revzones (
    7171    rdns_id serial NOT NULL,
    72     revnet cidr NOT NULL,
     72    revnet cidr NOT NULL PRIMARY KEY,
    7373    group_id integer DEFAULT 1 NOT NULL,
    7474    description character varying(255) DEFAULT ''::character varying NOT NULL,
Note: See TracChangeset for help on using the changeset viewer.