aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2020-09-02 14:33:40 +0200
committerGeorg Ehrke <developer@georgehrke.com>2020-09-07 11:30:18 +0200
commit2146950a711fc49cf48c1ec10230106f5a59d5b9 (patch)
tree94da27cd1ffc2d0db94213afa5377675162c8b69 /apps/user_status
parent5be49491d31f7f4a972fa5c2b7034b688f318c94 (diff)
downloadnextcloud-server-2146950a711fc49cf48c1ec10230106f5a59d5b9.tar.gz
nextcloud-server-2146950a711fc49cf48c1ec10230106f5a59d5b9.zip
Add MigrationStep to add better Indizes
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/user_status')
-rw-r--r--apps/user_status/appinfo/info.xml2
-rw-r--r--apps/user_status/composer/composer/autoload_classmap.php1
-rw-r--r--apps/user_status/composer/composer/autoload_static.php1
-rw-r--r--apps/user_status/lib/Migration/Version0002Date20200902144824.php57
4 files changed, 60 insertions, 1 deletions
diff --git a/apps/user_status/appinfo/info.xml b/apps/user_status/appinfo/info.xml
index 46036812f35..26d8113a842 100644
--- a/apps/user_status/appinfo/info.xml
+++ b/apps/user_status/appinfo/info.xml
@@ -5,7 +5,7 @@
<name>User status</name>
<summary>User status</summary>
<description><![CDATA[User status]]></description>
- <version>0.0.2</version>
+ <version>1.0.0</version>
<licence>agpl</licence>
<author mail="oc.list@georgehrke.com" >Georg Ehrke</author>
<namespace>UserStatus</namespace>
diff --git a/apps/user_status/composer/composer/autoload_classmap.php b/apps/user_status/composer/composer/autoload_classmap.php
index 151d8348078..ba2ed1f1762 100644
--- a/apps/user_status/composer/composer/autoload_classmap.php
+++ b/apps/user_status/composer/composer/autoload_classmap.php
@@ -27,6 +27,7 @@ return array(
'OCA\\UserStatus\\Listener\\UserDeletedListener' => $baseDir . '/../lib/Listener/UserDeletedListener.php',
'OCA\\UserStatus\\Listener\\UserLiveStatusListener' => $baseDir . '/../lib/Listener/UserLiveStatusListener.php',
'OCA\\UserStatus\\Migration\\Version0001Date20200602134824' => $baseDir . '/../lib/Migration/Version0001Date20200602134824.php',
+ 'OCA\\UserStatus\\Migration\\Version0002Date20200902144824' => $baseDir . '/../lib/Migration/Version0002Date20200902144824.php',
'OCA\\UserStatus\\Service\\EmojiService' => $baseDir . '/../lib/Service/EmojiService.php',
'OCA\\UserStatus\\Service\\JSDataService' => $baseDir . '/../lib/Service/JSDataService.php',
'OCA\\UserStatus\\Service\\PredefinedStatusService' => $baseDir . '/../lib/Service/PredefinedStatusService.php',
diff --git a/apps/user_status/composer/composer/autoload_static.php b/apps/user_status/composer/composer/autoload_static.php
index bed8bc364bf..fd05c1c1627 100644
--- a/apps/user_status/composer/composer/autoload_static.php
+++ b/apps/user_status/composer/composer/autoload_static.php
@@ -42,6 +42,7 @@ class ComposerStaticInitUserStatus
'OCA\\UserStatus\\Listener\\UserDeletedListener' => __DIR__ . '/..' . '/../lib/Listener/UserDeletedListener.php',
'OCA\\UserStatus\\Listener\\UserLiveStatusListener' => __DIR__ . '/..' . '/../lib/Listener/UserLiveStatusListener.php',
'OCA\\UserStatus\\Migration\\Version0001Date20200602134824' => __DIR__ . '/..' . '/../lib/Migration/Version0001Date20200602134824.php',
+ 'OCA\\UserStatus\\Migration\\Version0002Date20200902144824' => __DIR__ . '/..' . '/../lib/Migration/Version0002Date20200902144824.php',
'OCA\\UserStatus\\Service\\EmojiService' => __DIR__ . '/..' . '/../lib/Service/EmojiService.php',
'OCA\\UserStatus\\Service\\JSDataService' => __DIR__ . '/..' . '/../lib/Service/JSDataService.php',
'OCA\\UserStatus\\Service\\PredefinedStatusService' => __DIR__ . '/..' . '/../lib/Service/PredefinedStatusService.php',
diff --git a/apps/user_status/lib/Migration/Version0002Date20200902144824.php b/apps/user_status/lib/Migration/Version0002Date20200902144824.php
new file mode 100644
index 00000000000..abec418058f
--- /dev/null
+++ b/apps/user_status/lib/Migration/Version0002Date20200902144824.php
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2020, Georg Ehrke
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCA\UserStatus\Migration;
+
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+/**
+ * Class Version0001Date20200602134824
+ *
+ * @package OCA\UserStatus\Migration
+ */
+class Version0002Date20200902144824 extends SimpleMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ * @since 20.0.0
+ */
+ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $statusTable = $schema->getTable('user_status');
+
+ $statusTable->addIndex(['status_timestamp'], 'user_status_tstmp_ix');
+ $statusTable->addIndex(['is_user_defined', 'status'], 'user_status_iud_ix');
+
+ return $schema;
+ }
+}