aboutsummaryrefslogtreecommitdiff
path: root/rpkid/tests/old_irdbd.sql
diff options
context:
space:
mode:
Diffstat (limited to 'rpkid/tests/old_irdbd.sql')
-rw-r--r--rpkid/tests/old_irdbd.sql105
1 files changed, 105 insertions, 0 deletions
diff --git a/rpkid/tests/old_irdbd.sql b/rpkid/tests/old_irdbd.sql
new file mode 100644
index 00000000..bf324cd8
--- /dev/null
+++ b/rpkid/tests/old_irdbd.sql
@@ -0,0 +1,105 @@
+-- $Id$
+
+-- Copyright (C) 2009--2011 Internet Systems Consortium ("ISC")
+--
+-- Permission to use, copy, modify, and distribute this software for any
+-- purpose with or without fee is hereby granted, provided that the above
+-- copyright notice and this permission notice appear in all copies.
+--
+-- THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+-- AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+-- PERFORMANCE OF THIS SOFTWARE.
+
+-- Copyright (C) 2007--2008 American Registry for Internet Numbers ("ARIN")
+--
+-- Permission to use, copy, modify, and distribute this software for any
+-- purpose with or without fee is hereby granted, provided that the above
+-- copyright notice and this permission notice appear in all copies.
+--
+-- THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
+-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+-- AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
+-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+-- PERFORMANCE OF THIS SOFTWARE.
+
+-- SQL objects needed by irdbd.py. You only need this if you're using
+-- irdbd.py as your IRDB; if you have a "real" backend you can do
+-- anything you like so long as you implement the relevant portion of
+-- the left-right protocol.
+
+-- DROP TABLE commands must be in correct (reverse dependency) order
+-- to satisfy FOREIGN KEY constraints.
+
+DROP TABLE IF EXISTS roa_request_prefix;
+DROP TABLE IF EXISTS roa_request;
+DROP TABLE IF EXISTS registrant_net;
+DROP TABLE IF EXISTS registrant_asn;
+DROP TABLE IF EXISTS registrant;
+DROP TABLE IF EXISTS ghostbuster_request;
+
+CREATE TABLE registrant (
+ registrant_id SERIAL NOT NULL,
+ registrant_handle VARCHAR(255) NOT NULL,
+ registrant_name TEXT,
+ registry_handle VARCHAR(255),
+ valid_until DATETIME NOT NULL,
+ PRIMARY KEY (registrant_id),
+ UNIQUE (registry_handle, registrant_handle)
+) ENGINE=InnoDB;
+
+CREATE TABLE registrant_asn (
+ registrant_asn_id SERIAL NOT NULL,
+ start_as BIGINT UNSIGNED NOT NULL,
+ end_as BIGINT UNSIGNED NOT NULL,
+ registrant_id BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY (registrant_asn_id),
+ CONSTRAINT registrant_asn_registrant_id
+ FOREIGN KEY (registrant_id) REFERENCES registrant (registrant_id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+CREATE TABLE registrant_net (
+ registrant_net_id SERIAL NOT NULL,
+ start_ip VARCHAR(40) NOT NULL,
+ end_ip VARCHAR(40) NOT NULL,
+ version TINYINT UNSIGNED NOT NULL,
+ registrant_id BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY (registrant_net_id),
+ CONSTRAINT registrant_net_registrant_id
+ FOREIGN KEY (registrant_id) REFERENCES registrant (registrant_id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+CREATE TABLE roa_request (
+ roa_request_id SERIAL NOT NULL,
+ roa_request_handle VARCHAR(255) NOT NULL,
+ asn BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY (roa_request_id)
+) ENGINE=InnoDB;
+
+CREATE TABLE roa_request_prefix (
+ prefix VARCHAR(40) NOT NULL,
+ prefixlen TINYINT UNSIGNED NOT NULL,
+ max_prefixlen TINYINT UNSIGNED NOT NULL,
+ version TINYINT UNSIGNED NOT NULL,
+ roa_request_id BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY (roa_request_id, prefix, prefixlen, max_prefixlen),
+ CONSTRAINT roa_request_prefix_roa_request_id
+ FOREIGN KEY (roa_request_id) REFERENCES roa_request (roa_request_id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+CREATE TABLE ghostbuster_request (
+ ghostbuster_request_id SERIAL NOT NULL,
+ self_handle VARCHAR(40) NOT NULL,
+ parent_handle VARCHAR(40),
+ vcard LONGBLOB NOT NULL,
+ PRIMARY KEY (ghostbuster_request_id)
+) ENGINE=InnoDB;
+
+-- Local Variables:
+-- indent-tabs-mode: nil
+-- End:
000 committer Rob Austein <sra@hactrn.net> 2007-11-14 01:24:04 +0000 Hide most of the time arithmetic in an abstraction based on' href='/sra/rpki.net/commit/scripts/rpki/sundial.py?id=b617eaa787b2022da92e7b3b1e3dede866b5f32b'>b617eaa7
62e55cba


b617eaa7
0382c289
a780a780


b617eaa7


0382c289










4a599b7a
03996ad7









4a599b7a
ce422aa2


0382c289
4a599b7a

a780a780

e1e5eb6d
0382c289
4a599b7a
692a976a
ce422aa2


692a976a


ce422aa2


692a976a

41c51dee



204d84bd
0382c289

















2913d33c
a780a780

b617eaa7
2913d33c

3a706d4a














2913d33c






14cb05e6
3a706d4a

14cb05e6





2913d33c
3a706d4a





2913d33c

a780a780


2913d33c




14cb05e6

3a706d4a






14cb05e6
f7c79af8
14cb05e6
2913d33c
ce422aa2


2913d33c
b617eaa7
4975c4d2

ce422aa2


4975c4d2

41c51dee












204d84bd





0382c289
204d84bd



b617eaa7

7a5062ef




7a5062ef

b617eaa7

7a5062ef


14cb05e6
3a706d4a

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289