Skip to content

Commit 1b9ca73

Browse files
committed
+backup_data
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent cee25e1 commit 1b9ca73

File tree

1 file changed

+149
-99
lines changed

1 file changed

+149
-99
lines changed

lib/Migration/Version0023Date20210907122531.php

Lines changed: 149 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -73,102 +73,152 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
7373
$table = $schema->createTable('backup_changes');
7474
$table->addColumn(
7575
'id', 'integer', [
76-
'autoincrement' => true,
77-
'notnull' => true,
78-
'length' => 11,
79-
'unsigned' => true,
80-
]
76+
'autoincrement' => true,
77+
'notnull' => true,
78+
'length' => 11,
79+
'unsigned' => true,
80+
]
8181
);
8282
$table->addColumn(
8383
'path', 'text', [
84-
'notnull' => true
85-
]
84+
'notnull' => true
85+
]
8686
);
8787
$table->addColumn(
8888
'hash', 'string', [
89-
'notnull' => true,
90-
'length' => 63
91-
]
89+
'notnull' => true,
90+
'length' => 63
91+
]
9292
);
9393
$table->setPrimaryKey(['id']);
9494
$table->addUniqueIndex(['hash']);
9595
}
9696

9797

98+
/**
99+
* BACKUP_DATA
100+
*/
101+
if (!$schema->hasTable('backup_data')) {
102+
$table = $schema->createTable('backup_data');
103+
$table->addColumn(
104+
'id', 'integer', [
105+
'autoincrement' => true,
106+
'notnull' => true,
107+
'length' => 4,
108+
'unsigned' => true,
109+
]
110+
);
111+
$table->addColumn(
112+
'name', 'string', [
113+
'notnull' => true,
114+
'length' => 63
115+
]
116+
);
117+
$table->addColumn(
118+
'type', 'integer', [
119+
'notnull' => true,
120+
'length' => 11,
121+
'unsigned' => true
122+
]
123+
);
124+
$table->addColumn(
125+
'root', 'string', [
126+
'notnull' => true,
127+
'length' => 255
128+
]
129+
);
130+
$table->addColumn(
131+
'path', 'string', [
132+
'notnull' => true,
133+
'length' => 255
134+
]
135+
);
136+
$table->addColumn(
137+
'static', 'integer', [
138+
'notnull' => true,
139+
'length' => 1,
140+
'unsigned' => true,
141+
]
142+
);
143+
144+
$table->setPrimaryKey(['id']);
145+
}
146+
147+
98148
/**
99149
* BACKUP_POINT
100150
*/
101151
if (!$schema->hasTable('backup_point')) {
102152
$table = $schema->createTable('backup_point');
103153
$table->addColumn(
104154
'id', 'integer', [
105-
'autoincrement' => true,
106-
'notnull' => true,
107-
'length' => 4,
108-
'unsigned' => true,
109-
]
155+
'autoincrement' => true,
156+
'notnull' => true,
157+
'length' => 4,
158+
'unsigned' => true,
159+
]
110160
);
111161
$table->addColumn(
112162
'uid', 'string', [
113-
'notnull' => true,
114-
'length' => 63,
115-
]
163+
'notnull' => true,
164+
'length' => 63,
165+
]
116166
);
117167
$table->addColumn(
118168
'archive', 'integer', [
119-
'unsigned' => true,
120-
'notnull' => true,
121-
'length' => 1,
122-
]
169+
'unsigned' => true,
170+
'notnull' => true,
171+
'length' => 1,
172+
]
123173
);
124174
$table->addColumn(
125175
'lock', 'integer', [
126-
'notnull' => true,
127-
'unsigned' => true,
128-
'length' => 11,
129-
]
176+
'notnull' => true,
177+
'unsigned' => true,
178+
'length' => 11,
179+
]
130180
);
131181
$table->addColumn(
132182
'instance', 'string', [
133-
'notnull' => true,
134-
'length' => 127,
135-
]
183+
'notnull' => true,
184+
'length' => 127,
185+
]
136186
);
137187
$table->addColumn(
138188
'parent', 'string', [
139-
'notnull' => true,
140-
'length' => 63,
141-
]
189+
'notnull' => true,
190+
'length' => 63,
191+
]
142192
);
143193
$table->addColumn(
144194
'status', 'integer', [
145-
'notnull' => true,
146-
'unsigned' => true,
147-
'length' => 1
148-
]
195+
'notnull' => true,
196+
'unsigned' => true,
197+
'length' => 1
198+
]
149199
);
150200
$table->addColumn(
151201
'notes', 'text', [
152-
'notnull' => true
153-
]
202+
'notnull' => true
203+
]
154204
);
155205
$table->addColumn(
156206
'metadata', 'text', [
157-
'notnull' => true
158-
]
207+
'notnull' => true
208+
]
159209
);
160210
$table->addColumn(
161211
'health', 'text', [
162-
'notnull' => false,
163-
'default' => '[]'
164-
]
212+
'notnull' => false,
213+
'default' => '[]'
214+
]
165215
);
166216
$table->addColumn(
167217
'date', 'integer', [
168-
'notnull' => true,
169-
'unsigned' => true,
170-
'length' => 11
171-
]
218+
'notnull' => true,
219+
'unsigned' => true,
220+
'length' => 11
221+
]
172222
);
173223

