diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Migration/Version010000Date20190617184535.php | 1 | ||||
-rw-r--r-- | lib/Migration/Version030501Date20220202101853.php | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/lib/Migration/Version010000Date20190617184535.php b/lib/Migration/Version010000Date20190617184535.php index d71bc9d0e..aaafc1182 100644 --- a/lib/Migration/Version010000Date20190617184535.php +++ b/lib/Migration/Version010000Date20190617184535.php @@ -101,6 +101,7 @@ class Version010000Date20190617184535 extends SimpleMigrationStep { ]); $table->setPrimaryKey(['id']); $table->addIndex(['token'], 'rd_session_token_idx'); + $table->addIndex(['last_contact'], 'ts_lastcontact'); } if (!$schema->hasTable('text_steps')) { diff --git a/lib/Migration/Version030501Date20220202101853.php b/lib/Migration/Version030501Date20220202101853.php new file mode 100644 index 000000000..dcdede67e --- /dev/null +++ b/lib/Migration/Version030501Date20220202101853.php @@ -0,0 +1,35 @@ +<?php + +declare(strict_types=1); + +namespace OCA\Text\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +/** + * Auto-generated migration step: Please modify to your needs! + */ +class Version030501Date20220202101853 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) { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + $table = $schema->getTable('text_sessions'); + if (!$table->hasIndex('ts_lastcontact')) { + $table->addIndex(['last_contact'], 'ts_lastcontact'); + return $schema; + } + + return null; + } +} |