Ignore:
Timestamp:
12/10/13 17:47:44 (10 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Merge reverse DNS and location work; 2 of mumble

Numerous conflicts due to hand-copy or partial merges

Location:
branches/stable
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/stable

  • branches/stable/dns-1.0-1.2.sql

    r365 r545  
    11-- SQL table/record type upgrade file for dnsadmin 1.0 to 1.2 migration
     2
     3-- need this before we add any other bits
     4CREATE TABLE locations (
     5    location character varying (4) PRIMARY KEY,
     6    loc_id serial UNIQUE,
     7    group_id integer NOT NULL DEFAULT 1,
     8    iplist text NOT NULL DEFAULT '',
     9    description character varying(40) NOT NULL DEFAULT '',
     10    comments text NOT NULL DEFAULT ''
     11);
     12
     13ALTER TABLE ONLY locations
     14    ADD CONSTRAINT "locations_group_id_fkey" FOREIGN KEY (group_id) REFERENCES groups(group_id);
     15
     16ALTER TABLE permissions ADD COLUMN record_locchg boolean DEFAULT false NOT NULL;
     17ALTER TABLE permissions ADD COLUMN location_create boolean DEFAULT false NOT NULL;
     18ALTER TABLE permissions ADD COLUMN location_edit boolean DEFAULT false NOT NULL;
     19ALTER TABLE permissions ADD COLUMN location_delete boolean DEFAULT false NOT NULL;
     20ALTER TABLE permissions ADD COLUMN location_view boolean DEFAULT false NOT NULL;
    221
    322-- Minor buglet;  domains must be unique
     
    2342SELECT pg_catalog.setval('default_rev_records_record_id_seq', 5, false);
    2443
     44ALTER TABLE domains ADD COLUMN changed boolean DEFAULT true NOT NULL;
     45ALTER TABLE domains ADD COLUMN default_location character varying (4) DEFAULT '' NOT NULL;
     46-- ~2x performance boost iff most zones are fed to output from the cache
     47CREATE INDEX dom_status_index ON domains (status);
     48
    2549CREATE TABLE revzones (
    2650    rdns_id serial NOT NULL,
     
    3054    status integer DEFAULT 1 NOT NULL,
    3155    zserial integer,
    32     sertype character(1) DEFAULT 'D'::bpchar
     56    sertype character(1) DEFAULT 'D'::bpchar,
     57    changed boolean DEFAULT true NOT NULL,
     58    default_location character varying (4) DEFAULT '' NOT NULL
    3359);
     60CREATE INDEX rev_status_index ON revzones (status);
     61
     62ALTER TABLE ONLY revzones
     63    ADD CONSTRAINT "$1" FOREIGN KEY (group_id) REFERENCES groups(group_id);
    3464
    3565ALTER TABLE log ADD COLUMN rdns_id INTEGER;
     
    4070ALTER TABLE records DROP CONSTRAINT "$1";
    4171ALTER TABLE records ALTER COLUMN domain_id SET DEFAULT 0;
    42 ALTER TABLE records ADD COLUMN rdns_id INTEGER DEFAULT 0;
    43 UPDATE records SET rdns_id=0;
    44 ALTER TABLE records ALTER COLUMN rdns_id SET NOT NULL;
     72ALTER TABLE records ADD COLUMN rdns_id INTEGER DEFAULT 0 NOT NULL;
     73ALTER TABLE records ADD COLUMN location character varying (4) DEFAULT '' NOT NULL;
     74
     75-- ~120s -> 75s performance boost on 100K records when always exporting all records
     76CREATE INDEX rec_types_index ON records (type);
     77-- Further ~1/3 performance gain, same dataset
     78CREATE INDEX rec_domain_index ON records (domain_id);
     79CREATE INDEX rec_revzone_index ON records (rdns_id);
    4580
    4681-- May as well drop and recreate;  this is nominally static and loaded from the
Note: See TracChangeset for help on using the changeset viewer.