Skip to content

Commit 27ff488

Browse files
committed
fix(dav): increase length of propertypath column
Match it to the value in oc_filecache table path column should be fine. Closes #9907 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
1 parent 855b8e3 commit 27ff488

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

apps/dav/composer/composer/autoload_classmap.php

+1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@
300300
'OCA\\DAV\\Migration\\Version1028Date20230630091518' => $baseDir . '/../lib/Migration/Version1028Date20230630091518.php',
301301
'OCA\\DAV\\Migration\\Version1028Date20230702074215' => $baseDir . '/../lib/Migration/Version1028Date20230702074215.php',
302302
'OCA\\DAV\\Migration\\Version1028Date20230702074341' => $baseDir . '/../lib/Migration/Version1028Date20230702074341.php',
303+
'OCA\\DAV\\Migration\\Version1028Date20230702074342' => $baseDir . '/../lib/Migration/Version1028Date20230702074342.php',
303304
'OCA\\DAV\\Profiler\\ProfilerPlugin' => $baseDir . '/../lib/Profiler/ProfilerPlugin.php',
304305
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningNode.php',
305306
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',

apps/dav/composer/composer/autoload_static.php

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ class ComposerStaticInitDAV
315315
'OCA\\DAV\\Migration\\Version1028Date20230630091518' => __DIR__ . '/..' . '/../lib/Migration/Version1028Date20230630091518.php',
316316
'OCA\\DAV\\Migration\\Version1028Date20230702074215' => __DIR__ . '/..' . '/../lib/Migration/Version1028Date20230702074215.php',
317317
'OCA\\DAV\\Migration\\Version1028Date20230702074341' => __DIR__ . '/..' . '/../lib/Migration/Version1028Date20230702074341.php',
318+
'OCA\\DAV\\Migration\\Version1028Date20230702074342' => __DIR__ . '/..' . '/../lib/Migration/Version1028Date20230702074342.php',
318319
'OCA\\DAV\\Profiler\\ProfilerPlugin' => __DIR__ . '/..' . '/../lib/Profiler/ProfilerPlugin.php',
319320
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningNode.php',
320321
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* @copyright Copyright (c) 2023 Your name <your@email.com>
7+
*
8+
* @author Your name <your@email.com>
9+
*
10+
* @license GNU AGPL version 3 or any later version
11+
*
12+
* This program is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU Affero General Public License as
14+
* published by the Free Software Foundation, either version 3 of the
15+
* License, or (at your option) any later version.
16+
*
17+
* This program is distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU Affero General Public License for more details.
21+
*
22+
* You should have received a copy of the GNU Affero General Public License
23+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
*
25+
*/
26+
27+
namespace OCA\DAV\Migration;
28+
29+
use Closure;
30+
use OCP\DB\ISchemaWrapper;
31+
use OCP\Migration\IOutput;
32+
use OCP\Migration\SimpleMigrationStep;
33+
34+
/**
35+
* Auto-generated migration step: Please modify to your needs!
36+
*/
37+
class Version1028Date20230702074342 extends SimpleMigrationStep {
38+
39+
/**
40+
* @param IOutput $output
41+
* @param Closure(): ISchemaWrapper $schemaClosure
42+
* @param array $options
43+
*/
44+
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
45+
}
46+
47+
/**
48+
* @param IOutput $output
49+
* @param Closure(): ISchemaWrapper $schemaClosure
50+
* @param array $options
51+
* @return null|ISchemaWrapper
52+
*/
53+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
54+
/** @var ISchemaWrapper $schema */
55+
$schema = $schemaClosure();
56+
$propertiesTable = $schema->getTable('properties');
57+
58+
// Indexes can't be added on columns with such length, so we drop them here before recreating them
59+
$propertiesTable->dropIndex('properties_path_index');
60+
$propertiesTable->dropIndex('properties_pathonly_index');
61+
62+
$propertyValueColumn = $propertiesTable->getColumn('propertypath');
63+
$propertyValueColumn->setLength(4000);
64+
65+
$propertiesTable->addIndex(['userid', 'propertypath'], 'properties_path_index_prefix', [], ['lengths' => [null, 64]]);
66+
$propertiesTable->addIndex(['propertypath'], 'properties_pathonly_index_prefix', [], ['lengths' => [null, 64]]);
67+
68+
return $schema;
69+
}
70+
71+
/**
72+
* @param IOutput $output
73+
* @param Closure(): ISchemaWrapper $schemaClosure
74+
* @param array $options
75+
*/
76+
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
77+
}
78+
}

0 commit comments

Comments
 (0)