Completed
Pull Request — master (#7517)
by Björn
16:23
created
core/Migrations/Version13000Date20170718121200.php 1 patch
Indentation   +886 added lines, -886 removed lines patch added patch discarded remove patch
@@ -30,891 +30,891 @@
 block discarded – undo
30 30
 
31 31
 class Version13000Date20170718121200 extends SimpleMigrationStep {
32 32
 
33
-	/**
34
-	 * @param IOutput $output
35
-	 * @param \Closure $schemaClosure The `\Closure` returns a `Schema`
36
-	 * @param array $options
37
-	 * @return null|Schema
38
-	 * @since 13.0.0
39
-	 */
40
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
41
-		/** @var Schema $schema */
42
-		$schema = $schemaClosure();
43
-
44
-		if (!$schema->hasTable('appconfig')) {
45
-			$table = $schema->createTable('appconfig');
46
-			$table->addColumn('appid', 'string', [
47
-				'notnull' => true,
48
-				'length' => 32,
49
-				'default' => '',
50
-			]);
51
-			$table->addColumn('configkey', 'string', [
52
-				'notnull' => true,
53
-				'length' => 64,
54
-				'default' => '',
55
-			]);
56
-			$table->addColumn('configvalue', 'text', [
57
-				'notnull' => false,
58
-			]);
59
-			$table->setPrimaryKey(['appid', 'configkey']);
60
-			$table->addIndex(['configkey'], 'appconfig_config_key_index');
61
-			$table->addIndex(['appid'], 'appconfig_appid_key');
62
-		}
63
-
64
-		if (!$schema->hasTable('storages')) {
65
-			$table = $schema->createTable('storages');
66
-			$table->addColumn('id', 'string', [
67
-				'notnull' => false,
68
-				'length' => 64,
69
-			]);
70
-			$table->addColumn('numeric_id', Type::BIGINT, [
71
-				'autoincrement' => true,
72
-				'notnull' => true,
73
-				'length' => 20,
74
-			]);
75
-			$table->addColumn('available', 'integer', [
76
-				'notnull' => true,
77
-				'default' => 1,
78
-			]);
79
-			$table->addColumn('last_checked', 'integer', [
80
-				'notnull' => false,
81
-			]);
82
-			$table->setPrimaryKey(['numeric_id']);
83
-			$table->addUniqueIndex(['id'], 'storages_id_index');
84
-		}
85
-
86
-		if (!$schema->hasTable('mounts')) {
87
-			$table = $schema->createTable('mounts');
88
-			$table->addColumn('id', 'integer', [
89
-				'autoincrement' => true,
90
-				'notnull' => true,
91
-				'length' => 4,
92
-			]);
93
-			$table->addColumn('storage_id', 'integer', [
94
-				'notnull' => true,
95
-			]);
96
-			$table->addColumn('root_id', 'integer', [
97
-				'notnull' => true,
98
-			]);
99
-			$table->addColumn('user_id', 'string', [
100
-				'notnull' => true,
101
-				'length' => 64,
102
-			]);
103
-			$table->addColumn('mount_point', 'string', [
104
-				'notnull' => true,
105
-				'length' => 4000,
106
-			]);
107
-			$table->addColumn('mount_id', 'integer', [
108
-				'notnull' => false,
109
-			]);
110
-			$table->setPrimaryKey(['id']);
111
-			$table->addIndex(['user_id'], 'mounts_user_index');
112
-			$table->addIndex(['storage_id'], 'mounts_storage_index');
113
-			$table->addIndex(['root_id'], 'mounts_root_index');
114
-			$table->addIndex(['mount_id'], 'mounts_mount_id_index');
115
-			$table->addUniqueIndex(['user_id', 'root_id'], 'mounts_user_root_index');
116
-		}
117
-
118
-		if (!$schema->hasTable('mimetypes')) {
119
-			$table = $schema->createTable('mimetypes');
120
-			$table->addColumn('id', Type::BIGINT, [
121
-				'autoincrement' => true,
122
-				'notnull' => true,
123
-				'length' => 20,
124
-			]);
125
-			$table->addColumn('mimetype', 'string', [
126
-				'notnull' => true,
127
-				'length' => 255,
128
-				'default' => '',
129
-			]);
130
-			$table->setPrimaryKey(['id']);
131
-			$table->addUniqueIndex(['mimetype'], 'mimetype_id_index');
132
-		}
133
-
134
-		if (!$schema->hasTable('filecache')) {
135
-			$table = $schema->createTable('filecache');
136
-			$table->addColumn('fileid', Type::BIGINT, [
137
-				'autoincrement' => true,
138
-				'notnull' => true,
139
-				'length' => 20,
140
-			]);
141
-			$table->addColumn('storage', Type::BIGINT, [
142
-				'notnull' => true,
143
-				'length' => 20,
144
-				'default' => 0,
145
-			]);
146
-			$table->addColumn('path', 'string', [
147
-				'notnull' => false,
148
-				'length' => 4000,
149
-			]);
150
-			$table->addColumn('path_hash', 'string', [
151
-				'notnull' => true,
152
-				'length' => 32,
153
-				'default' => '',
154
-			]);
155
-			$table->addColumn('parent', Type::BIGINT, [
156
-				'notnull' => true,
157
-				'length' => 20,
158
-				'default' => 0,
159
-			]);
160
-			$table->addColumn('name', 'string', [
161
-				'notnull' => false,
162
-				'length' => 250,
163
-			]);
164
-			$table->addColumn('mimetype', Type::BIGINT, [
165
-				'notnull' => true,
166
-				'length' => 20,
167
-				'default' => 0,
168
-			]);
169
-			$table->addColumn('mimepart', Type::BIGINT, [
170
-				'notnull' => true,
171
-				'length' => 20,
172
-				'default' => 0,
173
-			]);
174
-			$table->addColumn('size', 'bigint', [
175
-				'notnull' => true,
176
-				'length' => 8,
177
-				'default' => 0,
178
-			]);
179
-			$table->addColumn('mtime', 'integer', [
180
-				'notnull' => true,
181
-				'length' => 4,
182
-				'default' => 0,
183
-			]);
184
-			$table->addColumn('storage_mtime', 'integer', [
185
-				'notnull' => true,
186
-				'length' => 4,
187
-				'default' => 0,
188
-			]);
189
-			$table->addColumn('encrypted', 'integer', [
190
-				'notnull' => true,
191
-				'length' => 4,
192
-				'default' => 0,
193
-			]);
194
-			$table->addColumn('unencrypted_size', 'bigint', [
195
-				'notnull' => true,
196
-				'length' => 8,
197
-				'default' => 0,
198
-			]);
199
-			$table->addColumn('etag', 'string', [
200
-				'notnull' => false,
201
-				'length' => 40,
202
-			]);
203
-			$table->addColumn('permissions', 'integer', [
204
-				'notnull' => false,
205
-				'length' => 4,
206
-				'default' => 0,
207
-			]);
208
-			$table->addColumn('checksum', 'string', [
209
-				'notnull' => false,
210
-				'length' => 255,
211
-			]);
212
-			$table->setPrimaryKey(['fileid']);
213
-			$table->addUniqueIndex(['storage', 'path_hash'], 'fs_storage_path_hash');
214
-			$table->addIndex(['parent', 'name'], 'fs_parent_name_hash');
215
-			$table->addIndex(['storage', 'mimetype'], 'fs_storage_mimetype');
216
-			$table->addIndex(['storage', 'mimepart'], 'fs_storage_mimepart');
217
-			$table->addIndex(['storage', 'size', 'fileid'], 'fs_storage_size');
218
-		}
219
-
220
-		if (!$schema->hasTable('group_user')) {
221
-			$table = $schema->createTable('group_user');
222
-			$table->addColumn('gid', 'string', [
223
-				'notnull' => true,
224
-				'length' => 64,
225
-				'default' => '',
226
-			]);
227
-			$table->addColumn('uid', 'string', [
228
-				'notnull' => true,
229
-				'length' => 64,
230
-				'default' => '',
231
-			]);
232
-			$table->setPrimaryKey(['gid', 'uid']);
233
-			$table->addIndex(['uid'], 'gu_uid_index');
234
-		}
235
-
236
-		if (!$schema->hasTable('group_admin')) {
237
-			$table = $schema->createTable('group_admin');
238
-			$table->addColumn('gid', 'string', [
239
-				'notnull' => true,
240
-				'length' => 64,
241
-				'default' => '',
242
-			]);
243
-			$table->addColumn('uid', 'string', [
244
-				'notnull' => true,
245
-				'length' => 64,
246
-				'default' => '',
247
-			]);
248
-			$table->setPrimaryKey(['gid', 'uid']);
249
-			$table->addIndex(['uid'], 'group_admin_uid');
250
-		}
251
-
252
-		if (!$schema->hasTable('groups')) {
253
-			$table = $schema->createTable('groups');
254
-			$table->addColumn('gid', 'string', [
255
-				'notnull' => true,
256
-				'length' => 64,
257
-				'default' => '',
258
-			]);
259
-			$table->setPrimaryKey(['gid']);
260
-		}
261
-
262
-		if (!$schema->hasTable('preferences')) {
263
-			$table = $schema->createTable('preferences');
264
-			$table->addColumn('userid', 'string', [
265
-				'notnull' => true,
266
-				'length' => 64,
267
-				'default' => '',
268
-			]);
269
-			$table->addColumn('appid', 'string', [
270
-				'notnull' => true,
271
-				'length' => 32,
272
-				'default' => '',
273
-			]);
274
-			$table->addColumn('configkey', 'string', [
275
-				'notnull' => true,
276
-				'length' => 64,
277
-				'default' => '',
278
-			]);
279
-			$table->addColumn('configvalue', 'text', [
280
-				'notnull' => false,
281
-			]);
282
-			$table->setPrimaryKey(['userid', 'appid', 'configkey']);
283
-		}
284
-
285
-		if (!$schema->hasTable('properties')) {
286
-			$table = $schema->createTable('properties');
287
-			$table->addColumn('id', 'integer', [
288
-				'autoincrement' => true,
289
-				'notnull' => true,
290
-				'length' => 4,
291
-			]);
292
-			$table->addColumn('userid', 'string', [
293
-				'notnull' => true,
294
-				'length' => 64,
295
-				'default' => '',
296
-			]);
297
-			$table->addColumn('propertypath', 'string', [
298
-				'notnull' => true,
299
-				'length' => 255,
300
-				'default' => '',
301
-			]);
302
-			$table->addColumn('propertyname', 'string', [
303
-				'notnull' => true,
304
-				'length' => 255,
305
-				'default' => '',
306
-			]);
307
-			$table->addColumn('propertyvalue', 'text', [
308
-				'notnull' => true,
309
-			]);
310
-			$table->setPrimaryKey(['id']);
311
-			$table->addIndex(['userid'], 'property_index');
312
-		}
313
-
314
-		if (!$schema->hasTable('share')) {
315
-			$table = $schema->createTable('share');
316
-			$table->addColumn('id', 'integer', [
317
-				'autoincrement' => true,
318
-				'notnull' => true,
319
-				'length' => 4,
320
-			]);
321
-			$table->addColumn('share_type', 'smallint', [
322
-				'notnull' => true,
323
-				'length' => 1,
324
-				'default' => 0,
325
-			]);
326
-			$table->addColumn('share_with', 'string', [
327
-				'notnull' => false,
328
-				'length' => 255,
329
-			]);
330
-			$table->addColumn('password', 'string', [
331
-				'notnull' => false,
332
-				'length' => 255,
333
-			]);
334
-			$table->addColumn('uid_owner', 'string', [
335
-				'notnull' => true,
336
-				'length' => 64,
337
-				'default' => '',
338
-			]);
339
-			$table->addColumn('uid_initiator', 'string', [
340
-				'notnull' => false,
341
-				'length' => 64,
342
-			]);
343
-			$table->addColumn('parent', 'integer', [
344
-				'notnull' => false,
345
-				'length' => 4,
346
-			]);
347
-			$table->addColumn('item_type', 'string', [
348
-				'notnull' => true,
349
-				'length' => 64,
350
-				'default' => '',
351
-			]);
352
-			$table->addColumn('item_source', 'string', [
353
-				'notnull' => false,
354
-				'length' => 255,
355
-			]);
356
-			$table->addColumn('item_target', 'string', [
357
-				'notnull' => false,
358
-				'length' => 255,
359
-			]);
360
-			$table->addColumn('file_source', 'integer', [
361
-				'notnull' => false,
362
-				'length' => 4,
363
-			]);
364
-			$table->addColumn('file_target', 'string', [
365
-				'notnull' => false,
366
-				'length' => 512,
367
-			]);
368
-			$table->addColumn('permissions', 'smallint', [
369
-				'notnull' => true,
370
-				'length' => 1,
371
-				'default' => 0,
372
-			]);
373
-			$table->addColumn('stime', 'bigint', [
374
-				'notnull' => true,
375
-				'length' => 8,
376
-				'default' => 0,
377
-			]);
378
-			$table->addColumn('accepted', 'smallint', [
379
-				'notnull' => true,
380
-				'length' => 1,
381
-				'default' => 0,
382
-			]);
383
-			$table->addColumn('expiration', 'datetime', [
384
-				'notnull' => false,
385
-			]);
386
-			$table->addColumn('token', 'string', [
387
-				'notnull' => false,
388
-				'length' => 32,
389
-			]);
390
-			$table->addColumn('mail_send', 'smallint', [
391
-				'notnull' => true,
392
-				'length' => 1,
393
-				'default' => 0,
394
-			]);
395
-			$table->addColumn('share_name', 'string', [
396
-				'notnull' => false,
397
-				'length' => 64,
398
-			]);
399
-			$table->setPrimaryKey(['id']);
400
-			$table->addIndex(['item_type', 'share_type'], 'item_share_type_index');
401
-			$table->addIndex(['file_source'], 'file_source_index');
402
-			$table->addIndex(['token'], 'token_index');
403
-			$table->addIndex(['share_with'], 'share_with_index');
404
-		}
405
-
406
-		if (!$schema->hasTable('jobs')) {
407
-			$table = $schema->createTable('jobs');
408
-			$table->addColumn('id', 'integer', [
409
-				'autoincrement' => true,
410
-				'notnull' => true,
411
-				'length' => 4,
412
-				'unsigned' => true,
413
-			]);
414
-			$table->addColumn('class', 'string', [
415
-				'notnull' => true,
416
-				'length' => 255,
417
-				'default' => '',
418
-			]);
419
-			$table->addColumn('argument', 'string', [
420
-				'notnull' => true,
421
-				'length' => 4000,
422
-				'default' => '',
423
-			]);
424
-			$table->addColumn('last_run', 'integer', [
425
-				'notnull' => false,
426
-				'default' => 0,
427
-			]);
428
-			$table->addColumn('last_checked', 'integer', [
429
-				'notnull' => false,
430
-				'default' => 0,
431
-			]);
432
-			$table->addColumn('reserved_at', 'integer', [
433
-				'notnull' => false,
434
-				'default' => 0,
435
-			]);
436
-			$table->addColumn('execution_duration', 'integer', [
437
-				'notnull' => true,
438
-				'default' => 0,
439
-			]);
440
-			$table->setPrimaryKey(['id']);
441
-			$table->addIndex(['class'], 'job_class_index');
442
-		}
443
-
444
-		if (!$schema->hasTable('users')) {
445
-			$table = $schema->createTable('users');
446
-			$table->addColumn('uid', 'string', [
447
-				'notnull' => true,
448
-				'length' => 64,
449
-				'default' => '',
450
-			]);
451
-			$table->addColumn('displayname', 'string', [
452
-				'notnull' => false,
453
-				'length' => 64,
454
-			]);
455
-			$table->addColumn('password', 'string', [
456
-				'notnull' => true,
457
-				'length' => 255,
458
-				'default' => '',
459
-			]);
460
-			$table->setPrimaryKey(['uid']);
461
-		}
462
-
463
-		if (!$schema->hasTable('authtoken')) {
464
-			$table = $schema->createTable('authtoken');
465
-			$table->addColumn('id', 'integer', [
466
-				'autoincrement' => true,
467
-				'notnull' => true,
468
-				'length' => 4,
469
-				'unsigned' => true,
470
-			]);
471
-			$table->addColumn('uid', 'string', [
472
-				'notnull' => true,
473
-				'length' => 64,
474
-				'default' => '',
475
-			]);
476
-			$table->addColumn('login_name', 'string', [
477
-				'notnull' => true,
478
-				'length' => 64,
479
-				'default' => '',
480
-			]);
481
-			$table->addColumn('password', 'text', [
482
-				'notnull' => false,
483
-			]);
484
-			$table->addColumn('name', 'text', [
485
-				'notnull' => true,
486
-				'default' => '',
487
-			]);
488
-			$table->addColumn('token', 'string', [
489
-				'notnull' => true,
490
-				'length' => 200,
491
-				'default' => '',
492
-			]);
493
-			$table->addColumn('type', 'smallint', [
494
-				'notnull' => true,
495
-				'length' => 2,
496
-				'default' => 0,
497
-				'unsigned' => true,
498
-			]);
499
-			$table->addColumn('remember', 'smallint', [
500
-				'notnull' => true,
501
-				'length' => 1,
502
-				'default' => 0,
503
-				'unsigned' => true,
504
-			]);
505
-			$table->addColumn('last_activity', 'integer', [
506
-				'notnull' => true,
507
-				'length' => 4,
508
-				'default' => 0,
509
-				'unsigned' => true,
510
-			]);
511
-			$table->addColumn('last_check', 'integer', [
512
-				'notnull' => true,
513
-				'length' => 4,
514
-				'default' => 0,
515
-				'unsigned' => true,
516
-			]);
517
-			$table->addColumn('scope', 'text', [
518
-				'notnull' => false,
519
-			]);
520
-			$table->setPrimaryKey(['id']);
521
-			$table->addUniqueIndex(['token'], 'authtoken_token_index');
522
-			$table->addIndex(['last_activity'], 'authtoken_last_activity_index');
523
-		}
524
-
525
-		if (!$schema->hasTable('bruteforce_attempts')) {
526
-			$table = $schema->createTable('bruteforce_attempts');
527
-			$table->addColumn('id', 'integer', [
528
-				'autoincrement' => true,
529
-				'notnull' => true,
530
-				'length' => 4,
531
-				'unsigned' => true,
532
-			]);
533
-			$table->addColumn('action', 'string', [
534
-				'notnull' => true,
535
-				'length' => 64,
536
-				'default' => '',
537
-			]);
538
-			$table->addColumn('occurred', 'integer', [
539
-				'notnull' => true,
540
-				'length' => 4,
541
-				'default' => 0,
542
-				'unsigned' => true,
543
-			]);
544
-			$table->addColumn('ip', 'string', [
545
-				'notnull' => true,
546
-				'length' => 255,
547
-				'default' => '',
548
-			]);
549
-			$table->addColumn('subnet', 'string', [
550
-				'notnull' => true,
551
-				'length' => 255,
552
-				'default' => '',
553
-			]);
554
-			$table->addColumn('metadata', 'string', [
555
-				'notnull' => true,
556
-				'length' => 255,
557
-				'default' => '',
558
-			]);
559
-			$table->setPrimaryKey(['id']);
560
-			$table->addIndex(['ip'], 'bruteforce_attempts_ip');
561
-			$table->addIndex(['subnet'], 'bruteforce_attempts_subnet');
562
-		}
563
-
564
-		if (!$schema->hasTable('vcategory')) {
565
-			$table = $schema->createTable('vcategory');
566
-			$table->addColumn('id', 'integer', [
567
-				'autoincrement' => true,
568
-				'notnull' => true,
569
-				'length' => 4,
570
-				'unsigned' => true,
571
-			]);
572
-			$table->addColumn('uid', 'string', [
573
-				'notnull' => true,
574
-				'length' => 64,
575
-				'default' => '',
576
-			]);
577
-			$table->addColumn('type', 'string', [
578
-				'notnull' => true,
579
-				'length' => 64,
580
-				'default' => '',
581
-			]);
582
-			$table->addColumn('category', 'string', [
583
-				'notnull' => true,
584
-				'length' => 255,
585
-				'default' => '',
586
-			]);
587
-			$table->setPrimaryKey(['id']);
588
-			$table->addIndex(['uid'], 'uid_index');
589
-			$table->addIndex(['type'], 'type_index');
590
-			$table->addIndex(['category'], 'category_index');
591
-		}
592
-
593
-		if (!$schema->hasTable('vcategory_to_object')) {
594
-			$table = $schema->createTable('vcategory_to_object');
595
-			$table->addColumn('objid', 'integer', [
596
-				'notnull' => true,
597
-				'length' => 4,
598
-				'default' => 0,
599
-				'unsigned' => true,
600
-			]);
601
-			$table->addColumn('categoryid', 'integer', [
602
-				'notnull' => true,
603
-				'length' => 4,
604
-				'default' => 0,
605
-				'unsigned' => true,
606
-			]);
607
-			$table->addColumn('type', 'string', [
608
-				'notnull' => true,
609
-				'length' => 64,
610
-				'default' => '',
611
-			]);
612
-			$table->setPrimaryKey(['categoryid', 'objid', 'type']);
613
-			$table->addIndex(['objid', 'type'], 'vcategory_objectd_index');
614
-		}
615
-
616
-		if (!$schema->hasTable('systemtag')) {
617
-			$table = $schema->createTable('systemtag');
618
-			$table->addColumn('id', 'integer', [
619
-				'autoincrement' => true,
620
-				'notnull' => true,
621
-				'length' => 4,
622
-				'unsigned' => true,
623
-			]);
624
-			$table->addColumn('name', 'string', [
625
-				'notnull' => true,
626
-				'length' => 64,
627
-				'default' => '',
628
-			]);
629
-			$table->addColumn('visibility', 'smallint', [
630
-				'notnull' => true,
631
-				'length' => 1,
632
-				'default' => 1,
633
-			]);
634
-			$table->addColumn('editable', 'smallint', [
635
-				'notnull' => true,
636
-				'length' => 1,
637
-				'default' => 1,
638
-			]);
639
-			$table->setPrimaryKey(['id']);
640
-			$table->addUniqueIndex(['name', 'visibility', 'editable'], 'tag_ident');
641
-		}
642
-
643
-		if (!$schema->hasTable('systemtag_object_mapping')) {
644
-			$table = $schema->createTable('systemtag_object_mapping');
645
-			$table->addColumn('objectid', 'string', [
646
-				'notnull' => true,
647
-				'length' => 64,
648
-				'default' => '',
649
-			]);
650
-			$table->addColumn('objecttype', 'string', [
651
-				'notnull' => true,
652
-				'length' => 64,
653
-				'default' => '',
654
-			]);
655
-			$table->addColumn('systemtagid', 'integer', [
656
-				'notnull' => true,
657
-				'length' => 4,
658
-				'default' => 0,
659
-				'unsigned' => true,
660
-			]);
661
-			$table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping');
662
-		}
663
-
664
-		if (!$schema->hasTable('systemtag_group')) {
665
-			$table = $schema->createTable('systemtag_group');
666
-			$table->addColumn('systemtagid', 'integer', [
667
-				'notnull' => true,
668
-				'length' => 4,
669
-				'default' => 0,
670
-				'unsigned' => true,
671
-			]);
672
-			$table->addColumn('gid', 'string', [
673
-				'notnull' => true,
674
-			]);
675
-			$table->setPrimaryKey(['gid', 'systemtagid']);
676
-		}
677
-
678
-		if (!$schema->hasTable('file_locks')) {
679
-			$table = $schema->createTable('file_locks');
680
-			$table->addColumn('id', 'integer', [
681
-				'autoincrement' => true,
682
-				'notnull' => true,
683
-				'length' => 4,
684
-				'unsigned' => true,
685
-			]);
686
-			$table->addColumn('lock', 'integer', [
687
-				'notnull' => true,
688
-				'length' => 4,
689
-				'default' => 0,
690
-			]);
691
-			$table->addColumn('key', 'string', [
692
-				'notnull' => true,
693
-				'length' => 64,
694
-			]);
695
-			$table->addColumn('ttl', 'integer', [
696
-				'notnull' => true,
697
-				'length' => 4,
698
-				'default' => -1,
699
-			]);
700
-			$table->setPrimaryKey(['id']);
701
-			$table->addUniqueIndex(['key'], 'lock_key_index');
702
-			$table->addIndex(['ttl'], 'lock_ttl_index');
703
-		}
704
-
705
-		if (!$schema->hasTable('comments')) {
706
-			$table = $schema->createTable('comments');
707
-			$table->addColumn('id', 'integer', [
708
-				'autoincrement' => true,
709
-				'notnull' => true,
710
-				'length' => 4,
711
-				'unsigned' => true,
712
-			]);
713
-			$table->addColumn('parent_id', 'integer', [
714
-				'notnull' => true,
715
-				'length' => 4,
716
-				'default' => 0,
717
-				'unsigned' => true,
718
-			]);
719
-			$table->addColumn('topmost_parent_id', 'integer', [
720
-				'notnull' => true,
721
-				'length' => 4,
722
-				'default' => 0,
723
-				'unsigned' => true,
724
-			]);
725
-			$table->addColumn('children_count', 'integer', [
726
-				'notnull' => true,
727
-				'length' => 4,
728
-				'default' => 0,
729
-				'unsigned' => true,
730
-			]);
731
-			$table->addColumn('actor_type', 'string', [
732
-				'notnull' => true,
733
-				'length' => 64,
734
-				'default' => '',
735
-			]);
736
-			$table->addColumn('actor_id', 'string', [
737
-				'notnull' => true,
738
-				'length' => 64,
739
-				'default' => '',
740
-			]);
741
-			$table->addColumn('message', 'text', [
742
-				'notnull' => false,
743
-			]);
744
-			$table->addColumn('verb', 'string', [
745
-				'notnull' => false,
746
-				'length' => 64,
747
-			]);
748
-			$table->addColumn('creation_timestamp', 'datetime', [
749
-				'notnull' => false,
750
-			]);
751
-			$table->addColumn('latest_child_timestamp', 'datetime', [
752
-				'notnull' => false,
753
-			]);
754
-			$table->addColumn('object_type', 'string', [
755
-				'notnull' => true,
756
-				'length' => 64,
757
-				'default' => '',
758
-			]);
759
-			$table->addColumn('object_id', 'string', [
760
-				'notnull' => true,
761
-				'length' => 64,
762
-				'default' => '',
763
-			]);
764
-			$table->setPrimaryKey(['id']);
765
-			$table->addIndex(['parent_id'], 'comments_parent_id_index');
766
-			$table->addIndex(['topmost_parent_id'], 'comments_topmost_parent_id_idx');
767
-			$table->addIndex(['object_type', 'object_id', 'creation_timestamp'], 'comments_object_index');
768
-			$table->addIndex(['actor_type', 'actor_id'], 'comments_actor_index');
769
-		}
770
-
771
-		if (!$schema->hasTable('comments_read_markers')) {
772
-			$table = $schema->createTable('comments_read_markers');
773
-			$table->addColumn('user_id', 'string', [
774
-				'notnull' => true,
775
-				'length' => 64,
776
-				'default' => '',
777
-			]);
778
-			$table->addColumn('marker_datetime', 'datetime', [
779
-				'notnull' => false,
780
-			]);
781
-			$table->addColumn('object_type', 'string', [
782
-				'notnull' => true,
783
-				'length' => 64,
784
-				'default' => '',
785
-			]);
786
-			$table->addColumn('object_id', 'string', [
787
-				'notnull' => true,
788
-				'length' => 64,
789
-				'default' => '',
790
-			]);
791
-			$table->addIndex(['object_type', 'object_id'], 'comments_marker_object_index');
792
-			$table->addUniqueIndex(['user_id', 'object_type', 'object_id'], 'comments_marker_index');
793
-		}
794
-
795
-		if (!$schema->hasTable('credentials')) {
796
-			$table = $schema->createTable('credentials');
797
-			$table->addColumn('user', 'string', [
798
-				'notnull' => true,
799
-				'length' => 64,
800
-			]);
801
-			$table->addColumn('identifier', 'string', [
802
-				'notnull' => true,
803
-				'length' => 64,
804
-			]);
805
-			$table->addColumn('credentials', 'text', [
806
-				'notnull' => false,
807
-			]);
808
-			$table->setPrimaryKey(['user', 'identifier']);
809
-			$table->addIndex(['user'], 'credentials_user');
810
-		}
811
-
812
-		if (!$schema->hasTable('admin_sections')) {
813
-			$table = $schema->createTable('admin_sections');
814
-			$table->addColumn('id', 'string', [
815
-				'notnull' => true,
816
-				'length' => 64,
817
-			]);
818
-			$table->addColumn('class', 'string', [
819
-				'notnull' => true,
820
-				'length' => 255,
821
-				'default' => '',
822
-			]);
823
-			$table->addColumn('priority', 'smallint', [
824
-				'notnull' => true,
825
-				'length' => 1,
826
-				'default' => 0,
827
-			]);
828
-			$table->setPrimaryKey(['id']);
829
-			$table->addUniqueIndex(['class'], 'admin_sections_class');
830
-		}
831
-
832
-		if (!$schema->hasTable('admin_settings')) {
833
-			$table = $schema->createTable('admin_settings');
834
-			$table->addColumn('id', 'integer', [
835
-				'autoincrement' => true,
836
-				'notnull' => true,
837
-				'length' => 4,
838
-			]);
839
-			$table->addColumn('class', 'string', [
840
-				'notnull' => true,
841
-				'length' => 255,
842
-				'default' => '',
843
-			]);
844
-			$table->addColumn('section', 'string', [
845
-				'notnull' => false,
846
-				'length' => 64,
847
-			]);
848
-			$table->addColumn('priority', 'smallint', [
849
-				'notnull' => true,
850
-				'length' => 1,
851
-				'default' => 0,
852
-			]);
853
-			$table->setPrimaryKey(['id']);
854
-			$table->addUniqueIndex(['class'], 'admin_settings_class');
855
-			$table->addIndex(['section'], 'admin_settings_section');
856
-		}
857
-
858
-		if (!$schema->hasTable('personal_sections')) {
859
-			$table = $schema->createTable('personal_sections');
860
-			$table->addColumn('id', 'string', [
861
-				'notnull' => true,
862
-				'length' => 64,
863
-			]);
864
-			$table->addColumn('class', 'string', [
865
-				'notnull' => true,
866
-				'length' => 255,
867
-				'default' => '',
868
-			]);
869
-			$table->addColumn('priority', 'smallint', [
870
-				'notnull' => true,
871
-				'length' => 1,
872
-				'default' => 0,
873
-			]);
874
-			$table->setPrimaryKey(['id']);
875
-			$table->addUniqueIndex(['class'], 'personal_sections_class');
876
-		}
877
-
878
-		if (!$schema->hasTable('personal_settings')) {
879
-			$table = $schema->createTable('personal_settings');
880
-			$table->addColumn('id', 'integer', [
881
-				'autoincrement' => true,
882
-				'notnull' => true,
883
-				'length' => 4,
884
-			]);
885
-			$table->addColumn('class', 'string', [
886
-				'notnull' => true,
887
-				'length' => 255,
888
-				'default' => '',
889
-			]);
890
-			$table->addColumn('section', 'string', [
891
-				'notnull' => false,
892
-				'length' => 64,
893
-			]);
894
-			$table->addColumn('priority', 'smallint', [
895
-				'notnull' => true,
896
-				'length' => 1,
897
-				'default' => 0,
898
-			]);
899
-			$table->setPrimaryKey(['id']);
900
-			$table->addUniqueIndex(['class'], 'personal_settings_class');
901
-			$table->addIndex(['section'], 'personal_settings_section');
902
-		}
903
-
904
-		if (!$schema->hasTable('accounts')) {
905
-			$table = $schema->createTable('accounts');
906
-			$table->addColumn('uid', 'string', [
907
-				'notnull' => true,
908
-				'length' => 64,
909
-				'default' => '',
910
-			]);
911
-			$table->addColumn('data', 'text', [
912
-				'notnull' => true,
913
-				'default' => '',
914
-			]);
915
-			$table->setPrimaryKey(['uid']);
916
-		}
917
-		return $schema;
918
-	}
33
+    /**
34
+     * @param IOutput $output
35
+     * @param \Closure $schemaClosure The `\Closure` returns a `Schema`
36
+     * @param array $options
37
+     * @return null|Schema
38
+     * @since 13.0.0
39
+     */
40
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
41
+        /** @var Schema $schema */
42
+        $schema = $schemaClosure();
43
+
44
+        if (!$schema->hasTable('appconfig')) {
45
+            $table = $schema->createTable('appconfig');
46
+            $table->addColumn('appid', 'string', [
47
+                'notnull' => true,
48
+                'length' => 32,
49
+                'default' => '',
50
+            ]);
51
+            $table->addColumn('configkey', 'string', [
52
+                'notnull' => true,
53
+                'length' => 64,
54
+                'default' => '',
55
+            ]);
56
+            $table->addColumn('configvalue', 'text', [
57
+                'notnull' => false,
58
+            ]);
59
+            $table->setPrimaryKey(['appid', 'configkey']);
60
+            $table->addIndex(['configkey'], 'appconfig_config_key_index');
61
+            $table->addIndex(['appid'], 'appconfig_appid_key');
62
+        }
63
+
64
+        if (!$schema->hasTable('storages')) {
65
+            $table = $schema->createTable('storages');
66
+            $table->addColumn('id', 'string', [
67
+                'notnull' => false,
68
+                'length' => 64,
69
+            ]);
70
+            $table->addColumn('numeric_id', Type::BIGINT, [
71
+                'autoincrement' => true,
72
+                'notnull' => true,
73
+                'length' => 20,
74
+            ]);
75
+            $table->addColumn('available', 'integer', [
76
+                'notnull' => true,
77
+                'default' => 1,
78
+            ]);
79
+            $table->addColumn('last_checked', 'integer', [
80
+                'notnull' => false,
81
+            ]);
82
+            $table->setPrimaryKey(['numeric_id']);
83
+            $table->addUniqueIndex(['id'], 'storages_id_index');
84
+        }
85
+
86
+        if (!$schema->hasTable('mounts')) {
87
+            $table = $schema->createTable('mounts');
88
+            $table->addColumn('id', 'integer', [
89
+                'autoincrement' => true,
90
+                'notnull' => true,
91
+                'length' => 4,
92
+            ]);
93
+            $table->addColumn('storage_id', 'integer', [
94
+                'notnull' => true,
95
+            ]);
96
+            $table->addColumn('root_id', 'integer', [
97
+                'notnull' => true,
98
+            ]);
99
+            $table->addColumn('user_id', 'string', [
100
+                'notnull' => true,
101
+                'length' => 64,
102
+            ]);
103
+            $table->addColumn('mount_point', 'string', [
104
+                'notnull' => true,
105
+                'length' => 4000,
106
+            ]);
107
+            $table->addColumn('mount_id', 'integer', [
108
+                'notnull' => false,
109
+            ]);
110
+            $table->setPrimaryKey(['id']);
111
+            $table->addIndex(['user_id'], 'mounts_user_index');
112
+            $table->addIndex(['storage_id'], 'mounts_storage_index');
113
+            $table->addIndex(['root_id'], 'mounts_root_index');
114
+            $table->addIndex(['mount_id'], 'mounts_mount_id_index');
115
+            $table->addUniqueIndex(['user_id', 'root_id'], 'mounts_user_root_index');
116
+        }
117
+
118
+        if (!$schema->hasTable('mimetypes')) {
119
+            $table = $schema->createTable('mimetypes');
120
+            $table->addColumn('id', Type::BIGINT, [
121
+                'autoincrement' => true,
122
+                'notnull' => true,
123
+                'length' => 20,
124
+            ]);
125
+            $table->addColumn('mimetype', 'string', [
126
+                'notnull' => true,
127
+                'length' => 255,
128
+                'default' => '',
129
+            ]);
130
+            $table->setPrimaryKey(['id']);
131
+            $table->addUniqueIndex(['mimetype'], 'mimetype_id_index');
132
+        }
133
+
134
+        if (!$schema->hasTable('filecache')) {
135
+            $table = $schema->createTable('filecache');
136
+            $table->addColumn('fileid', Type::BIGINT, [
137
+                'autoincrement' => true,
138
+                'notnull' => true,
139
+                'length' => 20,
140
+            ]);
141
+            $table->addColumn('storage', Type::BIGINT, [
142
+                'notnull' => true,
143
+                'length' => 20,
144
+                'default' => 0,
145
+            ]);
146
+            $table->addColumn('path', 'string', [
147
+                'notnull' => false,
148
+                'length' => 4000,
149
+            ]);
150
+            $table->addColumn('path_hash', 'string', [
151
+                'notnull' => true,
152
+                'length' => 32,
153
+                'default' => '',
154
+            ]);
155
+            $table->addColumn('parent', Type::BIGINT, [
156
+                'notnull' => true,
157
+                'length' => 20,
158
+                'default' => 0,
159
+            ]);
160
+            $table->addColumn('name', 'string', [
161
+                'notnull' => false,
162
+                'length' => 250,
163
+            ]);
164
+            $table->addColumn('mimetype', Type::BIGINT, [
165
+                'notnull' => true,
166
+                'length' => 20,
167
+                'default' => 0,
168
+            ]);
169
+            $table->addColumn('mimepart', Type::BIGINT, [
170
+                'notnull' => true,
171
+                'length' => 20,
172
+                'default' => 0,
173
+            ]);
174
+            $table->addColumn('size', 'bigint', [
175
+                'notnull' => true,
176
+                'length' => 8,
177
+                'default' => 0,
178
+            ]);
179
+            $table->addColumn('mtime', 'integer', [
180
+                'notnull' => true,
181
+                'length' => 4,
182
+                'default' => 0,
183
+            ]);
184
+            $table->addColumn('storage_mtime', 'integer', [
185
+                'notnull' => true,
186
+                'length' => 4,
187
+                'default' => 0,
188
+            ]);
189
+            $table->addColumn('encrypted', 'integer', [
190
+                'notnull' => true,
191
+                'length' => 4,
192
+                'default' => 0,
193
+            ]);
194
+            $table->addColumn('unencrypted_size', 'bigint', [
195
+                'notnull' => true,
196
+                'length' => 8,
197
+                'default' => 0,
198
+            ]);
199
+            $table->addColumn('etag', 'string', [
200
+                'notnull' => false,
201
+                'length' => 40,
202
+            ]);
203
+            $table->addColumn('permissions', 'integer', [
204
+                'notnull' => false,
205
+                'length' => 4,
206
+                'default' => 0,
207
+            ]);
208
+            $table->addColumn('checksum', 'string', [
209
+                'notnull' => false,
210
+                'length' => 255,
211
+            ]);
212
+            $table->setPrimaryKey(['fileid']);
213
+            $table->addUniqueIndex(['storage', 'path_hash'], 'fs_storage_path_hash');
214
+            $table->addIndex(['parent', 'name'], 'fs_parent_name_hash');
215
+            $table->addIndex(['storage', 'mimetype'], 'fs_storage_mimetype');
216
+            $table->addIndex(['storage', 'mimepart'], 'fs_storage_mimepart');
217
+            $table->addIndex(['storage', 'size', 'fileid'], 'fs_storage_size');
218
+        }
219
+
220
+        if (!$schema->hasTable('group_user')) {
221
+            $table = $schema->createTable('group_user');
222
+            $table->addColumn('gid', 'string', [
223
+                'notnull' => true,
224
+                'length' => 64,
225
+                'default' => '',
226
+            ]);
227
+            $table->addColumn('uid', 'string', [
228
+                'notnull' => true,
229
+                'length' => 64,
230
+                'default' => '',
231
+            ]);
232
+            $table->setPrimaryKey(['gid', 'uid']);
233
+            $table->addIndex(['uid'], 'gu_uid_index');
234
+        }
235
+
236
+        if (!$schema->hasTable('group_admin')) {
237
+            $table = $schema->createTable('group_admin');
238
+            $table->addColumn('gid', 'string', [
239
+                'notnull' => true,
240
+                'length' => 64,
241
+                'default' => '',
242
+            ]);
243
+            $table->addColumn('uid', 'string', [
244
+                'notnull' => true,
245
+                'length' => 64,
246
+                'default' => '',
247
+            ]);
248
+            $table->setPrimaryKey(['gid', 'uid']);
249
+            $table->addIndex(['uid'], 'group_admin_uid');
250
+        }
251
+
252
+        if (!$schema->hasTable('groups')) {
253
+            $table = $schema->createTable('groups');
254
+            $table->addColumn('gid', 'string', [
255
+                'notnull' => true,
256
+                'length' => 64,
257
+                'default' => '',
258
+            ]);
259
+            $table->setPrimaryKey(['gid']);
260
+        }
261
+
262
+        if (!$schema->hasTable('preferences')) {
263
+            $table = $schema->createTable('preferences');
264
+            $table->addColumn('userid', 'string', [
265
+                'notnull' => true,
266
+                'length' => 64,
267
+                'default' => '',
268
+            ]);
269
+            $table->addColumn('appid', 'string', [
270
+                'notnull' => true,
271
+                'length' => 32,
272
+                'default' => '',
273
+            ]);
274
+            $table->addColumn('configkey', 'string', [
275
+                'notnull' => true,
276
+                'length' => 64,
277
+                'default' => '',
278
+            ]);
279
+            $table->addColumn('configvalue', 'text', [
280
+                'notnull' => false,
281
+            ]);
282
+            $table->setPrimaryKey(['userid', 'appid', 'configkey']);
283
+        }
284
+
285
+        if (!$schema->hasTable('properties')) {
286
+            $table = $schema->createTable('properties');
287
+            $table->addColumn('id', 'integer', [
288
+                'autoincrement' => true,
289
+                'notnull' => true,
290
+                'length' => 4,
291
+            ]);
292
+            $table->addColumn('userid', 'string', [
293
+                'notnull' => true,
294
+                'length' => 64,
295
+                'default' => '',
296
+            ]);
297
+            $table->addColumn('propertypath', 'string', [
298
+                'notnull' => true,
299
+                'length' => 255,
300
+                'default' => '',
301
+            ]);
302
+            $table->addColumn('propertyname', 'string', [
303
+                'notnull' => true,
304
+                'length' => 255,
305
+                'default' => '',
306
+            ]);
307
+            $table->addColumn('propertyvalue', 'text', [
308
+                'notnull' => true,
309
+            ]);
310
+            $table->setPrimaryKey(['id']);
311
+            $table->addIndex(['userid'], 'property_index');
312
+        }
313
+
314
+        if (!$schema->hasTable('share')) {
315
+            $table = $schema->createTable('share');
316
+            $table->addColumn('id', 'integer', [
317
+                'autoincrement' => true,
318
+                'notnull' => true,
319
+                'length' => 4,
320
+            ]);
321
+            $table->addColumn('share_type', 'smallint', [
322
+                'notnull' => true,
323
+                'length' => 1,
324
+                'default' => 0,
325
+            ]);
326
+            $table->addColumn('share_with', 'string', [
327
+                'notnull' => false,
328
+                'length' => 255,
329
+            ]);
330
+            $table->addColumn('password', 'string', [
331
+                'notnull' => false,
332
+                'length' => 255,
333
+            ]);
334
+            $table->addColumn('uid_owner', 'string', [
335
+                'notnull' => true,
336
+                'length' => 64,
337
+                'default' => '',
338
+            ]);
339
+            $table->addColumn('uid_initiator', 'string', [
340
+                'notnull' => false,
341
+                'length' => 64,
342
+            ]);
343
+            $table->addColumn('parent', 'integer', [
344
+                'notnull' => false,
345
+                'length' => 4,
346
+            ]);
347
+            $table->addColumn('item_type', 'string', [
348
+                'notnull' => true,
349
+                'length' => 64,
350
+                'default' => '',
351
+            ]);
352
+            $table->addColumn('item_source', 'string', [
353
+                'notnull' => false,
354
+                'length' => 255,
355
+            ]);
356
+            $table->addColumn('item_target', 'string', [
357
+                'notnull' => false,
358
+                'length' => 255,
359
+            ]);
360
+            $table->addColumn('file_source', 'integer', [
361
+                'notnull' => false,
362
+                'length' => 4,
363
+            ]);
364
+            $table->addColumn('file_target', 'string', [
365
+                'notnull' => false,
366
+                'length' => 512,
367
+            ]);
368
+            $table->addColumn('permissions', 'smallint', [
369
+                'notnull' => true,
370
+                'length' => 1,
371
+                'default' => 0,
372
+            ]);
373
+            $table->addColumn('stime', 'bigint', [
374
+                'notnull' => true,
375
+                'length' => 8,
376
+                'default' => 0,
377
+            ]);
378
+            $table->addColumn('accepted', 'smallint', [
379
+                'notnull' => true,
380
+                'length' => 1,
381
+                'default' => 0,
382
+            ]);
383
+            $table->addColumn('expiration', 'datetime', [
384
+                'notnull' => false,
385
+            ]);
386
+            $table->addColumn('token', 'string', [
387
+                'notnull' => false,
388
+                'length' => 32,
389
+            ]);
390
+            $table->addColumn('mail_send', 'smallint', [
391
+                'notnull' => true,
392
+                'length' => 1,
393
+                'default' => 0,
394
+            ]);
395
+            $table->addColumn('share_name', 'string', [
396
+                'notnull' => false,
397
+                'length' => 64,
398
+            ]);
399
+            $table->setPrimaryKey(['id']);
400
+            $table->addIndex(['item_type', 'share_type'], 'item_share_type_index');
401
+            $table->addIndex(['file_source'], 'file_source_index');
402
+            $table->addIndex(['token'], 'token_index');
403
+            $table->addIndex(['share_with'], 'share_with_index');
404
+        }
405
+
406
+        if (!$schema->hasTable('jobs')) {
407
+            $table = $schema->createTable('jobs');
408
+            $table->addColumn('id', 'integer', [
409
+                'autoincrement' => true,
410
+                'notnull' => true,
411
+                'length' => 4,
412
+                'unsigned' => true,
413
+            ]);
414
+            $table->addColumn('class', 'string', [
415
+                'notnull' => true,
416
+                'length' => 255,
417
+                'default' => '',
418
+            ]);
419
+            $table->addColumn('argument', 'string', [
420
+                'notnull' => true,
421
+                'length' => 4000,
422
+                'default' => '',
423
+            ]);
424
+            $table->addColumn('last_run', 'integer', [
425
+                'notnull' => false,
426
+                'default' => 0,
427
+            ]);
428
+            $table->addColumn('last_checked', 'integer', [
429
+                'notnull' => false,
430
+                'default' => 0,
431
+            ]);
432
+            $table->addColumn('reserved_at', 'integer', [
433
+                'notnull' => false,
434
+                'default' => 0,
435
+            ]);
436
+            $table->addColumn('execution_duration', 'integer', [
437
+                'notnull' => true,
438
+                'default' => 0,
439
+            ]);
440
+            $table->setPrimaryKey(['id']);
441
+            $table->addIndex(['class'], 'job_class_index');
442
+        }
443
+
444
+        if (!$schema->hasTable('users')) {
445
+            $table = $schema->createTable('users');
446
+            $table->addColumn('uid', 'string', [
447
+                'notnull' => true,
448
+                'length' => 64,
449
+                'default' => '',
450
+            ]);
451
+            $table->addColumn('displayname', 'string', [
452
+                'notnull' => false,
453
+                'length' => 64,
454
+            ]);
455
+            $table->addColumn('password', 'string', [
456
+                'notnull' => true,
457
+                'length' => 255,
458
+                'default' => '',
459
+            ]);
460
+            $table->setPrimaryKey(['uid']);
461
+        }
462
+
463
+        if (!$schema->hasTable('authtoken')) {
464
+            $table = $schema->createTable('authtoken');
465
+            $table->addColumn('id', 'integer', [
466
+                'autoincrement' => true,
467
+                'notnull' => true,
468
+                'length' => 4,
469
+                'unsigned' => true,
470
+            ]);
471
+            $table->addColumn('uid', 'string', [
472
+                'notnull' => true,
473
+                'length' => 64,
474
+                'default' => '',
475
+            ]);
476
+            $table->addColumn('login_name', 'string', [
477
+                'notnull' => true,
478
+                'length' => 64,
479
+                'default' => '',
480
+            ]);
481
+            $table->addColumn('password', 'text', [
482
+                'notnull' => false,
483
+            ]);
484
+            $table->addColumn('name', 'text', [
485
+                'notnull' => true,
486
+                'default' => '',
487
+            ]);
488
+            $table->addColumn('token', 'string', [
489
+                'notnull' => true,
490
+                'length' => 200,
491
+                'default' => '',
492
+            ]);
493
+            $table->addColumn('type', 'smallint', [
494
+                'notnull' => true,
495
+                'length' => 2,
496
+                'default' => 0,
497
+                'unsigned' => true,
498
+            ]);
499
+            $table->addColumn('remember', 'smallint', [
500
+                'notnull' => true,
501
+                'length' => 1,
502
+                'default' => 0,
503
+                'unsigned' => true,
504
+            ]);
505
+            $table->addColumn('last_activity', 'integer', [
506
+                'notnull' => true,
507
+                'length' => 4,
508
+                'default' => 0,
509
+                'unsigned' => true,
510
+            ]);
511
+            $table->addColumn('last_check', 'integer', [
512
+                'notnull' => true,
513
+                'length' => 4,
514
+                'default' => 0,
515
+                'unsigned' => true,
516
+            ]);
517
+            $table->addColumn('scope', 'text', [
518
+                'notnull' => false,
519
+            ]);
520
+            $table->setPrimaryKey(['id']);
521
+            $table->addUniqueIndex(['token'], 'authtoken_token_index');
522
+            $table->addIndex(['last_activity'], 'authtoken_last_activity_index');
523
+        }
524
+
525
+        if (!$schema->hasTable('bruteforce_attempts')) {
526
+            $table = $schema->createTable('bruteforce_attempts');
527
+            $table->addColumn('id', 'integer', [
528
+                'autoincrement' => true,
529
+                'notnull' => true,
530
+                'length' => 4,
531
+                'unsigned' => true,
532
+            ]);
533
+            $table->addColumn('action', 'string', [
534
+                'notnull' => true,
535
+                'length' => 64,
536
+                'default' => '',
537
+            ]);
538
+            $table->addColumn('occurred', 'integer', [
539
+                'notnull' => true,
540
+                'length' => 4,
541
+                'default' => 0,
542
+                'unsigned' => true,
543
+            ]);
544
+            $table->addColumn('ip', 'string', [
545
+                'notnull' => true,
546
+                'length' => 255,
547
+                'default' => '',
548
+            ]);
549
+            $table->addColumn('subnet', 'string', [
550
+                'notnull' => true,
551
+                'length' => 255,
552
+                'default' => '',
553
+            ]);
554
+            $table->addColumn('metadata', 'string', [
555
+                'notnull' => true,
556
+                'length' => 255,
557
+                'default' => '',
558
+            ]);
559
+            $table->setPrimaryKey(['id']);
560
+            $table->addIndex(['ip'], 'bruteforce_attempts_ip');
561
+            $table->addIndex(['subnet'], 'bruteforce_attempts_subnet');
562
+        }
563
+
564
+        if (!$schema->hasTable('vcategory')) {
565
+            $table = $schema->createTable('vcategory');
566
+            $table->addColumn('id', 'integer', [
567
+                'autoincrement' => true,
568
+                'notnull' => true,
569
+                'length' => 4,
570
+                'unsigned' => true,
571
+            ]);
572
+            $table->addColumn('uid', 'string', [
573
+                'notnull' => true,
574
+                'length' => 64,
575
+                'default' => '',
576
+            ]);
577
+            $table->addColumn('type', 'string', [
578
+                'notnull' => true,
579
+                'length' => 64,
580
+                'default' => '',
581
+            ]);
582
+            $table->addColumn('category', 'string', [
583
+                'notnull' => true,
584
+                'length' => 255,
585
+                'default' => '',
586
+            ]);
587
+            $table->setPrimaryKey(['id']);
588
+            $table->addIndex(['uid'], 'uid_index');
589
+            $table->addIndex(['type'], 'type_index');
590
+            $table->addIndex(['category'], 'category_index');
591
+        }
592
+
593
+        if (!$schema->hasTable('vcategory_to_object')) {
594
+            $table = $schema->createTable('vcategory_to_object');
595
+            $table->addColumn('objid', 'integer', [
596
+                'notnull' => true,
597
+                'length' => 4,
598
+                'default' => 0,
599
+                'unsigned' => true,
600
+            ]);
601
+            $table->addColumn('categoryid', 'integer', [
602
+                'notnull' => true,
603
+                'length' => 4,
604
+                'default' => 0,
605
+                'unsigned' => true,
606
+            ]);
607
+            $table->addColumn('type', 'string', [
608
+                'notnull' => true,
609
+                'length' => 64,
610
+                'default' => '',
611
+            ]);
612
+            $table->setPrimaryKey(['categoryid', 'objid', 'type']);
613
+            $table->addIndex(['objid', 'type'], 'vcategory_objectd_index');
614
+        }
615
+
616
+        if (!$schema->hasTable('systemtag')) {
617
+            $table = $schema->createTable('systemtag');
618
+            $table->addColumn('id', 'integer', [
619
+                'autoincrement' => true,
620
+                'notnull' => true,
621
+                'length' => 4,
622
+                'unsigned' => true,
623
+            ]);
624
+            $table->addColumn('name', 'string', [
625
+                'notnull' => true,
626
+                'length' => 64,
627
+                'default' => '',
628
+            ]);
629
+            $table->addColumn('visibility', 'smallint', [
630
+                'notnull' => true,
631
+                'length' => 1,
632
+                'default' => 1,
633
+            ]);
634
+            $table->addColumn('editable', 'smallint', [
635
+                'notnull' => true,
636
+                'length' => 1,
637
+                'default' => 1,
638
+            ]);
639
+            $table->setPrimaryKey(['id']);
640
+            $table->addUniqueIndex(['name', 'visibility', 'editable'], 'tag_ident');
641
+        }
642
+
643
+        if (!$schema->hasTable('systemtag_object_mapping')) {
644
+            $table = $schema->createTable('systemtag_object_mapping');
645
+            $table->addColumn('objectid', 'string', [
646
+                'notnull' => true,
647
+                'length' => 64,
648
+                'default' => '',
649
+            ]);
650
+            $table->addColumn('objecttype', 'string', [
651
+                'notnull' => true,
652
+                'length' => 64,
653
+                'default' => '',
654
+            ]);
655
+            $table->addColumn('systemtagid', 'integer', [
656
+                'notnull' => true,
657
+                'length' => 4,
658
+                'default' => 0,
659
+                'unsigned' => true,
660
+            ]);
661
+            $table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping');
662
+        }
663
+
664
+        if (!$schema->hasTable('systemtag_group')) {
665
+            $table = $schema->createTable('systemtag_group');
666
+            $table->addColumn('systemtagid', 'integer', [
667
+                'notnull' => true,
668
+                'length' => 4,
669
+                'default' => 0,
670
+                'unsigned' => true,
671
+            ]);
672
+            $table->addColumn('gid', 'string', [
673
+                'notnull' => true,
674
+            ]);
675
+            $table->setPrimaryKey(['gid', 'systemtagid']);
676
+        }
677
+
678
+        if (!$schema->hasTable('file_locks')) {
679
+            $table = $schema->createTable('file_locks');
680
+            $table->addColumn('id', 'integer', [
681
+                'autoincrement' => true,
682
+                'notnull' => true,
683
+                'length' => 4,
684
+                'unsigned' => true,
685
+            ]);
686
+            $table->addColumn('lock', 'integer', [
687
+                'notnull' => true,
688
+                'length' => 4,
689
+                'default' => 0,
690
+            ]);
691
+            $table->addColumn('key', 'string', [
692
+                'notnull' => true,
693
+                'length' => 64,
694
+            ]);
695
+            $table->addColumn('ttl', 'integer', [
696
+                'notnull' => true,
697
+                'length' => 4,
698
+                'default' => -1,
699
+            ]);
700
+            $table->setPrimaryKey(['id']);
701
+            $table->addUniqueIndex(['key'], 'lock_key_index');
702
+            $table->addIndex(['ttl'], 'lock_ttl_index');
703
+        }
704
+
705
+        if (!$schema->hasTable('comments')) {
706
+            $table = $schema->createTable('comments');
707
+            $table->addColumn('id', 'integer', [
708
+                'autoincrement' => true,
709
+                'notnull' => true,
710
+                'length' => 4,
711
+                'unsigned' => true,
712
+            ]);
713
+            $table->addColumn('parent_id', 'integer', [
714
+                'notnull' => true,
715
+                'length' => 4,
716
+                'default' => 0,
717
+                'unsigned' => true,
718
+            ]);
719
+            $table->addColumn('topmost_parent_id', 'integer', [
720
+                'notnull' => true,
721
+                'length' => 4,
722
+                'default' => 0,
723
+                'unsigned' => true,
724
+            ]);
725
+            $table->addColumn('children_count', 'integer', [
726
+                'notnull' => true,
727
+                'length' => 4,
728
+                'default' => 0,
729
+                'unsigned' => true,
730
+            ]);
731
+            $table->addColumn('actor_type', 'string', [
732
+                'notnull' => true,
733
+                'length' => 64,
734
+                'default' => '',
735
+            ]);
736
+            $table->addColumn('actor_id', 'string', [
737
+                'notnull' => true,
738
+                'length' => 64,
739
+                'default' => '',
740
+            ]);
741
+            $table->addColumn('message', 'text', [
742
+                'notnull' => false,
743
+            ]);
744
+            $table->addColumn('verb', 'string', [
745
+                'notnull' => false,
746
+                'length' => 64,
747
+            ]);
748
+            $table->addColumn('creation_timestamp', 'datetime', [
749
+                'notnull' => false,
750
+            ]);
751
+            $table->addColumn('latest_child_timestamp', 'datetime', [
752
+                'notnull' => false,
753
+            ]);
754
+            $table->addColumn('object_type', 'string', [
755
+                'notnull' => true,
756
+                'length' => 64,
757
+                'default' => '',
758
+            ]);
759
+            $table->addColumn('object_id', 'string', [
760
+                'notnull' => true,
761
+                'length' => 64,
762
+                'default' => '',
763
+            ]);
764
+            $table->setPrimaryKey(['id']);
765
+            $table->addIndex(['parent_id'], 'comments_parent_id_index');
766
+            $table->addIndex(['topmost_parent_id'], 'comments_topmost_parent_id_idx');
767
+            $table->addIndex(['object_type', 'object_id', 'creation_timestamp'], 'comments_object_index');
768
+            $table->addIndex(['actor_type', 'actor_id'], 'comments_actor_index');
769
+        }
770
+
771
+        if (!$schema->hasTable('comments_read_markers')) {
772
+            $table = $schema->createTable('comments_read_markers');
773
+            $table->addColumn('user_id', 'string', [
774
+                'notnull' => true,
775
+                'length' => 64,
776
+                'default' => '',
777
+            ]);
778
+            $table->addColumn('marker_datetime', 'datetime', [
779
+                'notnull' => false,
780
+            ]);
781
+            $table->addColumn('object_type', 'string', [
782
+                'notnull' => true,
783
+                'length' => 64,
784
+                'default' => '',
785
+            ]);
786
+            $table->addColumn('object_id', 'string', [
787
+                'notnull' => true,
788
+                'length' => 64,
789
+                'default' => '',
790
+            ]);
791
+            $table->addIndex(['object_type', 'object_id'], 'comments_marker_object_index');
792
+            $table->addUniqueIndex(['user_id', 'object_type', 'object_id'], 'comments_marker_index');
793
+        }
794
+
795
+        if (!$schema->hasTable('credentials')) {
796
+            $table = $schema->createTable('credentials');
797
+            $table->addColumn('user', 'string', [
798
+                'notnull' => true,
799
+                'length' => 64,
800
+            ]);
801
+            $table->addColumn('identifier', 'string', [
802
+                'notnull' => true,
803
+                'length' => 64,
804
+            ]);
805
+            $table->addColumn('credentials', 'text', [
806
+                'notnull' => false,
807
+            ]);
808
+            $table->setPrimaryKey(['user', 'identifier']);
809
+            $table->addIndex(['user'], 'credentials_user');
810
+        }
811
+
812
+        if (!$schema->hasTable('admin_sections')) {
813
+            $table = $schema->createTable('admin_sections');
814
+            $table->addColumn('id', 'string', [
815
+                'notnull' => true,
816
+                'length' => 64,
817
+            ]);
818
+            $table->addColumn('class', 'string', [
819
+                'notnull' => true,
820
+                'length' => 255,
821
+                'default' => '',
822
+            ]);
823
+            $table->addColumn('priority', 'smallint', [
824
+                'notnull' => true,
825
+                'length' => 1,
826
+                'default' => 0,
827
+            ]);
828
+            $table->setPrimaryKey(['id']);
829
+            $table->addUniqueIndex(['class'], 'admin_sections_class');
830
+        }
831
+
832
+        if (!$schema->hasTable('admin_settings')) {
833
+            $table = $schema->createTable('admin_settings');
834
+            $table->addColumn('id', 'integer', [
835
+                'autoincrement' => true,
836
+                'notnull' => true,
837
+                'length' => 4,
838
+            ]);
839
+            $table->addColumn('class', 'string', [
840
+                'notnull' => true,
841
+                'length' => 255,
842
+                'default' => '',
843
+            ]);
844
+            $table->addColumn('section', 'string', [
845
+                'notnull' => false,
846
+                'length' => 64,
847
+            ]);
848
+            $table->addColumn('priority', 'smallint', [
849
+                'notnull' => true,
850
+                'length' => 1,
851
+                'default' => 0,
852
+            ]);
853
+            $table->setPrimaryKey(['id']);
854
+            $table->addUniqueIndex(['class'], 'admin_settings_class');
855
+            $table->addIndex(['section'], 'admin_settings_section');
856
+        }
857
+
858
+        if (!$schema->hasTable('personal_sections')) {
859
+            $table = $schema->createTable('personal_sections');
860
+            $table->addColumn('id', 'string', [
861
+                'notnull' => true,
862
+                'length' => 64,
863
+            ]);
864
+            $table->addColumn('class', 'string', [
865
+                'notnull' => true,
866
+                'length' => 255,
867
+                'default' => '',
868
+            ]);
869
+            $table->addColumn('priority', 'smallint', [
870
+                'notnull' => true,
871
+                'length' => 1,
872
+                'default' => 0,
873
+            ]);
874
+            $table->setPrimaryKey(['id']);
875
+            $table->addUniqueIndex(['class'], 'personal_sections_class');
876
+        }
877
+
878
+        if (!$schema->hasTable('personal_settings')) {
879
+            $table = $schema->createTable('personal_settings');
880
+            $table->addColumn('id', 'integer', [
881
+                'autoincrement' => true,
882
+                'notnull' => true,
883
+                'length' => 4,
884
+            ]);
885
+            $table->addColumn('class', 'string', [
886
+                'notnull' => true,
887
+                'length' => 255,
888
+                'default' => '',
889
+            ]);
890
+            $table->addColumn('section', 'string', [
891
+                'notnull' => false,
892
+                'length' => 64,
893
+            ]);
894
+            $table->addColumn('priority', 'smallint', [
895
+                'notnull' => true,
896
+                'length' => 1,
897
+                'default' => 0,
898
+            ]);
899
+            $table->setPrimaryKey(['id']);
900
+            $table->addUniqueIndex(['class'], 'personal_settings_class');
901
+            $table->addIndex(['section'], 'personal_settings_section');
902
+        }
903
+
904
+        if (!$schema->hasTable('accounts')) {
905
+            $table = $schema->createTable('accounts');
906
+            $table->addColumn('uid', 'string', [
907
+                'notnull' => true,
908
+                'length' => 64,
909
+                'default' => '',
910
+            ]);
911
+            $table->addColumn('data', 'text', [
912
+                'notnull' => true,
913
+                'default' => '',
914
+            ]);
915
+            $table->setPrimaryKey(['uid']);
916
+        }
917
+        return $schema;
918
+    }
919 919
 
