summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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/Migration/Version1005Date20180530124431.php15
-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
6 files changed, 20 insertions, 23 deletions
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/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/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';
}
}