From 706dcfa6dc071f85cd5f0bf6c36d2adaf31c06b5 Mon Sep 17 00:00:00 2001 From: Levi Zitting Date: Fri, 19 Apr 2019 10:00:53 -0500 Subject: [PATCH] Add migration for changing searchindex table to use InnoDB instaed of MyISAM --- ...25_change_search_index_table_to_innodb.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 migrations/m190419_143225_change_search_index_table_to_innodb.php diff --git a/migrations/m190419_143225_change_search_index_table_to_innodb.php b/migrations/m190419_143225_change_search_index_table_to_innodb.php new file mode 100644 index 0000000..0edfaf8 --- /dev/null +++ b/migrations/m190419_143225_change_search_index_table_to_innodb.php @@ -0,0 +1,47 @@ +db->createCommand() + ->setSql('ALTER TABLE searchindex ENGINE = InnoDB;') + ->execute(); + } catch (Exception $exception) { + echo $exception; + return false; + } + + return true; + } + + /** + * @inheritdoc + */ + public function safeDown() + { + try { + $this->db->createCommand() + ->setSql('ALTER TABLE searchindex ENGINE = MyISAM;') + ->execute(); + } catch (Exception $exception) { + echo $exception; + return false; + } + + return true; + } +}