920 920
 }
Please login to merge, or discard this patch.
core/register_command.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -44,123 +44,123 @@
 block discarded – undo
44 44
 $application->add(new OC\Core\Command\App\CheckCode($infoParser));
45 45
 $application->add(new OC\Core\Command\L10n\CreateJs());
46 46
 $application->add(new \OC\Core\Command\Integrity\SignApp(
47
-		\OC::$server->getIntegrityCodeChecker(),
48
-		new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
49
-		\OC::$server->getURLGenerator()
47
+        \OC::$server->getIntegrityCodeChecker(),
48
+        new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
49
+        \OC::$server->getURLGenerator()
50 50
 ));
51 51
 $application->add(new \OC\Core\Command\Integrity\SignCore(
52
-		\OC::$server->getIntegrityCodeChecker(),
53
-		new \OC\IntegrityCheck\Helpers\FileAccessHelper()
52
+        \OC::$server->getIntegrityCodeChecker(),
53
+        new \OC\IntegrityCheck\Helpers\FileAccessHelper()
54 54
 ));
55 55
 $application->add(new \OC\Core\Command\Integrity\CheckApp(
56
-		\OC::$server->getIntegrityCodeChecker()
56
+        \OC::$server->getIntegrityCodeChecker()
57 57
 ));
58 58
 $application->add(new \OC\Core\Command\Integrity\CheckCore(
59
-		\OC::$server->getIntegrityCodeChecker()
59
+        \OC::$server->getIntegrityCodeChecker()
60 60
 ));