174224
$table->setPrimaryKey(['id']);
@@ -186,28 +236,28 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
186236
$table = $schema->createTable('backup_external');
187237
$table->addColumn(
188238
'id', 'integer', [
189-
'autoincrement' => true,
190-
'notnull' => true,
191-
'length' => 4,
192-
'unsigned' => true,
193-
]
239+
'autoincrement' => true,
240+
'notnull' => true,
241+
'length' => 4,
242+
'unsigned' => true,
243+
]
194244
);
195245
$table->addColumn(
196246
'storage_id', 'integer', [
197-
'notnull' => false,
198-
'length' => 4,
199-
]
247+
'notnull' => false,
248+
'length' => 4,
249+
]
200250
);
201251
$table->addColumn(
202252
'root', 'string', [
203-
'notnull' => false,
204-
'length' => 255,
205-
]
253+
'notnull' => false,
254+
'length' => 255,
255+
]
206256
);
207257
$table->addColumn(
208258
'creation', 'datetime', [
209-
'notnull' => false,
210-
]
259+
'notnull' => false,
260+
]
211261
);
212262

213263
$table->setPrimaryKey(['id']);
@@ -222,46 +272,46 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
222272
$table = $schema->createTable('backup_remote');
223273
$table->addColumn(
224274
'id', 'integer', [
225-
'autoincrement' => true,
226-
'notnull' => true,
227-
'length' => 4,
228-
'unsigned' => true,
229-
]
275+
'autoincrement' => true,
276+
'notnull' => true,
277+
'length' => 4,
278+
'unsigned' => true,
279+
]
230280
);
231281
$table->addColumn(
232282
'uid', 'string', [
233-
'notnull' => false,
234-
'length' => 20,
235-
]
283+
'notnull' => false,
284+
'length' => 20,
285+
]
236286
);
237287
$table->addColumn(
238288
'instance', 'string', [
239-
'notnull' => false,
240-
'length' => 127,
241-
]
289+
'notnull' => false,
290+
'length' => 127,
291+
]
242292
);
243293
$table->addColumn(
244294
'exchange', 'integer', [
245-
'notnull' => true,
246-
'length' => 1,
247-
'unsigned' => true,
248-
]
295+
'notnull' => true,
296+
'length' => 1,
297+
'unsigned' => true,
298+
]
249299
);
250300
$table->addColumn(
251301
'href', 'string', [
252-
'notnull' => false,
253-
'length' => 254,
254-
]
302+
'notnull' => false,
303+
'length' => 254,
304+
]
255305
);
256306
$table->addColumn(
257307
'item', 'text', [
258-
'notnull' => false,
259-
]
308+
'notnull' => false,
309+
]
260310
);
261311
$table->addColumn(
262312
'creation', 'datetime', [
263-
'notnull' => false,
264-
]
313+
'notnull' => false,
314+
]
265315
);
266316

267317
$table->setPrimaryKey(['id']);
@@ -278,38 +328,38 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
278328
$table = $schema->createTable('backup_event');
279329
$table->addColumn(
280330
'id', 'integer', [
281-
'autoincrement' => true,
282-
'notnull' => true,
283-
'length' => 4,
284-
'unsigned' => true,
285-
]
331+
'autoincrement' => true,
332+
'notnull' => true,
333+
'length' => 4,
334+
'unsigned' => true,
335+
]
286336
);
287337
$table->addColumn(
288338
'author', 'string', [
289-
'notnull' => false,
290-
'length' => 127,
291-
]
339+
'notnull' => false,
340+
'length' => 127,
341+
]
292342
);
293343
$table->addColumn(
294344
'type', 'string', [
295-
'notnull' => false,
296-
'length' => 127,
297-
]
345+
'notnull' => false,
346+
'length' => 127,
347+
]
298348
);
299349
$table->addColumn(
300350
'status', 'integer', [
301-
'notnull' => false,
302-
'unsigned' => true,
303-
'length' => 1,
304-
]
351+
'notnull' => false,
352+
'unsigned' => true,
353+
'length' => 1,
354+
]
305355
);
306356
$table->addColumn(
307357
'data', 'text', [
308-
]
358+
]
309359
);
310360
$table->addColumn(
311361
'result', 'string', [
312-
]
362+
]
313363
);
314364

315365
$table->setPrimaryKey(['id']);

0 commit comments

Comments
 (0)