From 5a380a2cf15750366b8b1358a3342d56a4d6a92c Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 25 Oct 2020 15:17:06 +0100 Subject: [PATCH] Added migration file for index on col_gridsquare and col_vucc_grids to speed up VUCC award a bit. --- application/config/migration.php | 2 +- .../migrations/053_gridsquare_index.php | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 application/migrations/053_gridsquare_index.php diff --git a/application/config/migration.php b/application/config/migration.php index 70841b48..9b82e009 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 52; +$config['migration_version'] = 53; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/053_gridsquare_index.php b/application/migrations/053_gridsquare_index.php new file mode 100644 index 00000000..94610e01 --- /dev/null +++ b/application/migrations/053_gridsquare_index.php @@ -0,0 +1,24 @@ +config->item('table_name') . " (COL_GRIDSQUARE)"; + $this->db->query($sql); + + $sql = "CREATE INDEX HRD_IDX_COL_VUCC_GRIDS USING BTREE ON " . $this->config->item('table_name') ." (COL_VUCC_GRIDS)"; + $this->db->query($sql); + } + + public function down() + { + $sql = "ALTER TABLE " . $this->config->item('table_name') . " DROP INDEX HRD_IDX_COL_GRIDSQUARE"; + $this->db->query($sql); + + $sql = "ALTER TABLE " . $this->config->item('table_name') . " DROP INDEX HRD_IDX_COL_VUCC_GRIDS"; + $this->db->query($sql); + } +} \ No newline at end of file