@@ -32,56 +32,56 @@ |
||
32 | 32 | use OCP\Migration\SimpleMigrationStep; |
33 | 33 | |
34 | 34 | class Version21000Date20201120141228 extends SimpleMigrationStep { |
35 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
36 | - /** @var ISchemaWrapper $schema */ |
|
37 | - $schema = $schemaClosure(); |
|
35 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
36 | + /** @var ISchemaWrapper $schema */ |
|
37 | + $schema = $schemaClosure(); |
|
38 | 38 | |
39 | - if ($schema->hasTable('authtoken')) { |
|
40 | - $table = $schema->getTable('authtoken'); |
|
41 | - $loginNameColumn = $table->getColumn('login_name'); |
|
42 | - if ($loginNameColumn->getLength() !== 255) { |
|
43 | - $loginNameColumn->setLength(255); |
|
44 | - } |
|
45 | - $table->changeColumn('type', [ |
|
46 | - 'notnull' => false, |
|
47 | - ]); |
|
48 | - $table->changeColumn('remember', [ |
|
49 | - 'notnull' => false, |
|
50 | - ]); |
|
51 | - $table->changeColumn('last_activity', [ |
|
52 | - 'notnull' => false, |
|
53 | - ]); |
|
54 | - $table->changeColumn('last_check', [ |
|
55 | - 'notnull' => false, |
|
56 | - ]); |
|
57 | - } |
|
39 | + if ($schema->hasTable('authtoken')) { |
|
40 | + $table = $schema->getTable('authtoken'); |
|
41 | + $loginNameColumn = $table->getColumn('login_name'); |
|
42 | + if ($loginNameColumn->getLength() !== 255) { |
|
43 | + $loginNameColumn->setLength(255); |
|
44 | + } |
|
45 | + $table->changeColumn('type', [ |
|
46 | + 'notnull' => false, |
|
47 | + ]); |
|
48 | + $table->changeColumn('remember', [ |
|
49 | + 'notnull' => false, |
|
50 | + ]); |
|
51 | + $table->changeColumn('last_activity', [ |
|
52 | + 'notnull' => false, |
|
53 | + ]); |
|
54 | + $table->changeColumn('last_check', [ |
|
55 | + 'notnull' => false, |
|
56 | + ]); |
|
57 | + } |
|
58 | 58 | |
59 | - if ($schema->hasTable('dav_job_status')) { |
|
60 | - $schema->dropTable('dav_job_status'); |
|
61 | - } |
|
59 | + if ($schema->hasTable('dav_job_status')) { |
|
60 | + $schema->dropTable('dav_job_status'); |
|
61 | + } |
|
62 | 62 | |
63 | - if ($schema->hasTable('systemtag')) { |
|
64 | - $table = $schema->getTable('systemtag'); |
|
65 | - if ($table->hasColumn('assignable')) { |
|
66 | - $table->dropColumn('assignable'); |
|
67 | - } |
|
68 | - } |
|
63 | + if ($schema->hasTable('systemtag')) { |
|
64 | + $table = $schema->getTable('systemtag'); |
|
65 | + if ($table->hasColumn('assignable')) { |
|
66 | + $table->dropColumn('assignable'); |
|
67 | + } |
|
68 | + } |
|
69 | 69 | |
70 | - if ($schema->hasTable('share')) { |
|
71 | - $table = $schema->getTable('share'); |
|
72 | - if ($table->hasColumn('attributes')) { |
|
73 | - $table->dropColumn('attributes'); |
|
74 | - } |
|
75 | - } |
|
70 | + if ($schema->hasTable('share')) { |
|
71 | + $table = $schema->getTable('share'); |
|
72 | + if ($table->hasColumn('attributes')) { |
|
73 | + $table->dropColumn('attributes'); |
|
74 | + } |
|
75 | + } |
|
76 | 76 | |
77 | - if ($schema->hasTable('jobs')) { |
|
78 | - $table = $schema->getTable('jobs'); |
|
79 | - $table->changeColumn('execution_duration', [ |
|
80 | - 'notnull' => false, |
|
81 | - 'default' => 0, |
|
82 | - ]); |
|
83 | - } |
|
77 | + if ($schema->hasTable('jobs')) { |
|
78 | + $table = $schema->getTable('jobs'); |
|
79 | + $table->changeColumn('execution_duration', [ |
|
80 | + 'notnull' => false, |
|
81 | + 'default' => 0, |
|
82 | + ]); |
|
83 | + } |
|
84 | 84 | |
85 | - return $schema; |
|
86 | - } |
|
85 | + return $schema; |
|
86 | + } |
|
87 | 87 | } |