diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2022-04-08 19:36:51 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2022-04-08 19:36:51 +0300 |
commit | e35a39389e90cdfbbf502d753de8aae2c88c2f4a (patch) | |
tree | faba084561480db7312ed62fb51f924865ff1952 | |
parent | 463c88f164a5bf25f0ee6ebf4f45442036c8c72c (diff) | |
parent | 0bc682ec64b1bbfeae2f0a192d2231d2dd74ec40 (diff) |
Merge remote-tracking branch 'origin/fix/678/message-is-text' into fix/678/message-is-textfix/678/message-is-text
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | lib/Migration/Version23001Date20220408140253.php | 57 |
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; + } +} |