Changeset 370 for trunk/dns-1.0-1.2.sql


Ignore:
Timestamp:
07/29/12 22:02:48 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Checkpoint; adding location/view support. See #10.

  • add location to menu
  • add table and link fields to initial tabledef and upgrade SQL
  • add listing subs and list page
  • update permissions list and subpage template with new permissions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-1.0-1.2.sql

    r369 r370  
    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    loc character varying (4) PRIMARY KEY,
     6    group_id integer NOT NULL DEFAULT 1,
     7    iplist text NOT NULL DEFAULT '',
     8    description text NOT NULL DEFAULT ''
     9);
     10
     11ALTER TABLE ONLY locations
     12    ADD CONSTRAINT "locations_group_id_fkey" FOREIGN KEY (group_id) REFERENCES groups(group_id);
     13
     14ALTER TABLE permissions ADD COLUMN location_create boolean DEFAULT false NOT NULL;
     15ALTER TABLE permissions ADD COLUMN location_edit boolean DEFAULT false NOT NULL;
     16ALTER TABLE permissions ADD COLUMN location_delete boolean DEFAULT false NOT NULL;
     17ALTER TABLE permissions ADD COLUMN location_view boolean DEFAULT false NOT NULL;
    218
    319-- Minor buglet;  domains must be unique
     
    2339SELECT pg_catalog.setval('default_rev_records_record_id_seq', 5, false);
    2440
    25 ALTER TABLE domains ADD COLUMN changed boolean;
    26 UPDATE domains SET changed=false;
    27 ALTER TABLE domains ALTER COLUMN changed SET DEFAULT true;
    28 ALTER TABLE domains ALTER COLUMN changed SET NOT NULL;
     41ALTER TABLE domains ADD COLUMN changed boolean DEFAULT true NOT NULL;
     42ALTER TABLE domains ADD COLUMN default_location character varying (4) DEFAULT '' NOT NULL;
    2943-- ~2x performance boost iff most zones are fed to output from the cache
    3044CREATE INDEX dom_status_index ON domains (status);
     
    3852    zserial integer,
    3953    sertype character(1) DEFAULT 'D'::bpchar,
    40     changed boolean DEFAULT true NOT NULL
     54    changed boolean DEFAULT true NOT NULL,
     55    default_location character varying (4) DEFAULT '' NOT NULL
    4156);
    4257CREATE INDEX rev_status_index ON revzones (status);
     
    5267ALTER TABLE records DROP CONSTRAINT "$1";
    5368ALTER TABLE records ALTER COLUMN domain_id SET DEFAULT 0;
    54 ALTER TABLE records ADD COLUMN rdns_id INTEGER DEFAULT 0;
    55 UPDATE records SET rdns_id=0;
    56 ALTER TABLE records ALTER COLUMN rdns_id SET NOT NULL;
     69ALTER TABLE records ADD COLUMN rdns_id INTEGER DEFAULT 0 NOT NULL;
     70ALTER TABLE records ADD COLUMN location character varying (4) DEFAULT '' NOT NULL;
     71
    5772-- ~120s -> 75s performance boost on 100K records when always exporting all records
    5873CREATE INDEX rec_types_index ON records (type);
Note: See TracChangeset for help on using the changeset viewer.