Changeset 718


Ignore:
Timestamp:
04/29/16 16:39:12 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Refine SQL initial definition and 1.2.6 update file to match each other
and production.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-upd-1.2.6.sql

    r704 r718  
    22
    33-- Allow zones to be duplicated, so long as each version is in a unique location
    4 ALTER TABLE domains DROP CONSTRAINT domains_pkey;
    5 ALTER TABLE domains ADD PRIMARY KEY (domain,default_location);
     4ALTER TABLE ONLY domains
     5    DROP CONSTRAINT domains_pkey;
     6ALTER TABLE ONLY domains
     7    ADD PRIMARY KEY (domain,default_location);
    68
    7 ALTER TABLE revzones DROP CONSTRAINT revzones_pkey;
    8 ALTER TABLE revzones ADD PRIMARY KEY (revnet,default_location);
     9ALTER TABLE ONLY revzones
     10    DROP CONSTRAINT revzones_pkey;
     11ALTER TABLE ONLY revzones
     12    ADD PRIMARY KEY (revnet,default_location);
     13
     14-- MIA unique constraint to match domains table.  Arguably not strictly necessary.
     15ALTER TABLE ONLY revzones
     16    ADD CONSTRAINT revzones_rdns_id_key UNIQUE (rdns_id);
     17
     18-- Update dbversion
     19UPDATE misc SET value='1.2.6' WHERE key='dbversion';
  • trunk/dns.sql

    r599 r718  
    3131
    3232COPY misc (misc_id, key, value) FROM stdin;
    33 1       dbversion       1.2.4
     331       dbversion       1.2.6
    3434\.
    3535
     
    8686CREATE TABLE domains (
    8787    domain_id serial NOT NULL,
    88     "domain" character varying(80) NOT NULL PRIMARY KEY,
     88    "domain" character varying(80) NOT NULL,
    8989    group_id integer DEFAULT 1 NOT NULL,
    9090    description character varying(255) DEFAULT ''::character varying NOT NULL,
     
    101101CREATE TABLE revzones (
    102102    rdns_id serial NOT NULL,
    103     revnet cidr NOT NULL PRIMARY KEY,
     103    revnet cidr NOT NULL,
    104104    group_id integer DEFAULT 1 NOT NULL,
    105105    description character varying(255) DEFAULT ''::character varying NOT NULL,
     
    108108    sertype character(1) DEFAULT 'D'::bpchar,
    109109    changed boolean DEFAULT true NOT NULL,
    110     default_location character varying (4) DEFAULT '' NOT NULL
     110    default_location character varying(4) DEFAULT ''::character varying NOT NULL
    111111);
    112112CREATE INDEX rev_status_index ON revzones USING btree (status);
     
    313313    ADD CONSTRAINT domains_domain_id_key UNIQUE (domain_id);
    314314
     315ALTER TABLE ONLY domains
     316    ADD CONSTRAINT domains_pkey PRIMARY KEY ("domain", default_location);
     317
    315318ALTER TABLE ONLY default_records
    316319    ADD CONSTRAINT default_records_pkey PRIMARY KEY (record_id);
     
    321324ALTER TABLE ONLY rectypes
    322325    ADD CONSTRAINT rectypes_pkey PRIMARY KEY (val, name);
     326
     327ALTER TABLE ONLY revzones
     328    ADD CONSTRAINT revzones_rdns_id_key UNIQUE (rdns_id);
     329
     330ALTER TABLE ONLY revzones
     331    ADD CONSTRAINT revzones_pkey PRIMARY KEY (revnet, default_location);
    323332
    324333ALTER TABLE ONLY users
Note: See TracChangeset for help on using the changeset viewer.