Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/fulltextsearch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-04-08 17:07:33 +0300
committerJoas Schilling <coding@schilljs.com>2022-04-08 17:07:33 +0300
commit0bc682ec64b1bbfeae2f0a192d2231d2dd74ec40 (patch)
treed9fbaf6feec206a3078753ae84eba7155966ad44
parent5175bc46f20cd25397f9edb4cefebd061e85d06f (diff)
Add a migration to change existing installs
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--appinfo/info.xml2
-rw-r--r--lib/Migration/Version23001Date20220408140253.php57
2 files changed, 58 insertions, 1 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 9dfd692..16ae8e5 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -10,7 +10,7 @@ Core App of the full-text search framework for your Nextcloud.
]]>
</description>
- <version>23.1.0-dev</version>
+ <version>23.1.0-dev.1</version>
<licence>agpl</licence>
<author>Maxence Lange</author>
<namespace>FullTextSearch</namespace>
diff --git a/lib/Migration/Version23001Date20220408140253.php b/lib/Migration/Version23001Date20220408140253.php
new file mode 100644
index 0000000..ec7d6fe
--- /dev/null
+++ b/lib/Migration/Version23001Date20220408140253.php
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
+ *
+ * @author Joas Schilling <coding@schilljs.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\FullTextSearch\Migration;
+
+use Closure;
+use Doctrine\DBAL\Types\Type;
+use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version23001Date20220408140253 extends SimpleMigrationStep {
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $table = $schema->getTable('fulltextsearch_indexes');
+ $column = $table->getColumn('message');
+
+ if ($column->getType()->getName() === Types::TEXT) {
+ return null;
+ }
+
+ $column->setType(Type::getType(Types::TEXT));
+ return $schema;
+ }
+}