61 61
 
62 62
 
63 63
 if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
64
-	$application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
65
-	$application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager()));
66
-	$application->add(new OC\Core\Command\App\Install());
67
-	$application->add(new OC\Core\Command\App\GetPath());
68
-	$application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
64
+    $application->add(new OC\Core\Command\App\Disable(\OC::$server->getAppManager()));
65
+    $application->add(new OC\Core\Command\App\Enable(\OC::$server->getAppManager()));
66
+    $application->add(new OC\Core\Command\App\Install());
67
+    $application->add(new OC\Core\Command\App\GetPath());
68
+    $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
69 69
 
70
-	$application->add(new OC\Core\Command\TwoFactorAuth\Enable(
71
-		\OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
72
-	));
73
-	$application->add(new OC\Core\Command\TwoFactorAuth\Disable(
74
-		\OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
75
-	));
70
+    $application->add(new OC\Core\Command\TwoFactorAuth\Enable(
71
+        \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
72
+    ));
73
+    $application->add(new OC\Core\Command\TwoFactorAuth\Disable(
74
+        \OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()
75
+    ));
76 76
 
77
-	$application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
78
-	$application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
79
-	$application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
77
+    $application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
78
+    $application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));
79
+    $application->add(new OC\Core\Command\Background\Ajax(\OC::$server->getConfig()));
80 80
 
