1
+ /*
2
+
3
+ How this was generated:
4
+ 1. bring up an empty pdns stack
5
+ 2. use api to create a zone ...
6
+
7
+ curl -X POST \
8
+ 'http://npm.dev:8081/api/v1/servers/localhost/zones' \
9
+ --header 'X-API-Key: npm' \
10
+ --header 'Content-Type: application/json' \
11
+ --data-raw '{
12
+ "name": "example.com.",
13
+ "kind": "Native",
14
+ "masters": [],
15
+ "nameservers": [
16
+ "ns1.pdns.",
17
+ "ns2.pdns."
18
+ ]
19
+ }'
20
+
21
+ 3. Dump sql:
22
+
23
+ docker exec -ti npm.pdns.db mysqldump -u pdns -p pdns
24
+
25
+ */
26
+
27
+ -- --------------------------------------------------------------------
28
+
29
+ /* !40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */ ;
30
+ /* !40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */ ;
31
+ /* !40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */ ;
32
+ /* !40101 SET NAMES utf8mb4 */ ;
33
+ /* !40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */ ;
34
+ /* !40103 SET TIME_ZONE='+00:00' */ ;
35
+ /* !40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */ ;
36
+ /* !40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */ ;
37
+ /* !40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */ ;
38
+ /* !40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */ ;
39
+
40
+ --
41
+ -- Table structure for table `comments`
42
+ --
43
+
44
+ DROP TABLE IF EXISTS ` comments` ;
45
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
46
+ /* !40101 SET character_set_client = utf8 */ ;
1
47
CREATE TABLE `comments ` (
2
48
` id` int (11 ) NOT NULL AUTO_INCREMENT,
3
49
` domain_id` int (11 ) NOT NULL ,
4
50
` name` varchar (255 ) NOT NULL ,
5
51
` type` varchar (10 ) NOT NULL ,
6
52
` modified_at` int (11 ) NOT NULL ,
7
- ` account` varchar (40 ) DEFAULT NULL ,
8
- ` comment` text NOT NULL ,
53
+ ` account` varchar (40 ) CHARACTER SET utf8mb3 DEFAULT NULL ,
54
+ ` comment` text CHARACTER SET utf8mb3 NOT NULL ,
9
55
PRIMARY KEY (` id` ),
10
56
KEY ` comments_name_type_idx` (` name` ,` type` ),
11
57
KEY ` comments_order_idx` (` domain_id` ,` modified_at` )
12
- ) ENGINE= MyISAM DEFAULT CHARSET= latin1;
58
+ ) ENGINE= InnoDB DEFAULT CHARSET= latin1;
59
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
60
+
61
+ --
62
+ -- Dumping data for table `comments`
63
+ --
64
+
65
+ LOCK TABLES ` comments` WRITE;
66
+ /* !40000 ALTER TABLE `comments` DISABLE KEYS */ ;
67
+ /* !40000 ALTER TABLE `comments` ENABLE KEYS */ ;
68
+ UNLOCK TABLES;
13
69
70
+ --
71
+ -- Table structure for table `cryptokeys`
72
+ --
73
+
74
+ DROP TABLE IF EXISTS ` cryptokeys` ;
75
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
76
+ /* !40101 SET character_set_client = utf8 */ ;
14
77
CREATE TABLE `cryptokeys ` (
15
78
` id` int (11 ) NOT NULL AUTO_INCREMENT,
16
79
` domain_id` int (11 ) NOT NULL ,
@@ -20,68 +83,173 @@ CREATE TABLE `cryptokeys` (
20
83
` content` text DEFAULT NULL ,
21
84
PRIMARY KEY (` id` ),
22
85
KEY ` domainidindex` (` domain_id` )
23
- ) ENGINE= MyISAM DEFAULT CHARSET= latin1;
86
+ ) ENGINE= InnoDB DEFAULT CHARSET= latin1;
87
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
88
+
89
+ --
90
+ -- Dumping data for table `cryptokeys`
91
+ --
92
+
93
+ LOCK TABLES ` cryptokeys` WRITE;
94
+ /* !40000 ALTER TABLE `cryptokeys` DISABLE KEYS */ ;
95
+ /* !40000 ALTER TABLE `cryptokeys` ENABLE KEYS */ ;
96
+ UNLOCK TABLES;
24
97
98
+ --
99
+ -- Table structure for table `domainmetadata`
100
+ --
101
+
102
+ DROP TABLE IF EXISTS ` domainmetadata` ;
103
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
104
+ /* !40101 SET character_set_client = utf8 */ ;
25
105
CREATE TABLE `domainmetadata ` (
26
106
` id` int (11 ) NOT NULL AUTO_INCREMENT,
27
107
` domain_id` int (11 ) NOT NULL ,
28
108
` kind` varchar (32 ) DEFAULT NULL ,
29
109
` content` text DEFAULT NULL ,
30
110
PRIMARY KEY (` id` ),
31
111
KEY ` domainmetadata_idx` (` domain_id` ,` kind` )
32
- ) ENGINE= MyISAM DEFAULT CHARSET= latin1;
112
+ ) ENGINE= InnoDB AUTO_INCREMENT= 2 DEFAULT CHARSET= latin1;
113
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
114
+
115
+ --
116
+ -- Dumping data for table `domainmetadata`
117
+ --
33
118
34
- INSERT INTO ` domainmetadata` VALUES (1 ,1 ,' SOA-EDIT-API' ,' DEFAULT' );
119
+ LOCK TABLES ` domainmetadata` WRITE;
120
+ /* !40000 ALTER TABLE `domainmetadata` DISABLE KEYS */ ;
121
+ INSERT INTO ` domainmetadata` VALUES
122
+ (1 ,1 ,' SOA-EDIT-API' ,' DEFAULT' );
123
+ /* !40000 ALTER TABLE `domainmetadata` ENABLE KEYS */ ;
124
+ UNLOCK TABLES;
35
125
126
+ --
127
+ -- Table structure for table `domains`
128
+ --
129
+
130
+ DROP TABLE IF EXISTS ` domains` ;
131
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
132
+ /* !40101 SET character_set_client = utf8 */ ;
36
133
CREATE TABLE `domains ` (
37
134
` id` int (11 ) NOT NULL AUTO_INCREMENT,
38
135
` name` varchar (255 ) NOT NULL ,
39
136
` master` varchar (128 ) DEFAULT NULL ,
40
137
` last_check` int (11 ) DEFAULT NULL ,
41
- ` type` varchar (6 ) NOT NULL ,
138
+ ` type` varchar (8 ) NOT NULL ,
42
139
` notified_serial` int (10 ) unsigned DEFAULT NULL ,
43
- ` account` varchar (40 ) DEFAULT NULL ,
140
+ ` account` varchar (40 ) CHARACTER SET utf8mb3 DEFAULT NULL ,
141
+ ` options` varchar (64000 ) DEFAULT NULL ,
142
+ ` catalog` varchar (255 ) DEFAULT NULL ,
44
143
PRIMARY KEY (` id` ),
45
- UNIQUE KEY ` name_index` (` name` )
46
- ) ENGINE= MyISAM DEFAULT CHARSET= latin1;
144
+ UNIQUE KEY ` name_index` (` name` ),
145
+ KEY ` catalog_idx` (` catalog` )
146
+ ) ENGINE= InnoDB AUTO_INCREMENT= 2 DEFAULT CHARSET= latin1;
147
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
148
+
149
+ --
150
+ -- Dumping data for table `domains`
151
+ --
47
152
48
- INSERT INTO ` domains` VALUES (1 ,' example.com' ,' ' ,NULL ,' NATIVE' ,NULL ,' ' );
153
+ LOCK TABLES ` domains` WRITE;
154
+ /* !40000 ALTER TABLE `domains` DISABLE KEYS */ ;
155
+ INSERT INTO ` domains` VALUES
156
+ (1 ,' example.com' ,' ' ,NULL ,' NATIVE' ,NULL ,' ' ,NULL ,NULL );
157
+ /* !40000 ALTER TABLE `domains` ENABLE KEYS */ ;
158
+ UNLOCK TABLES;
49
159
160
+ --
161
+ -- Table structure for table `records`
162
+ --
163
+
164
+ DROP TABLE IF EXISTS ` records` ;
165
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
166
+ /* !40101 SET character_set_client = utf8 */ ;
50
167
CREATE TABLE `records ` (
51
168
` id` bigint (20 ) NOT NULL AUTO_INCREMENT,
52
169
` domain_id` int (11 ) DEFAULT NULL ,
53
170
` name` varchar (255 ) DEFAULT NULL ,
54
171
` type` varchar (10 ) DEFAULT NULL ,
55
- ` content` TEXT DEFAULT NULL ,
172
+ ` content` varchar ( 64000 ) DEFAULT NULL ,
56
173
` ttl` int (11 ) DEFAULT NULL ,
57
174
` prio` int (11 ) DEFAULT NULL ,
58
175
` disabled` tinyint (1 ) DEFAULT 0 ,
59
- ` ordername` varchar (255 ) DEFAULT NULL ,
176
+ ` ordername` varchar (255 ) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL ,
60
177
` auth` tinyint (1 ) DEFAULT 1 ,
61
178
PRIMARY KEY (` id` ),
62
179
KEY ` nametype_index` (` name` ,` type` ),
63
180
KEY ` domain_id` (` domain_id` ),
64
181
KEY ` ordername` (` ordername` )
65
- ) ENGINE= MyISAM DEFAULT CHARSET= latin1;
182
+ ) ENGINE= InnoDB AUTO_INCREMENT= 4 DEFAULT CHARSET= latin1;
183
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
184
+
185
+ --
186
+ -- Dumping data for table `records`
187
+ --
66
188
189
+ LOCK TABLES ` records` WRITE;
190
+ /* !40000 ALTER TABLE `records` DISABLE KEYS */ ;
67
191
INSERT INTO ` records` VALUES
68
192
(1 ,1 ,' example.com' ,' NS' ,' ns1.pdns' ,1500 ,0 ,0 ,NULL ,1 ),
69
193
(2 ,1 ,' example.com' ,' NS' ,' ns2.pdns' ,1500 ,0 ,0 ,NULL ,1 ),
70
- (4 ,1 ,' test.example.com' ,' A' ,' 10.0.0.1' ,60 ,0 ,0 ,NULL ,1 ),
71
- (5 ,1 ,' example.com' ,' SOA' ,' a.misconfigured.dns.server.invalid hostmaster.example.com 2022020702 10800 3600 604800 3600' ,1500 ,0 ,0 ,NULL ,1 );
194
+ (3 ,1 ,' example.com' ,' SOA' ,' a.misconfigured.dns.server.invalid hostmaster.example.com 2023030501 10800 3600 604800 3600' ,1500 ,0 ,0 ,NULL ,1 );
195
+ /* !40000 ALTER TABLE `records` ENABLE KEYS */ ;
196
+ UNLOCK TABLES;
197
+
198
+ --
199
+ -- Table structure for table `supermasters`
200
+ --
72
201
202
+ DROP TABLE IF EXISTS ` supermasters` ;
203
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
204
+ /* !40101 SET character_set_client = utf8 */ ;
73
205
CREATE TABLE `supermasters ` (
74
206
` ip` varchar (64 ) NOT NULL ,
75
207
` nameserver` varchar (255 ) NOT NULL ,
76
- ` account` varchar (40 ) NOT NULL ,
208
+ ` account` varchar (40 ) CHARACTER SET utf8mb3 NOT NULL ,
77
209
PRIMARY KEY (` ip` ,` nameserver` )
78
- ) DEFAULT CHARSET= latin1;
210
+ ) ENGINE= InnoDB DEFAULT CHARSET= latin1;
211
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
79
212
213
+ --
214
+ -- Dumping data for table `supermasters`
215
+ --
216
+
217
+ LOCK TABLES ` supermasters` WRITE;
218
+ /* !40000 ALTER TABLE `supermasters` DISABLE KEYS */ ;
219
+ /* !40000 ALTER TABLE `supermasters` ENABLE KEYS */ ;
220
+ UNLOCK TABLES;
221
+
222
+ --
223
+ -- Table structure for table `tsigkeys`
224
+ --
225
+
226
+ DROP TABLE IF EXISTS ` tsigkeys` ;
227
+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
228
+ /* !40101 SET character_set_client = utf8 */ ;
80
229
CREATE TABLE `tsigkeys ` (
81
230
` id` int (11 ) NOT NULL AUTO_INCREMENT,
82
231
` name` varchar (255 ) DEFAULT NULL ,
83
232
` algorithm` varchar (50 ) DEFAULT NULL ,
84
233
` secret` varchar (255 ) DEFAULT NULL ,
85
234
PRIMARY KEY (` id` ),
86
235
UNIQUE KEY ` namealgoindex` (` name` ,` algorithm` )
87
- ) ENGINE= MyISAM DEFAULT CHARSET= latin1;
236
+ ) ENGINE= InnoDB DEFAULT CHARSET= latin1;
237
+ /* !40101 SET character_set_client = @saved_cs_client */ ;
238
+
239
+ --
240
+ -- Dumping data for table `tsigkeys`
241
+ --
242
+
243
+ LOCK TABLES ` tsigkeys` WRITE;
244
+ /* !40000 ALTER TABLE `tsigkeys` DISABLE KEYS */ ;
245
+ /* !40000 ALTER TABLE `tsigkeys` ENABLE KEYS */ ;
246
+ UNLOCK TABLES;
247
+ /* !40103 SET TIME_ZONE=@OLD_TIME_ZONE */ ;
248
+
249
+ /* !40101 SET SQL_MODE=@OLD_SQL_MODE */ ;
250
+ /* !40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */ ;
251
+ /* !40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */ ;
252
+ /* !40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */ ;
253
+ /* !40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */ ;
254
+ /* !40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */ ;
255
+ /* !40111 SET SQL_NOTES=@OLD_SQL_NOTES */ ;
0 commit comments