Skip to content

Commit 3c5e438

Browse files
authored
Merge pull request #12275 from nextcloud/bugfix/11975/oracle_calendar_subscriptions_source
Fix Calendarsubscriptions source column change on Oracle
2 parents e36924e + 071301b commit 3c5e438

8 files changed

Lines changed: 221 additions & 12 deletions

apps/dav/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>WebDAV</name>
66
<summary>WebDAV endpoint</summary>
77
<description>WebDAV endpoint</description>
8-
<version>1.7.2</version>
8+
<version>1.7.3</version>
99
<licence>agpl</licence>
1010
<author>owncloud.org</author>
1111
<namespace>DAV</namespace>

apps/dav/composer/composer/ClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function isClassMapAuthoritative()
279279
*/
280280
public function setApcuPrefix($apcuPrefix)
281281
{
282-
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
282+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283283
}
284284

285285
/**

apps/dav/composer/composer/autoload_classmap.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,11 @@
162162
'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir . '/../lib/Migration/Version1005Date20180530124431.php',
163163
'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir . '/../lib/Migration/Version1006Date20180619154313.php',
164164
'OCA\\DAV\\Migration\\Version1006Date20180628111625' => $baseDir . '/../lib/Migration/Version1006Date20180628111625.php',
165-
'OCA\\DAV\\Migration\\Version1007Date20181007225117' => $baseDir . '/../lib/Migration/Version1007Date20181007225117.php',
166165
'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir . '/../lib/Migration/Version1008Date20181030113700.php',
166+
'OCA\\DAV\\Migration\\Version1008Date20181105104826' => $baseDir . '/../lib/Migration/Version1008Date20181105104826.php',
167+
'OCA\\DAV\\Migration\\Version1008Date20181105104833' => $baseDir . '/../lib/Migration/Version1008Date20181105104833.php',
168+
'OCA\\DAV\\Migration\\Version1008Date20181105110300' => $baseDir . '/../lib/Migration/Version1008Date20181105110300.php',
169+
'OCA\\DAV\\Migration\\Version1008Date20181105112049' => $baseDir . '/../lib/Migration/Version1008Date20181105112049.php',
167170
'OCA\\DAV\\RootCollection' => $baseDir . '/../lib/RootCollection.php',
168171
'OCA\\DAV\\Server' => $baseDir . '/../lib/Server.php',
169172
'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir . '/../lib/Settings/CalDAVSettings.php',

apps/dav/composer/composer/autoload_static.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,11 @@ class ComposerStaticInitDAV
177177
'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180530124431.php',
178178
'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180619154313.php',
179179
'OCA\\DAV\\Migration\\Version1006Date20180628111625' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180628111625.php',
180-
'OCA\\DAV\\Migration\\Version1007Date20181007225117' => __DIR__ . '/..' . '/../lib/Migration/Version1007Date20181007225117.php',
181180
'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181030113700.php',
181+
'OCA\\DAV\\Migration\\Version1008Date20181105104826' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105104826.php',
182+
'OCA\\DAV\\Migration\\Version1008Date20181105104833' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105104833.php',
183+
'OCA\\DAV\\Migration\\Version1008Date20181105110300' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105110300.php',
184+
'OCA\\DAV\\Migration\\Version1008Date20181105112049' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105112049.php',
182185
'OCA\\DAV\\RootCollection' => __DIR__ . '/..' . '/../lib/RootCollection.php',
183186
'OCA\\DAV\\Server' => __DIR__ . '/..' . '/../lib/Server.php',
184187
'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__ . '/..' . '/../lib/Settings/CalDAVSettings.php',
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018 Georg Ehrke
4+
*
5+
* @author Georg Ehrke <oc.list@georgehrke.com>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
declare(strict_types=1);
25+
26+
namespace OCA\DAV\Migration;
27+
28+
29+
use Closure;
30+
use Doctrine\DBAL\Types\Type;
31+
use OCP\DB\ISchemaWrapper;
32+
use OCP\IDBConnection;
33+
use OCP\Migration\SimpleMigrationStep;
34+
use OCP\Migration\IOutput;
35+
36+
class Version1008Date20181105104826 extends SimpleMigrationStep {
37+
38+
/** @var IDBConnection */
39+
private $connection;
40+
41+
/**
42+
* Version1008Date20181105104826 constructor.
43+
*
44+
* @param IDBConnection $connection
45+
*/
46+
public function __construct(IDBConnection $connection) {
47+
$this->connection = $connection;
48+
}
49+
50+
/**
51+
* @param IOutput $output
52+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
53+
* @param array $options
54+
* @return null|ISchemaWrapper
55+
*/
56+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
57+
/** @var ISchemaWrapper $schema */
58+
$schema = $schemaClosure();
59+
$table = $schema->getTable('calendarsubscriptions');
60+
61+
$table->addColumn('source_copy', Type::TEXT, [
62+
'notnull' => false,
63+
'length' => null,
64+
]);
65+
66+
return $schema;
67+
}
68+
69+
/**
70+
* @param IOutput $output
71+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
72+
* @param array $options
73+
*/
74+
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
75+
$qb = $this->connection->getQueryBuilder();
76+
$qb->update('calendarsubscriptions')
77+
->set('source_copy', 'source')
78+
->execute();
79+
}
80+
}