81
-	$application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
82
-	$application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
83
-	$application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
84
-	$application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
85
-	$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
86
-	$application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
87
-	$application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
88
-	$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
81
+    $application->add(new OC\Core\Command\Config\App\DeleteConfig(\OC::$server->getConfig()));
82
+    $application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
83
+    $application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
84
+    $application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
85
+    $application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
86
+    $application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
87
+    $application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
88
+    $application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
89 89
 
90
-	$application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
91
-	$application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
92
-	$application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->getDatabaseConnection()));
93
-	$application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->getDatabaseConnection()));
94
-	$application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->getDatabaseConnection()));
95
-	$application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->getDatabaseConnection()));
96
-	$application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->getDatabaseConnection()));
97
-	$application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->getDatabaseConnection()));
98
-	$application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()));
90
+    $application->add(new OC\Core\Command\Db\ConvertType(\OC::$server->getConfig(), new \OC\DB\ConnectionFactory(\OC::$server->getSystemConfig())));
91
+    $application->add(new OC\Core\Command\Db\ConvertMysqlToMB4(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection(), \OC::$server->getURLGenerator(), \OC::$server->getLogger()));
92
+    $application->add(new OC\Core\Command\Db\ConvertFilecacheBigInt(\OC::$server->getDatabaseConnection()));
93
+    $application->add(new OC\Core\Command\Db\AddMissingIndices(\OC::$server->getDatabaseConnection()));
94
+    $application->add(new OC\Core\Command\Db\Migrations\StatusCommand(\OC::$server->getDatabaseConnection()));
95
+    $application->add(new OC\Core\Command\Db\Migrations\MigrateCommand(\OC::$server->getDatabaseConnection()));
96
+    $application->add(new OC\Core\Command\Db\Migrations\GenerateCommand(\OC::$server->getDatabaseConnection()));
97
+    $application->add(new OC\Core\Command\Db\Migrations\GenerateFromSchemaFileCommand(\OC::$server->getConfig(), \OC::$server->getAppManager(), \OC::$server->getDatabaseConnection()));
98
+    $application->add(new OC\Core\Command\Db\Migrations\ExecuteCommand(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()));
99 99
 
