1 | --
|
---|
2 | -- PostgreSQL database dump
|
---|
3 | --
|
---|
4 |
|
---|
5 | SET client_encoding = 'UTF8';
|
---|
6 | SET check_function_bodies = false;
|
---|
7 | SET client_min_messages = warning;
|
---|
8 |
|
---|
9 | --
|
---|
10 | -- Name: blocks; Type: TABLE; Schema: public; Owner: dnsbl
|
---|
11 | --
|
---|
12 |
|
---|
13 | CREATE TABLE blocks (
|
---|
14 | block cidr NOT NULL,
|
---|
15 | listme boolean DEFAULT false,
|
---|
16 | orgid integer,
|
---|
17 | "level" integer DEFAULT 0,
|
---|
18 | comments text DEFAULT ''::text,
|
---|
19 | parent cidr NOT NULL,
|
---|
20 | ipcount integer NOT NULL
|
---|
21 | );
|
---|
22 |
|
---|
23 |
|
---|
24 | --
|
---|
25 | -- Name: iplist; Type: TABLE; Schema: public; Owner: dnsbl
|
---|
26 | --
|
---|
27 |
|
---|
28 | CREATE TABLE iplist (
|
---|
29 | ip inet NOT NULL,
|
---|
30 | count integer DEFAULT 1,
|
---|
31 | s4list boolean DEFAULT false,
|
---|
32 | added timestamp with time zone DEFAULT now(),
|
---|
33 | parent cidr NOT NULL
|
---|
34 | );
|
---|
35 |
|
---|
36 |
|
---|
37 | --
|
---|
38 | -- Name: orgs; Type: TABLE; Schema: public; Owner: dnsbl
|
---|
39 | --
|
---|
40 |
|
---|
41 | CREATE TABLE orgs (
|
---|
42 | orgid serial NOT NULL,
|
---|
43 | listme boolean DEFAULT false,
|
---|
44 | orgname character varying(100) DEFAULT ''::character varying NOT NULL,
|
---|
45 | comments text
|
---|
46 | );
|
---|
47 |
|
---|
48 |
|
---|
49 | --
|
---|
50 | -- Name: autolist; Type: TABLE; Schema: public; Owner: dnsbl
|
---|
51 | --
|
---|
52 |
|
---|
53 | CREATE TABLE autolist (
|
---|
54 | masklen smallint NOT NULL,
|
---|
55 | ipcount bigint
|
---|
56 | );
|
---|
57 |
|
---|
58 |
|
---|
59 | --
|
---|
60 | -- Name: misc; Type: TABLE; Schema: public; Owner: dnsbl
|
---|
61 | --
|
---|
62 |
|
---|
63 | CREATE TABLE misc (
|
---|
64 | "key" character varying(30),
|
---|
65 | value character varying(255)
|
---|
66 | );
|
---|
67 |
|
---|
68 |
|
---|
69 | -- for tracking IPs that get removed from listing
|
---|
70 | -- note we don't want a PK on IP as with iplist, since we may end up removing an IP more than once. :/
|
---|
71 | --
|
---|
72 | -- Name: waslisted; Type: TABLE; Schema: public; Owner: dnsbl
|
---|
73 | --
|
---|
74 |
|
---|
75 | CREATE TABLE waslisted (
|
---|
76 | ip inet NOT NULL,
|
---|
77 | count integer DEFAULT 1,
|
---|
78 | s4list boolean DEFAULT false,
|
---|
79 | origadded timestamp with time zone DEFAULT now(),
|
---|
80 | delisted timestamp with time zone DEFAULT now()
|
---|
81 | );
|
---|
82 |
|
---|
83 |
|
---|
84 | --
|
---|
85 | -- Name: autolist_pkey; Type: CONSTRAINT; Schema: public; Owner: dnsbl
|
---|
86 | --
|
---|
87 |
|
---|
88 | ALTER TABLE ONLY autolist
|
---|
89 | ADD CONSTRAINT autolist_pkey PRIMARY KEY (masklen);
|
---|
90 |
|
---|
91 |
|
---|
92 | --
|
---|
93 | -- Name: blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: dnsbl
|
---|
94 | --
|
---|
95 |
|
---|
96 | ALTER TABLE ONLY blocks
|
---|
97 | ADD CONSTRAINT blocks_pkey PRIMARY KEY (block);
|
---|
98 |
|
---|
99 |
|
---|
100 | --
|
---|
101 | -- Name: iplist_pkey; Type: CONSTRAINT; Schema: public; Owner: dnsbl
|
---|
102 | --
|
---|
103 |
|
---|
104 | ALTER TABLE ONLY iplist
|
---|
105 | ADD CONSTRAINT iplist_pkey PRIMARY KEY (ip);
|
---|
106 |
|
---|
107 |
|
---|
108 | --
|
---|
109 | -- Name: orgs_pkey; Type: CONSTRAINT; Schema: public; Owner: dnsbl
|
---|
110 | --
|
---|
111 |
|
---|
112 | ALTER TABLE ONLY orgs
|
---|
113 | ADD CONSTRAINT orgs_pkey PRIMARY KEY (orgid);
|
---|
114 |
|
---|
115 |
|
---|
116 | --
|
---|
117 | -- Name: blocks_parent_index; Type: INDEX; Schema: public; Owner: dnsbl
|
---|
118 | --
|
---|
119 |
|
---|
120 | CREATE INDEX blocks_parent_index ON blocks USING btree (parent);
|
---|
121 |
|
---|
122 |
|
---|
123 | --
|
---|
124 | -- Name: ip_parent_index; Type: INDEX; Schema: public; Owner: dnsbl
|
---|
125 | --
|
---|
126 |
|
---|
127 | CREATE INDEX ip_parent_index ON iplist USING btree (parent);
|
---|
128 |
|
---|
129 |
|
---|
130 | --
|
---|
131 | -- Name: blocks_orgid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: dnsbl
|
---|
132 | --
|
---|
133 |
|
---|
134 | ALTER TABLE ONLY blocks
|
---|
135 | ADD CONSTRAINT blocks_orgid_fkey FOREIGN KEY (orgid) REFERENCES orgs(orgid);
|
---|
136 |
|
---|
137 |
|
---|
138 | --
|
---|
139 | -- Name: autolist; Type: TABLE DATA; Schema: public; Owner: dnsbl
|
---|
140 | --
|
---|
141 |
|
---|
142 | COPY autolist (masklen, ipcount) FROM stdin;
|
---|
143 | 31 1
|
---|
144 | 30 1
|
---|
145 | 29 2
|
---|
146 | 28 3
|
---|
147 | 27 4
|
---|
148 | 26 5
|
---|
149 | 25 6
|
---|
150 | 24 7
|
---|
151 | 23 8
|
---|
152 | 22 10
|
---|
153 | 21 13
|
---|
154 | 20 16
|
---|
155 | 19 19
|
---|
156 | 18 22
|
---|
157 | 17 26
|
---|
158 | 16 30
|
---|
159 | 15 34
|
---|
160 | 14 38
|
---|
161 | 13 42
|
---|
162 | 12 46
|
---|
163 | 11 50
|
---|
164 | 10 54
|
---|
165 | 9 58
|
---|
166 | 8 62
|
---|
167 | 7 2147483648
|
---|
168 | 6 2147483648
|
---|
169 | 5 2147483648
|
---|
170 | 4 2147483648
|
---|
171 | 3 2147483648
|
---|
172 | 2 2147483648
|
---|
173 | 1 2147483648
|
---|
174 | 0 2147483648
|
---|
175 | \.
|
---|