Ignore:
Timestamp:
11/15/11 18:08:14 (12 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Make the fixed web path at least configurable in one place rather
than completely hardcoded across many files.
Update initial database tabledef SQL
Bump version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/ipdb.psql

    r445 r507  
    1 DROP DATABASE ipdb;
    2 
    3 CREATE USER ipdb WITH PASSWORD 'ipdbpwd';
    4 
    5 CREATE DATABASE ipdb;
    6 
    7 -- Need to do this or our triggers don't work.  Why do we need to do this?
    8 CREATE FUNCTION "plpgsql_call_handler" () RETURNS language_handler AS '$libdir/plpgsql' LANGUAGE C;
    9 CREATE TRUSTED LANGUAGE "plpgsql" HANDLER "plpgsql_call_handler";
    10 
    11 UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='ipdb')
    12         WHERE datname='ipdb';
    13 
    14 \connect ipdb ipdb
     1-- Initial table setup for IP Database
    152
    163CREATE TABLE "customers" (
     
    3219);
    3320
    34 REVOKE ALL on "customers" from PUBLIC;
    35 GRANT ALL on "customers" to "ipdb";
    36 
    3721CREATE TABLE "masterblocks" (
    3822        "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
     
    4125        "rwhois" character(1) DEFAULT 'n' NOT NULL
    4226);
    43 
    44 REVOKE ALL on "masterblocks" from PUBLIC;
    45 GRANT ALL on "masterblocks" to "ipdb";
    4627
    4728CREATE TABLE "routed" (
     
    5233);
    5334
    54 REVOKE ALL on "routed" from PUBLIC;
    55 GRANT ALL on "routed" to "ipdb";
    56 GRANT SELECT on "routed" to "ipdb";
    57 
    5835CREATE TABLE "temp" (
    5936        "ofs" integer
    6037);
    61 
    62 REVOKE ALL on "temp" from PUBLIC;
    63 GRANT ALL on "temp" to "ipdb";
    6438
    6539CREATE TABLE "freeblocks" (
     
    6943        "routed" character(1) DEFAULT 'n'
    7044);
    71 
    72 REVOKE ALL on "freeblocks" from PUBLIC;
    73 GRANT ALL on "freeblocks" to "ipdb";
    7445
    7546CREATE TABLE "poolips" (
     
    9061);
    9162
    92 REVOKE ALL on "poolips" from PUBLIC;
    93 GRANT ALL on "poolips" to "ipdb";
    94 
    9563CREATE TABLE "allocations" (
    9664        "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
     
    10977);
    11078
    111 REVOKE ALL on "allocations" from PUBLIC;
    112 GRANT ALL on "allocations" to "ipdb";
    113 
    11479CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes, allocations.oldcustid, allocations.circuitid FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes, poolips.oldcustid, poolips.circuitid FROM poolips;
    115 
    116 REVOKE ALL on "searchme" from PUBLIC;
    117 GRANT ALL on "searchme" to "ipdb";
    11880
    11981CREATE TABLE "alloctypes" (
     
    167129\.
    168130
    169 REVOKE ALL on "alloctypes" from PUBLIC;
    170 GRANT ALL on "alloctypes" to "ipdb";
    171 
    172131CREATE TABLE "cities" (
    173132        "id" serial NOT NULL PRIMARY KEY,
     
    175134        "routing" character(1) DEFAULT 'n' NOT NULL
    176135);
    177 
    178 REVOKE ALL on "cities" from PUBLIC;
    179 GRANT ALL on "cities" to "ipdb";
    180136
    181137--
Note: See TracChangeset for help on using the changeset viewer.