100
-	$application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
101
-	$application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
102
-	$application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
103
-	$application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
104
-	$application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
105
-	$application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
106
-	$application->add(new OC\Core\Command\Encryption\DecryptAll(
107
-		\OC::$server->getEncryptionManager(),
108
-		\OC::$server->getAppManager(),
109
-		\OC::$server->getConfig(),
110
-		new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
111
-		new \Symfony\Component\Console\Helper\QuestionHelper())
112
-	);
100
+    $application->add(new OC\Core\Command\Encryption\Disable(\OC::$server->getConfig()));
101
+    $application->add(new OC\Core\Command\Encryption\Enable(\OC::$server->getConfig(), \OC::$server->getEncryptionManager()));
102
+    $application->add(new OC\Core\Command\Encryption\ListModules(\OC::$server->getEncryptionManager()));
103
+    $application->add(new OC\Core\Command\Encryption\SetDefaultModule(\OC::$server->getEncryptionManager()));
104
+    $application->add(new OC\Core\Command\Encryption\Status(\OC::$server->getEncryptionManager()));
105
+    $application->add(new OC\Core\Command\Encryption\EncryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getAppManager(), \OC::$server->getConfig(), new \Symfony\Component\Console\Helper\QuestionHelper()));
106
+    $application->add(new OC\Core\Command\Encryption\DecryptAll(
107
+        \OC::$server->getEncryptionManager(),
108
+        \OC::$server->getAppManager(),
109
+        \OC::$server->getConfig(),
110
+        new \OC\Encryption\DecryptAll(\OC::$server->getEncryptionManager(), \OC::$server->getUserManager(), new \OC\Files\View()),
111
+        new \Symfony\Component\Console\Helper\QuestionHelper())
112
+    );
113 113
 