apps/dav/lib/Migration/Version1007Date20181007225117.php renamed to apps/dav/lib/Migration/Version1008Date20181105104833.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@
2020
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2121
*
2222
*/
23+
2324
declare(strict_types=1);
2425

2526
namespace OCA\DAV\Migration;
2627

2728
use Closure;
28-
29-
use Doctrine\DBAL\Types\Type;
3029
use OCP\DB\ISchemaWrapper;
3130
use OCP\Migration\SimpleMigrationStep;
3231
use OCP\Migration\IOutput;
3332

34-
class Version1007Date20181007225117 extends SimpleMigrationStep {
33+
class Version1008Date20181105104833 extends SimpleMigrationStep {
3534

3635
/**
3736
* @param IOutput $output
@@ -42,12 +41,8 @@ class Version1007Date20181007225117 extends SimpleMigrationStep {
4241
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
4342
/** @var ISchemaWrapper $schema */
4443
$schema = $schemaClosure();
45-
4644
$table = $schema->getTable('calendarsubscriptions');
47-
$column = $table->getColumn('source');
48-
49-
$column->setType(Type::getType(Type::TEXT));
50-
$column->setLength(null);
45+
$table->dropColumn('source');
5146

5247
return $schema;
5348
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018 Georg Ehrke
4+
*
5+
* @author Georg Ehrke <oc.list@georgehrke.com>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
declare(strict_types=1);
25+
26+
namespace OCA\DAV\Migration;
27+
28+
use Closure;
29+
use Doctrine\DBAL\Types\Type;
30+
use OCP\DB\ISchemaWrapper;
31+
use OCP\IDBConnection;
32+
use OCP\Migration\SimpleMigrationStep;
33+
use OCP\Migration\IOutput;
34+
35+
class Version1008Date20181105110300 extends SimpleMigrationStep {
36+
37+
/** @var IDBConnection */
38+
private $connection;
39+
40+
/**
41+
* Version1008Date20181105110300 constructor.
42+
*
43+
* @param IDBConnection $connection
44+
*/
45+
public function __construct(IDBConnection $connection) {
46+
$this->connection = $connection;
47+
}
48+
49+
/**
50+
* @param IOutput $output
51+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
52+
* @param array $options
53+
* @return null|ISchemaWrapper
54+
*/
55+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
56+
/** @var ISchemaWrapper $schema */
57+
$schema = $schemaClosure();
58+
$table = $schema->getTable('calendarsubscriptions');
59+
$table->addColumn('source', Type::TEXT, [
60+
'notnull' => false,
61+
'length' => null,
62+
]);
63+
64+
return $schema;
65+
}
66+
67+
/**
68+
* @param IOutput $output
69+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
70+
* @param array $options
71+
*/
72+
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
73+
$qb = $this->connection->getQueryBuilder();
74+
$qb->update('calendarsubscriptions')
75+
->set('source', 'source_copy')
76+
->execute();
77+
}
78+
79+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2018 Georg Ehrke
4+
*
5+
* @author Georg Ehrke <oc.list@georgehrke.com>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
declare(strict_types=1);
25+
26+
namespace OCA\DAV\Migration;
27+
28+
use Closure;
29+
use OCP\DB\ISchemaWrapper;
30+
use OCP\Migration\SimpleMigrationStep;
31+
use OCP\Migration\IOutput;
32+
33+
class Version1008Date20181105112049 extends SimpleMigrationStep {
34+
35+
/**
36+
* @param IOutput $output
37+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38+
* @param array $options
39+
* @return null|ISchemaWrapper
40+
*/
41+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
42+
/** @var ISchemaWrapper $schema */
43+
$schema = $schemaClosure();
44+
$table = $schema->getTable('calendarsubscriptions');
45+
$table->dropColumn('source_copy');
46+
47+
return $schema;
48+
}
49+
}

0 commit comments

Comments
 (0)