[181] | 1 | CREATE DATABASE ipdb;
|
---|
[4] | 2 |
|
---|
[176] | 3 | \connect ipdb ipdb
|
---|
[4] | 4 |
|
---|
| 5 | CREATE TABLE "customers" (
|
---|
| 6 | "custid" character varying(16) DEFAULT '' NOT NULL,
|
---|
| 7 | "name" character varying(64),
|
---|
| 8 | "street" character varying(25),
|
---|
| 9 | "street2" character varying(25),
|
---|
| 10 | "city" character varying(30),
|
---|
| 11 | "province" character(2),
|
---|
| 12 | "pocode" character varying(7),
|
---|
| 13 | "phone" character varying(15),
|
---|
| 14 | "abuse" character varying(50),
|
---|
| 15 | "def_rdns" character varying(40),
|
---|
| 16 | "description" text,
|
---|
| 17 | Constraint "customers_pkey" Primary Key ("custid")
|
---|
| 18 | );
|
---|
| 19 |
|
---|
[34] | 20 | REVOKE ALL on "customers" from PUBLIC;
|
---|
[57] | 21 | GRANT ALL on "customers" to "kdeugau";
|
---|
[34] | 22 | GRANT ALL on "customers" to "ipdb";
|
---|
| 23 |
|
---|
[4] | 24 | CREATE TABLE "masterblocks" (
|
---|
[176] | 25 | "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY
|
---|
[4] | 26 | );
|
---|
| 27 |
|
---|
[34] | 28 | REVOKE ALL on "masterblocks" from PUBLIC;
|
---|
[57] | 29 | GRANT ALL on "masterblocks" to "kdeugau";
|
---|
[34] | 30 | GRANT ALL on "masterblocks" to "ipdb";
|
---|
| 31 |
|
---|
[4] | 32 | CREATE TABLE "routed" (
|
---|
[176] | 33 | "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
|
---|
[4] | 34 | "maskbits" integer DEFAULT 128,
|
---|
[176] | 35 | "city" character varying(30) DEFAULT ''
|
---|
[4] | 36 | );
|
---|
| 37 |
|
---|
[34] | 38 | REVOKE ALL on "routed" from PUBLIC;
|
---|
[57] | 39 | GRANT ALL on "routed" to "kdeugau";
|
---|
[34] | 40 | GRANT ALL on "routed" to "ipdb";
|
---|
| 41 |
|
---|
[4] | 42 | CREATE TABLE "temp" (
|
---|
| 43 | "ofs" integer
|
---|
| 44 | );
|
---|
| 45 |
|
---|
[34] | 46 | REVOKE ALL on "temp" from PUBLIC;
|
---|
[57] | 47 | GRANT ALL on "temp" to "kdeugau";
|
---|
[34] | 48 | GRANT ALL on "temp" to "ipdb";
|
---|
| 49 |
|
---|
[57] | 50 | CREATE TABLE "freeblocks" (
|
---|
[180] | 51 | "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
|
---|
[57] | 52 | "maskbits" integer DEFAULT 128,
|
---|
| 53 | "city" character varying(30) DEFAULT '',
|
---|
[176] | 54 | "routed" character(1) DEFAULT 'n'
|
---|
[34] | 55 | );
|
---|
| 56 |
|
---|
[57] | 57 | REVOKE ALL on "freeblocks" from PUBLIC;
|
---|
| 58 | GRANT ALL on "freeblocks" to "kdeugau";
|
---|
| 59 | GRANT ALL on "freeblocks" to "ipdb";
|
---|
[34] | 60 |
|
---|
[74] | 61 | CREATE TABLE "poolips" (
|
---|
| 62 | "pool" cidr DEFAULT '255.255.255.255/32' NOT NULL,
|
---|
[176] | 63 | "ip" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
|
---|
[74] | 64 | "custid" character varying(16) DEFAULT '' NOT NULL,
|
---|
[175] | 65 | "city" character varying(30) DEFAULT '' NOT NULL,
|
---|
| 66 | "type" character(2) DEFAULT '' NOT NULL,
|
---|
| 67 | "available" character(1) DEFAULT 'y' NOT NULL,
|
---|
| 68 | "notes" text DEFAULT '' NOT NULL,
|
---|
| 69 | "description" character varying(64) DEFAULT '' NOT NULL,
|
---|
| 70 | "circuitid" character varying(128) DEFAULT '' NOT NULL,
|
---|
| 71 | "newcustid" integer,
|
---|
[176] | 72 | CHECK (((available = 'y'::bpchar) OR (available = 'n'::bpchar)))
|
---|
[74] | 73 | );
|
---|
| 74 |
|
---|
| 75 | REVOKE ALL on "poolips" from PUBLIC;
|
---|
| 76 | GRANT ALL on "poolips" to "kdeugau";
|
---|
| 77 | GRANT ALL on "poolips" to "ipdb";
|
---|
| 78 |
|
---|
| 79 | CREATE TABLE "allocations" (
|
---|
[176] | 80 | "cidr" cidr DEFAULT '255.255.255.255/32' NOT NULL PRIMARY KEY,
|
---|
[74] | 81 | "custid" character varying(16) DEFAULT '',
|
---|
| 82 | "type" character(2) DEFAULT '',
|
---|
| 83 | "city" character varying(30) DEFAULT '',
|
---|
| 84 | "description" character varying(64) DEFAULT '',
|
---|
| 85 | "notes" text DEFAULT '',
|
---|
| 86 | "maskbits" integer DEFAULT 128,
|
---|
| 87 | "circuitid" character varying(128) DEFAULT '',
|
---|
[176] | 88 | "newcustid" integer
|
---|
[74] | 89 | );
|
---|
| 90 |
|
---|
| 91 | REVOKE ALL on "allocations" from PUBLIC;
|
---|
| 92 | GRANT ALL on "allocations" to "kdeugau";
|
---|
| 93 | GRANT ALL on "allocations" to "ipdb";
|
---|
| 94 |
|
---|
[176] | 95 | CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description FROM poolips;
|
---|
[92] | 96 |
|
---|
[176] | 97 | REVOKE ALL on "searchme" from PUBLIC;
|
---|
| 98 | GRANT ALL on "searchme" to "kdeugau";
|
---|
| 99 | GRANT ALL on "searchme" to "ipdb";
|
---|
| 100 |
|
---|
[92] | 101 | CREATE TABLE "alloctypes" (
|
---|
[176] | 102 | "type" character(2) DEFAULT '' NOT NULL PRIMARY KEY,
|
---|
[92] | 103 | "listname" character varying(40) DEFAULT '',
|
---|
| 104 | "dispname" character varying(40) DEFAULT '',
|
---|
| 105 | "listorder" integer DEFAULT 0,
|
---|
[176] | 106 | "def_custid" character varying(16) DEFAULT ''
|
---|
[92] | 107 | );
|
---|
| 108 |
|
---|
| 109 | REVOKE ALL on "alloctypes" from PUBLIC;
|
---|
| 110 | GRANT ALL on "alloctypes" to "kdeugau";
|
---|
| 111 | GRANT ALL on "alloctypes" to "ipdb";
|
---|
| 112 |
|
---|
| 113 | CREATE TABLE "cities" (
|
---|
[176] | 114 | "city" character varying(30) DEFAULT '' NOT NULL PRIMARY KEY,
|
---|
[179] | 115 | "routing" character(1) DEFAULT 'n' NOT NULL
|
---|
[92] | 116 | );
|
---|
| 117 |
|
---|
| 118 | REVOKE ALL on "cities" from PUBLIC;
|
---|
| 119 | GRANT ALL on "cities" to "kdeugau";
|
---|
| 120 | GRANT ALL on "cities" to "ipdb";
|
---|
| 121 |
|
---|
[189] | 122 | --
|
---|
| 123 | -- Selected TOC Entries:
|
---|
| 124 | --
|
---|
| 125 | \connect - ipdb
|
---|
| 126 |
|
---|
| 127 | --
|
---|
| 128 | -- TOC Entry ID 2 (OID 92809)
|
---|
| 129 | --
|
---|
| 130 | -- Name: alloctypes Type: TABLE Owner: ipdb
|
---|
| 131 | --
|
---|
| 132 |
|
---|
| 133 | CREATE TABLE "alloctypes" (
|
---|
| 134 | "type" character(2) DEFAULT '' NOT NULL,
|
---|
| 135 | "listname" character varying(40) DEFAULT '',
|
---|
| 136 | "dispname" character varying(40) DEFAULT '',
|
---|
| 137 | "listorder" integer DEFAULT 0,
|
---|
| 138 | "def_custid" character varying(16) DEFAULT '',
|
---|
| 139 | Constraint "alloctypes_pkey" Primary Key ("type")
|
---|
| 140 | );
|
---|
| 141 |
|
---|
| 142 | --
|
---|
| 143 | -- TOC Entry ID 3 (OID 92809)
|
---|
| 144 | --
|
---|
| 145 | -- Name: alloctypes Type: ACL Owner:
|
---|
| 146 | --
|
---|
| 147 |
|
---|
| 148 | REVOKE ALL on "alloctypes" from PUBLIC;
|
---|
| 149 | GRANT ALL on "alloctypes" to "kdeugau";
|
---|
| 150 | GRANT ALL on "alloctypes" to "ipdb";
|
---|
| 151 |
|
---|
| 152 | --
|
---|
| 153 | -- Data for TOC Entry ID 4 (OID 92809)
|
---|
| 154 | --
|
---|
| 155 | -- Name: alloctypes Type: TABLE DATA Owner: ipdb
|
---|
| 156 | --
|
---|
| 157 |
|
---|
| 158 |
|
---|
[182] | 159 | COPY "alloctypes" FROM stdin;
|
---|
| 160 | cd Static Pool - Cable Cable pool 41 CBL-BUS
|
---|
| 161 | dp Static Pool - DSL DSL pool 42 DSL-BUS
|
---|
| 162 | mp Static Pool - Dialup Static dialup pool 43 DIAL-BUS
|
---|
| 163 | wp Static Pool - Wireless Static wireless pool 44 WL-BUS
|
---|
| 164 | mm Master block Master block 999 6750400
|
---|
| 165 | in Internal netblock Internal netblock 990 6750400
|
---|
| 166 | sd Static Pool - Servers Server pool 40 6750400
|
---|
| 167 | cn Customer netblock Customer netblock 0
|
---|
| 168 | ci Static IP - Cable Static cable IP 21
|
---|
| 169 | di Static IP - DSL Static DSL IP 22
|
---|
| 170 | mi Static IP - Dialup Static dialup IP 23
|
---|
| 171 | wi Static IP - Wireless Static wireless IP 24
|
---|
| 172 | si Static IP - Server pool Server pool IP 20 6750400
|
---|
[187] | 173 | wc Reserve for WAN blocks WAN IP blocks 200 6750400
|
---|
| 174 | wr Internal WAN block Internal WAN block 201 6750400
|
---|
| 175 | pc Reserve for dynamic-route DSL netblocks Dynamic-route netblocks 202 6750400
|
---|
[189] | 176 | en End-use netblock End-use netblock 100 6750400
|
---|
| 177 | me Dialup netblock Dialup netblock 101 DIAL-RES
|
---|
| 178 | de Dynamic DSL block Dynamic DSL block 102 DSL-RES
|
---|
| 179 | ce Dynamic cable block Dynamic cable block 103 CBL-RES
|
---|
| 180 | we Dynamic WiFi block Dynamic WiFi block 104 WL-RES
|
---|
| 181 | rm Routing Routed netblock 500 6750400
|
---|
[187] | 182 | pr Dynamic-route DSL netblock Dynamic-route DSL 203
|
---|
[182] | 183 | \.
|
---|
[221] | 184 |
|
---|
| 185 |
|
---|
| 186 | --
|
---|
| 187 | -- User data table - required for proper ACLs
|
---|
| 188 | --
|
---|
| 189 |
|
---|
| 190 | CREATE TABLE "users" (
|
---|
[238] | 191 | "username" varchar(16) NOT NULL PRIMARY KEY,
|
---|
[221] | 192 | "password" varchar(16) DEFAULT '',
|
---|
| 193 | "acl" varchar(16) DEFAULT 'b'
|
---|
| 194 | );
|
---|