114
-	$application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
115
-	$application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
114
+    $application->add(new OC\Core\Command\Log\Manage(\OC::$server->getConfig()));
115
+    $application->add(new OC\Core\Command\Log\File(\OC::$server->getConfig()));
116 116
 
117
-	$view = new \OC\Files\View();
118
-	$util = new \OC\Encryption\Util(
119
-		$view,
120
-		\OC::$server->getUserManager(),
121
-		\OC::$server->getGroupManager(),
122
-		\OC::$server->getConfig()
123
-	);
124
-	$application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
125
-			$view,
126
-			\OC::$server->getUserManager(),
127
-			\OC::$server->getConfig(),
128
-			$util,
129
-			new \Symfony\Component\Console\Helper\QuestionHelper()
130
-		)
131
-	);
132
-	$application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
117
+    $view = new \OC\Files\View();
118
+    $util = new \OC\Encryption\Util(
119
+        $view,
120
+        \OC::$server->getUserManager(),
121
+        \OC::$server->getGroupManager(),
122
+        \OC::$server->getConfig()
123
+    );
124
+    $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
125
+            $view,
126
+            \OC::$server->getUserManager(),
127
+            \OC::$server->getConfig(),
128
+            $util,
129
+            new \Symfony\Component\Console\Helper\QuestionHelper()
130
+        )
131
+    );
132
+    $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
133 133
 
