Skip to content

Commit 7b23b95

Browse files
committed
fix(dav): increase length of propertypath column
Match it to the value in oc_filecache table path column should be fine. There doesn't seem to be any special handling in the oc_filecache case for bigger values, so keeping it simple here Closes #9907 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
1 parent f012334 commit 7b23b95

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

apps/dav/composer/composer/autoload_classmap.php

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
'OCA\\DAV\\Migration\\Version1024Date20211221144219' => $baseDir . '/../lib/Migration/Version1024Date20211221144219.php',
298298
'OCA\\DAV\\Migration\\Version1027Date20230504122946' => $baseDir . '/../lib/Migration/Version1027Date20230504122946.php',
299299
'OCA\\DAV\\Migration\\Version1028Date20230630084412' => $baseDir . '/../lib/Migration/Version1028Date20230630084412.php',
300+
'OCA\\DAV\\Migration\\Version1028Date20230630091518' => $baseDir . '/../lib/Migration/Version1028Date20230630091518.php',
300301
'OCA\\DAV\\Profiler\\ProfilerPlugin' => $baseDir . '/../lib/Profiler/ProfilerPlugin.php',
301302
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningNode.php',
302303
'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
@@ -312,6 +312,7 @@ class ComposerStaticInitDAV
312312
'OCA\\DAV\\Migration\\Version1024Date20211221144219' => __DIR__ . '/..' . '/../lib/Migration/Version1024Date20211221144219.php',
313313
'OCA\\DAV\\Migration\\Version1027Date20230504122946' => __DIR__ . '/..' . '/../lib/Migration/Version1027Date20230504122946.php',
314314
'OCA\\DAV\\Migration\\Version1028Date20230630084412' => __DIR__ . '/..' . '/../lib/Migration/Version1028Date20230630084412.php',
315+
'OCA\\DAV\\Migration\\Version1028Date20230630091518' => __DIR__ . '/..' . '/../lib/Migration/Version1028Date20230630091518.php',
315316
'OCA\\DAV\\Profiler\\ProfilerPlugin' => __DIR__ . '/..' . '/../lib/Profiler/ProfilerPlugin.php',
316317
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningNode.php',
317318
'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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 Doctrine\DBAL\Types\Type;
31+
use OCP\DB\ISchemaWrapper;
32+
use OCP\DB\Types;
33+
use OCP\Migration\IOutput;
34+
use OCP\Migration\SimpleMigrationStep;
35+
36+
/**
37+
* Removing length limit on propertypath column
38+
*/
39+
class Version1028Date20230630091518 extends SimpleMigrationStep {
40+
41+
/**
42+
* @param IOutput $output
43+
* @param Closure(): ISchemaWrapper $schemaClosure
44+
* @param array $options
45+
*/
46+
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
47+
}
48+
49+
/**
50+
* @param IOutput $output
51+
* @param Closure(): ISchemaWrapper $schemaClosure
52+
* @param array $options
53+
* @return null|ISchemaWrapper
54+
*/
55+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
56+
/** @var ISchemaWrapper $schema */
57+
$schema = $schemaClosure();
58+
$propertiesTable = $schema->getTable('properties');
59+
$propertyValueColumn = $propertiesTable->getColumn('propertypath');
60+
$propertyValueColumn->setLength(4000);
61+
62+
return $schema;
63+
}
64+
65+
/**
66+
* @param IOutput $output
67+
* @param Closure(): ISchemaWrapper $schemaClosure
68+
* @param array $options
69+
*/
70+
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
71+
}
72+
}

0 commit comments

Comments
 (0)