summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-07-12 12:30:52 +0200
committerGitHub <noreply@github.com>2018-07-12 12:30:52 +0200
commit09d5b61c9e468cdc0b92db27946140e68192e2e5 (patch)
treeb9a6e8f01f5b3f75e73ad384074fd22006e9ee5a
parent1fd7ffec0398368df66ee816745ae00e4bbfce31 (diff)
parentdaed1bed57811b677073f4678ef35ea86c8e7a1d (diff)
downloadnextcloud-server-09d5b61c9e468cdc0b92db27946140e68192e2e5.tar.gz
nextcloud-server-09d5b61c9e468cdc0b92db27946140e68192e2e5.zip
Merge pull request #10213 from nextcloud/bugfix/noid/shorten-resource-table-names-to-allow-install-on-oracle
Shorten resource table names to allow install on oracle again
-rw-r--r--apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php2
-rw-r--r--apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php4
-rw-r--r--apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php2
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php2
-rw-r--r--apps/dav/lib/Controller/InvitationResponseController.php2
-rw-r--r--apps/dav/lib/Migration/Version1005Date20180530124431.php15
-rw-r--r--apps/dav/lib/Migration/Version1006Date20180619154313.php8
-rw-r--r--apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php4
-rw-r--r--apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php18
-rw-r--r--apps/dav/tests/unit/CalDAV/ResourceBooking/ResourcePrincipalBackendTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/ResourceBooking/RoomPrincipalBackendTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php6
-rw-r--r--apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php4
13 files changed, 34 insertions, 37 deletions
diff --git a/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php b/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
index e855b57ee9f..942f8e23ecb 100644
--- a/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
+++ b/apps/dav/lib/BackgroundJob/CleanupInvitationTokenJob.php
@@ -45,7 +45,7 @@ class CleanupInvitationTokenJob extends TimedJob {
public function run($argument) {
$query = $this->db->getQueryBuilder();
- $query->delete('calendar_invitation_tokens')
+ $query->delete('calendar_invitations')
->where($query->expr()->lt('expiration',
$query->createNamedParameter($this->timeFactory->getTime())))
->execute();
diff --git a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
index a01540a6292..c5f8f6586e9 100644
--- a/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
+++ b/apps/dav/lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php
@@ -72,9 +72,9 @@ class UpdateCalendarResourcesRoomsBackgroundJob extends TimedJob {
$this->roomManager = $roomManager;
$this->db = $dbConnection;
$this->calDavBackend = $calDavBackend;
- $this->resourceDbTable = 'calendar_resources_cache';
+ $this->resourceDbTable = 'calendar_resources';
$this->resourcePrincipalUri = 'principals/calendar-resources';
- $this->roomDbTable = 'calendar_rooms_cache';
+ $this->roomDbTable = 'calendar_rooms';
$this->roomPrincipalUri = 'principals/calendar-rooms';
// run once an hour
diff --git a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
index 135bbe5827e..dcd393b512e 100644
--- a/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
+++ b/apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php
@@ -68,7 +68,7 @@ abstract class AbstractPrincipalBackend implements BackendInterface {
$this->groupManager = $groupManager;
$this->logger = $logger;
$this->principalPrefix = $principalPrefix;
- $this->dbTableName = 'calendar_' . $dbPrefix . '_cache';
+ $this->dbTableName = 'calendar_' . $dbPrefix;
}
/**
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index 40b4ee355f3..4065c21b8a1 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -536,7 +536,7 @@ class IMipPlugin extends SabreIMipPlugin {
$uid = $vevent->{'UID'};
$query = $this->db->getQueryBuilder();
- $query->insert('calendar_invitation_tokens')
+ $query->insert('calendar_invitations')
->values([
'token' => $query->createNamedParameter($token),
'attendee' => $query->createNamedParameter($attendee),
diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php
index 08298a29f0f..e3bdab90aaf 100644
--- a/apps/dav/lib/Controller/InvitationResponseController.php
+++ b/apps/dav/lib/Controller/InvitationResponseController.php
@@ -162,7 +162,7 @@ class InvitationResponseController extends Controller {
private function getTokenInformation(string $token) {
$query = $this->db->getQueryBuilder();
$query->select('*')
- ->from('calendar_invitation_tokens')
+ ->from('calendar_invitations')
->where($query->expr()->eq('token', $query->createNamedParameter($token)));
$stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
diff --git a/apps/dav/lib/Migration/Version1005Date20180530124431.php b/apps/dav/lib/Migration/Version1005Date20180530124431.php
index ae9a40dc5b2..6f3d6b9cc1f 100644
--- a/apps/dav/lib/Migration/Version1005Date20180530124431.php
+++ b/apps/dav/lib/Migration/Version1005Date20180530124431.php
@@ -27,9 +27,6 @@ use OCP\DB\ISchemaWrapper;
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;
-/**
- * Auto-generated migration step: Please modify to your needs!
- */
class Version1005Date20180530124431 extends SimpleMigrationStep {
/**
@@ -45,8 +42,8 @@ class Version1005Date20180530124431 extends SimpleMigrationStep {
$types = ['resources', 'rooms'];
foreach($types as $type) {
- if (!$schema->hasTable('calendar_' . $type . '_cache')) {
- $table = $schema->createTable('calendar_' . $type . '_cache');
+ if (!$schema->hasTable('calendar_' . $type)) {
+ $table = $schema->createTable('calendar_' . $type);
$table->addColumn('id', Type::BIGINT, [
'autoincrement' => true,
@@ -75,10 +72,10 @@ class Version1005Date20180530124431 extends SimpleMigrationStep {
'length' => 4000,
]);
- $table->setPrimaryKey(['id'], 'calendar_' . $type . '_cache_id_idx');
- $table->addIndex(['backend_id', 'resource_id'], 'calendar_' . $type . '_cache_backendresource_idx');
- $table->addIndex(['email'], 'calendar_' . $type . '_cache_email_idx');
- $table->addIndex(['displayname'], 'calendar_' . $type . '_cache_displayname_idx');
+ $table->setPrimaryKey(['id']);
+ $table->addIndex(['backend_id', 'resource_id'], 'calendar_' . $type . '_bkdrsc');
+ $table->addIndex(['email'], 'calendar_' . $type . '_email');
+ $table->addIndex(['displayname'], 'calendar_' . $type . '_name');
}
}
diff --git a/apps/dav/lib/Migration/Version1006Date20180619154313.php b/apps/dav/lib/Migration/Version1006Date20180619154313.php
index 8fb82ffed67..91d4826c277 100644
--- a/apps/dav/lib/Migration/Version1006Date20180619154313.php
+++ b/apps/dav/lib/Migration/Version1006Date20180619154313.php
@@ -22,8 +22,8 @@ class Version1006Date20180619154313 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
- if (!$schema->hasTable('calendar_invitation_tokens')) {
- $table = $schema->createTable('calendar_invitation_tokens');
+ if (!$schema->hasTable('calendar_invitations')) {
+ $table = $schema->createTable('calendar_invitations');
$table->addColumn('id', Type::BIGINT, [
'autoincrement' => true,
@@ -62,8 +62,8 @@ class Version1006Date20180619154313 extends SimpleMigrationStep {
'unsigned' => true,
]);
- $table->setPrimaryKey(['id'], 'calendar_invitation_tokens_id_idx');
- $table->addIndex(['token'], 'calendar_invitation_tokens_token_idx');
+ $table->setPrimaryKey(['id']);
+ $table->addIndex(['token'], 'calendar_invitation_tokens');
return $schema;
}
diff --git a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
index 3e69230f441..2d80b5bf0ea 100644
--- a/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/CleanupInvitationTokenJobTest.php
@@ -84,7 +84,7 @@ class CleanupInvitationTokenJobTest extends TestCase {
$queryBuilder->expects($this->at(0))
->method('delete')
- ->with('calendar_invitation_tokens')
+ ->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(3))
->method('where')
@@ -97,4 +97,4 @@ class CleanupInvitationTokenJobTest extends TestCase {
$this->backgroundJob->run([]);
}
-} \ No newline at end of file
+}
diff --git a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
index 56f768ceda0..e012d5e3f18 100644
--- a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
@@ -60,8 +60,8 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
protected function tearDown() {
$query = self::$realDatabase->getQueryBuilder();
- $query->delete('calendar_resources_cache')->execute();
- $query->delete('calendar_rooms_cache')->execute();
+ $query->delete('calendar_resources')->execute();
+ $query->delete('calendar_rooms')->execute();
}
/**
@@ -170,7 +170,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$this->backgroundJob->run([]);
$query = self::$realDatabase->getQueryBuilder();
- $query->select('*')->from('calendar_resources_cache');
+ $query->select('*')->from('calendar_resources');
$rows = [];
$stmt = $query->execute();
@@ -227,7 +227,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
protected function createTestResourcesInCache() {
$query = self::$realDatabase->getQueryBuilder();
- $query->insert('calendar_resources_cache')
+ $query->insert('calendar_resources')
->values([
'backend_id' => $query->createNamedParameter('backend1'),
'resource_id' => $query->createNamedParameter('res1'),
@@ -236,7 +236,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
'group_restrictions' => $query->createNamedParameter('[]'),
])
->execute();
- $query->insert('calendar_resources_cache')
+ $query->insert('calendar_resources')
->values([
'backend_id' => $query->createNamedParameter('backend1'),
'resource_id' => $query->createNamedParameter('res2'),
@@ -245,7 +245,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
'group_restrictions' => $query->createNamedParameter('[]'),
])
->execute();
- $query->insert('calendar_resources_cache')
+ $query->insert('calendar_resources')
->values([
'backend_id' => $query->createNamedParameter('backend2'),
'resource_id' => $query->createNamedParameter('res3'),
@@ -254,7 +254,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
'group_restrictions' => $query->createNamedParameter('[]'),
])
->execute();
- $query->insert('calendar_resources_cache')
+ $query->insert('calendar_resources')
->values([
'backend_id' => $query->createNamedParameter('backend2'),
'resource_id' => $query->createNamedParameter('res4'),
@@ -263,7 +263,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
'group_restrictions' => $query->createNamedParameter('[]'),
])
->execute();
- $query->insert('calendar_resources_cache')
+ $query->insert('calendar_resources')
->values([
'backend_id' => $query->createNamedParameter('backend3'),
'resource_id' => $query->createNamedParameter('res5'),
@@ -272,7 +272,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
'group_restrictions' => $query->createNamedParameter('[]'),
])
->execute();
- $query->insert('calendar_resources_cache')
+ $query->insert('calendar_resources')
->values([
'backend_id' => $query->createNamedParameter('backend3'),
'resource_id' => $query->createNamedParameter('res6'),
diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/ResourcePrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/ResourcePrincipalBackendTest.php
index f2c6b6f5f5e..90db4bb4b7b 100644
--- a/apps/dav/tests/unit/CalDAV/ResourceBooking/ResourcePrincipalBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/ResourcePrincipalBackendTest.php
@@ -29,7 +29,7 @@ Class ResourcePrincipalBackendTest extends AbstractPrincipalBackendTest {
$this->principalBackend = new ResourcePrincipalBackend($this->dbConnection,
$this->userSession, $this->groupManager, $this->logger);
- $this->expectedDbTable = 'calendar_resources_cache';
+ $this->expectedDbTable = 'calendar_resources';
$this->principalPrefix = 'principals/calendar-resources';
}
}
diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/RoomPrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/RoomPrincipalBackendTest.php
index f45121f4548..b55c6ddceb6 100644
--- a/apps/dav/tests/unit/CalDAV/ResourceBooking/RoomPrincipalBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/RoomPrincipalBackendTest.php
@@ -29,7 +29,7 @@ Class RoomPrincipalBackendTest extends AbstractPrincipalBackendTest {
$this->principalBackend = new RoomPrincipalBackend($this->dbConnection,
$this->userSession, $this->groupManager, $this->logger);
- $this->expectedDbTable = 'calendar_rooms_cache';
+ $this->expectedDbTable = 'calendar_rooms';
$this->principalPrefix = 'principals/calendar-rooms';
}
}
diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
index 2fefe8dd06a..c95b32041e0 100644
--- a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
@@ -96,7 +96,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0))
->method('insert')
- ->with('calendar_invitation_tokens')
+ ->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8))
->method('values')
@@ -176,7 +176,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0))
->method('insert')
- ->with('calendar_invitation_tokens')
+ ->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8))
->method('values')
@@ -264,7 +264,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0))
->method('insert')
- ->with('calendar_invitation_tokens')
+ ->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8))
->method('values')
diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
index 333737e2262..7efb64e3dd4 100644
--- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
+++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
@@ -438,7 +438,7 @@ EOF;
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(1))
->method('from')
- ->with('calendar_invitation_tokens')
+ ->with('calendar_invitations')
->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(4))
->method('where')
@@ -452,4 +452,4 @@ EOF;
$this->timeFactory->method('getTime')
->will($this->returnValue($time));
}
-} \ No newline at end of file
+}