134
-	$application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
135
-	$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
136
-	$application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
137
-	$application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
138
-	$application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
139
-	$application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
134
+    $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
135
+    $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateDB(\OC::$server->getMimeTypeDetector(), \OC::$server->getMimeTypeLoader()));
136
+    $application->add(new OC\Core\Command\Maintenance\Mimetype\UpdateJS(\OC::$server->getMimeTypeDetector()));
137
+    $application->add(new OC\Core\Command\Maintenance\Mode(\OC::$server->getConfig()));
138
+    $application->add(new OC\Core\Command\Maintenance\UpdateHtaccess());
139
+    $application->add(new OC\Core\Command\Maintenance\UpdateTheme(\OC::$server->getMimeTypeDetector(), \OC::$server->getMemCacheFactory()));
140 140
 
141
-	$application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
142
-	$application->add(new OC\Core\Command\Maintenance\Repair(
143
-		new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(),
144
-		\OC::$server->getEventDispatcher(), \OC::$server->getAppManager()));
141
+    $application->add(new OC\Core\Command\Upgrade(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->query(\OC\Installer::class)));
142
+    $application->add(new OC\Core\Command\Maintenance\Repair(
143
+        new \OC\Repair(\OC\Repair::getRepairSteps(), \OC::$server->getEventDispatcher()), \OC::$server->getConfig(),
144
+        \OC::$server->getEventDispatcher(), \OC::$server->getAppManager()));
145 145
 
