From dd049feb40466da2be78d16839e222f0ef90d7d0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 12 Feb 2023 13:12:09 +0100 Subject: [PATCH] Add migration with new index for short_url_id+potential_bot on visits table --- data/migrations/Version20230211171904.php | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 data/migrations/Version20230211171904.php diff --git a/data/migrations/Version20230211171904.php b/data/migrations/Version20230211171904.php new file mode 100644 index 00000000..1d1acbf7 --- /dev/null +++ b/data/migrations/Version20230211171904.php @@ -0,0 +1,27 @@ +getTable('visits'); + $this->skipIf($visits->hasIndex(self::INDEX_NAME)); + + $visits->addIndex(['short_url_id', 'potential_bot'], self::INDEX_NAME); + } + + public function isTransactional(): bool + { + return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); + } +}