Changeset 864 for trunk


Ignore:
Timestamp:
04/29/16 13:25:18 (8 years ago)
Author:
Kris Deugau
Message:

/trunk

Refine initial database creation script based on correct-in-production
2.7-3.0 upgrade. Still arguably some things wrong with GRANTs, but those
are more artifacts of legacy dumps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/ipdb.psql

    r807 r864  
    99    location varchar(4) DEFAULT '' NOT NULL
    1010);
     11
     12COPY vrfs (vrf, comment, location) FROM stdin;
     13DEFAULT Initial default VRF     
     14\.
    1115
    1216ALTER TABLE ONLY vrfs
     
    3438    parent_id integer DEFAULT 0 NOT NULL,
    3539    master_id integer DEFAULT 0 NOT NULL,
     40    backup_id integer DEFAULT 0 NOT NULL,
    3641    id serial NOT NULL
    3742);
     
    7580CREATE TABLE dnsavail (
    7681    "zone" cidr PRIMARY KEY,
    77     "location" varchar(2) DEFAULT '',
     82    "location" varchar(4) DEFAULT '',
    7883    parent_alloc integer NOT NULL
     84);
     85
     86-- Store backup fields in a separate table
     87CREATE TABLE backuplist (
     88    backup_id serial NOT NULL,
     89    bkbrand text,
     90    bkmodel text,
     91    bktype text,
     92    bkport integer,
     93    bksrc text,
     94    bkuser text,
     95    bkvpass text,
     96    bkepass text,
     97    bkip inet
    7998);
    8099
     
    136155    parent_id integer DEFAULT 0 NOT NULL,
    137156    master_id integer DEFAULT 0 NOT NULL,
     157    backup_id integer DEFAULT 0 NOT NULL,
    138158    id serial NOT NULL,
    139159    CONSTRAINT poolips_available_check CHECK (((available = 'y'::bpchar) OR (available = 'n'::bpchar)))
     
    148168    SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city,
    149169      allocations.description, allocations.notes, allocations.circuitid, allocations.vrf,
    150       allocations.vlan, allocations.id, allocations.parent_id, 'n' AS available
     170      allocations.vlan, allocations.id, allocations.parent_id, allocations.master_id, 'n' AS available
    151171    FROM allocations
    152172  UNION
    153173    SELECT poolips.ip AS cidr, poolips.custid, poolips."type", poolips.city,
    154174      poolips.description, poolips.notes, poolips.circuitid, poolips.vrf,
    155       poolips.vlan, poolips.id, poolips.parent_id, poolips.available
     175      poolips.vlan, poolips.id, poolips.parent_id, poolips.master_id, poolips.available
    156176    FROM poolips;
    157177
Note: See TracChangeset for help on using the changeset viewer.