Changeset 370 for trunk/dns-1.0-1.2.sql
- Timestamp:
- 07/29/12 22:02:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns-1.0-1.2.sql
r369 r370 1 1 -- SQL table/record type upgrade file for dnsadmin 1.0 to 1.2 migration 2 3 -- need this before we add any other bits 4 CREATE 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 11 ALTER TABLE ONLY locations 12 ADD CONSTRAINT "locations_group_id_fkey" FOREIGN KEY (group_id) REFERENCES groups(group_id); 13 14 ALTER TABLE permissions ADD COLUMN location_create boolean DEFAULT false NOT NULL; 15 ALTER TABLE permissions ADD COLUMN location_edit boolean DEFAULT false NOT NULL; 16 ALTER TABLE permissions ADD COLUMN location_delete boolean DEFAULT false NOT NULL; 17 ALTER TABLE permissions ADD COLUMN location_view boolean DEFAULT false NOT NULL; 2 18 3 19 -- Minor buglet; domains must be unique … … 23 39 SELECT pg_catalog.setval('default_rev_records_record_id_seq', 5, false); 24 40 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; 41 ALTER TABLE domains ADD COLUMN changed boolean DEFAULT true NOT NULL; 42 ALTER TABLE domains ADD COLUMN default_location character varying (4) DEFAULT '' NOT NULL; 29 43 -- ~2x performance boost iff most zones are fed to output from the cache 30 44 CREATE INDEX dom_status_index ON domains (status); … … 38 52 zserial integer, 39 53 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 41 56 ); 42 57 CREATE INDEX rev_status_index ON revzones (status); … … 52 67 ALTER TABLE records DROP CONSTRAINT "$1"; 53 68 ALTER 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; 69 ALTER TABLE records ADD COLUMN rdns_id INTEGER DEFAULT 0 NOT NULL; 70 ALTER TABLE records ADD COLUMN location character varying (4) DEFAULT '' NOT NULL; 71 57 72 -- ~120s -> 75s performance boost on 100K records when always exporting all records 58 73 CREATE INDEX rec_types_index ON records (type);
Note:
See TracChangeset
for help on using the changeset viewer.