Changeset 347 for trunk


Ignore:
Timestamp:
10/06/06 12:18:44 (18 years ago)
Author:
Kris Deugau
Message:

/trunk

Replace ipdb.psql SQL tabledef/database prep with latest
version from /branches/stable r346.

File:
1 edited

Legend:

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

    r329 r347  
     1DROP DATABASE ipdb;
     2
     3CREATE USER ipdb WITH PASSWORD 'ipdbpwd';
     4
    15CREATE DATABASE ipdb;
    26
     7-- Need to do this or our triggers don't work.  Why do we need to do this?
     8CREATE FUNCTION "plpgsql_call_handler" () RETURNS language_handler AS '$libdir/plpgsql' LANGUAGE C;
     9CREATE TRUSTED LANGUAGE "plpgsql" HANDLER "plpgsql_call_handler";
     10
     11UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='ipdb')
     12        WHERE datname='ipdb';
     13
    314\connect ipdb ipdb
    415
    516CREATE TABLE "customers" (
    6         "custid" character varying(16) DEFAULT '' NOT NULL PRIMARY KEY
    7         "name" character varying(64) DEFAULT '',
    8         "street" character varying(25) DEFAULT '',
    9         "street2" character varying(25) DEFAULT '',
    10         "city" character varying(30) DEFAULT '',
    11         "province" character(2) DEFAULT 'ON',
    12         "country" character(2) DEFAULT 'CA',
    13         "pocode" character varying(7) DEFAULT '',
    14         "phone" character varying(15) DEFAULT '',
    15         "tech_handle" character varying(50) DEFAULT 'VH25-ORG-ARIN',
    16         "abuse_handle" character varying(50) DEFAULT '',
    17         "admin_handle" character varying(50) DEFAULT '',
    18         "def_rdns" character varying(40) DEFAULT '',
    19         "special" text DEFAULT ''
     17        "custid" character varying(16) DEFAULT '' NOT NULL,
     18        "name" character varying(64),
     19        "street" character varying(25),
     20        "street2" character varying(25),
     21        "city" character varying(30),
     22        "province" character(2),
     23        "country" character(2),
     24        "pocode" character varying(7),
     25        "phone" character varying(15),
     26        "tech_handle" character varying(50),
     27        "abuse_handle" character varying(50),
     28        "admin_handle" character varying(50),
     29        "def_rdns" character varying(40),
     30        "special" text,
     31        Constraint "customers_pkey" Primary Key ("custid")
    2032);
    2133
     
    6375        "pool" cidr DEFAULT '255.255.255.255/32' NOT NULL,
    6476        "ip" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
    65         "custid" character varying(16) DEFAULT '' NOT NULL,
     77        "oldcustid" character varying(16) DEFAULT '' NOT NULL,
    6678        "city" character varying(30) DEFAULT '' NOT NULL,
    6779        "type" character(2) DEFAULT '' NOT NULL,
     
    7183        "circuitid" character varying(128) DEFAULT '' NOT NULL,
    7284        "privdata" text DEFAULT '' NOT NULL,
    73         "newcustid" character varying(16) DEFAULT '',
     85        "custid" character varying(16) DEFAULT '',
    7486        "createstamp" timestamp DEFAULT now(),
    7587        "modifystamp" timestamp DEFAULT now(),
     
    8294CREATE TABLE "allocations" (
    8395        "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
    84         "custid" character varying(16) DEFAULT '',
     96        "oldcustid" character varying(16) DEFAULT '',
    8597        "type" character(2) DEFAULT '',
    8698        "city" character varying(30) DEFAULT '',
     
    92104        "modifystamp" timestamp DEFAULT now(),
    93105        "privdata" text DEFAULT '' NOT NULL,
    94         "newcustid" character varying(16) DEFAULT '',
     106        "custid" character varying(16) DEFAULT '',
    95107        swip character(1) DEFAULT 'n'
    96108);
     
    110122        "listorder" integer DEFAULT 0,
    111123        "def_custid" character varying(16) DEFAULT '',
    112         "arin_netname" character varying(20) DEFAILT 'ISP'
     124        "arin_netname" character varying(20) DEFAULT 'ISP'
    113125);
    114126
     
    140152pc      Reserve for dynamic-route DSL netblocks Dynamic-route netblocks 201     6750400 ISP-STATIC-DSL
    141153ac      Reserve for ATM ATM blocks      202     6750400 ISP
     154fc      Reserve for fibre       Fibre blocks    203     6750400 ISP
    142155wr      CORE/WAN block  CORE/WAN block  220     6750400 ISP
    143156pr      Dynamic-route DSL netblock      Dynamic-route DSL       221             ISP
    144157ar      ATM block       ATM block       222             ISP
     158fr      Fibre   Fibre   223             ISP
    145159rm      Routing Routed netblock 500     6750400 ISP
    146160in      Internal netblock       Internal netblock       990     6750400 ISP
     
    186200);
    187201
     202-- Default password is admin
     203INSERT INTO users VALUES ('admin','luef5C4XumqIs','bacdsA');
     204
    188205CREATE TABLE "dns" (
    189206        "ip" inet NOT NULL PRIMARY KEY,
Note: See TracChangeset for help on using the changeset viewer.