146
-	$application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
147
-	$application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
148
-	$application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
149
-	$application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
150
-	$application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
151
-	$application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
152
-	$application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
153
-	$application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
154
-	$application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager()));
155
-	$application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
146
+    $application->add(new OC\Core\Command\User\Add(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
147
+    $application->add(new OC\Core\Command\User\Delete(\OC::$server->getUserManager()));
148
+    $application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
149
+    $application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
150
+    $application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
151
+    $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
152
+    $application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
153
+    $application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
154
+    $application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager()));
155
+    $application->add(new OC\Core\Command\User\Info(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
156 156
 
157
-	$application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
158
-	$application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
159
-	$application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
157
+    $application->add(new OC\Core\Command\Group\ListCommand(\OC::$server->getGroupManager()));
158
+    $application->add(new OC\Core\Command\Group\AddUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
159
+    $application->add(new OC\Core\Command\Group\RemoveUser(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));
160 160
 
161
-	$application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core')));
162
-	$application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null)));
163
-	$application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null)));
161
+    $application->add(new OC\Core\Command\Security\ListCertificates(\OC::$server->getCertificateManager(null), \OC::$server->getL10N('core')));
162
+    $application->add(new OC\Core\Command\Security\ImportCertificate(\OC::$server->getCertificateManager(null)));
163
+    $application->add(new OC\Core\Command\Security\RemoveCertificate(\OC::$server->getCertificateManager(null)));
164 164
 } else {
165
-	$application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getSystemConfig()));
165
+    $application->add(new OC\Core\Command\Maintenance\Install(\OC::$server->getSystemConfig()));
166 166
 }
Please login to merge, or discard this patch.
core/Command/Db/AddMissingIndices.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -30,54 +30,54 @@
 block discarded – undo
30 30
 
31 31
 class AddMissingIndices extends Command {
32 32
 
33
-	/** @var IDBConnection */
34
-	private $connection;
33
+    /** @var IDBConnection */
34
+    private $connection;
35 35
 
36
-	/**
37
-	 * @param IDBConnection $connection
38
-	 */
39
-	public function __construct(IDBConnection $connection) {
40
-		$this->connection = $connection;
41
-		parent::__construct();
42
-	}
36
+    /**
37
+     * @param IDBConnection $connection
38
+     */
39
+    public function __construct(IDBConnection $connection) {
40
+        $this->connection = $connection;
41
+        parent::__construct();
42
+    }
43 43
 
44
-	protected function configure() {
45
-		$this
46
-			->setName('db:add-missing-indices')
47
-			->setDescription('Add missing indices to the database tables');
48
-	}
44
+    protected function configure() {
45
+        $this
46
+            ->setName('db:add-missing-indices')
47
+            ->setDescription('Add missing indices to the database tables');
48
+    }
49 49
 
50
-	protected function execute(InputInterface $input, OutputInterface $output) {
51
-		$this->addShareTableIndicies($output);
50
+    protected function execute(InputInterface $input, OutputInterface $output) {
51
+        $this->addShareTableIndicies($output);
52 52
 
53
-	}
53
+    }
54 54
 
55
-	/**
56
-	 * add missing indices to the share table
57
-	 *
58
-	 * @param OutputInterface $output
59
-	 * @throws \Doctrine\DBAL\Schema\SchemaException
60
-	 */
61
-	private function addShareTableIndicies(OutputInterface $output) {
55
+    /**
56
+     * add missing indices to the share table
57
+     *
58
+     * @param OutputInterface $output
59
+     * @throws \Doctrine\DBAL\Schema\SchemaException
60
+     */
61
+    private function addShareTableIndicies(OutputInterface $output) {
62 62
 
63
-		$output->writeln('<info>Check indices of the share table.</info>');
63
+        $output->writeln('<info>Check indices of the share table.</info>');
64 64
 
65
-		$schema = new SchemaWrapper($this->connection);
66
-		$updated = false;
65
+        $schema = new SchemaWrapper($this->connection);
66
+        $updated = false;
67 67
 
68
-		if ($schema->hasTable("share")) {
69
-			$table = $schema->getTable("share");
70
-			if (!$table->hasIndex('share_with_index')) {
71
-				$output->writeln('<info>Adding additional index to the share table, this can take some time...</info>');
72
-				$table->addIndex(['share_with'], 'share_with_index');
73
-				$this->connection->migrateToSchema($schema->getWrappedSchema());
74
-				$updated = true;
75
-				$output->writeln('<info>Share table updated successfully.</info>');
76
-			}
77
-		}
68
+        if ($schema->hasTable("share")) {
69
+            $table = $schema->getTable("share");
70
+            if (!$table->hasIndex('share_with_index')) {
71
+                $output->writeln('<info>Adding additional index to the share table, this can take some time...</info>');
72
+                $table->addIndex(['share_with'], 'share_with_index');
73
+                $this->connection->migrateToSchema($schema->getWrappedSchema());
74
+                $updated = true;
75
+                $output->writeln('<info>Share table updated successfully.</info>');
76
+            }
77
+        }
78 78
 
79
-		if (!$updated) {
80
-			$output->writeln('<info>Done.</info>');
81
-		}
82
-	}
79
+        if (!$updated) {
80
+            $output->writeln('<info>Done.</info>');
81
+        }
82
+    }
83 83
 }
Please login to merge, or discard this patch.