From 8785d5e93415edc7c8e26a2ce1e11f723f725b34 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 2 Feb 2022 10:25:31 +0100 Subject: [PATCH] add index for last_contact in text_sessions table Signed-off-by: Julien Veyssier --- appinfo/info.xml | 2 +- .../Version010000Date20190617184535.php | 1 + .../Version030501Date20220202101853.php | 35 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lib/Migration/Version030501Date20220202101853.php diff --git a/appinfo/info.xml b/appinfo/info.xml index 2a8504e7c68..07228f7ea10 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -11,7 +11,7 @@ - **๐Ÿ’พ Open format:** Files are saved as [Markdown](https://en.wikipedia.org/wiki/Markdown), so you can edit them from any other text app too. - **โœŠ Strong foundation:** We use [๐Ÿˆ tiptap](https://tiptap.scrumpy.io) which is based on [๐Ÿฆ‰ ProseMirror](https://prosemirror.net) โ€“ huge thanks to them! ]]> - 3.5.0 + 3.5.1 agpl Julius Hรคrtl Text diff --git a/lib/Migration/Version010000Date20190617184535.php b/lib/Migration/Version010000Date20190617184535.php index d71bc9d0eca..aaafc11820b 100644 --- a/lib/Migration/Version010000Date20190617184535.php +++ b/lib/Migration/Version010000Date20190617184535.php @@ -101,6 +101,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt ]); $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 00000000000..dcdede67e41 --- /dev/null +++ b/lib/Migration/Version030501Date20220202101853.php @@ -0,0 +1,35 @@ +getTable('text_sessions'); + if (!$table->hasIndex('ts_lastcontact')) { + $table->addIndex(['last_contact'], 'ts_lastcontact'); + return $schema; + } + + return null; + } +}