ryan Posted August 17, 2018 Share Posted August 17, 2018 This week we take a look at a couple of reasons why you might want to choose InnoDB as your MySQL database engine when installing ProcessWire— https://processwire.com/blog/posts/using-innodb-with-processwire/ 13 Link to comment Share on other sites More sharing options...
dragan Posted August 17, 2018 Share Posted August 17, 2018 Wow, this is great news to me. I didn't even know you could do $database->beginTransaction(); stuff in the first place. I mean, being able to use this method with PW's API methods. I thought it could be used only with native / raw SQL. 1 Link to comment Share on other sites More sharing options...
netcarver Posted August 17, 2018 Share Posted August 17, 2018 @ryan Seems like you've been addressing my personal wish-list recently - 2FA and InnoDB - I've been an advocate for both for a long time. Thank you! 2 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted August 18, 2018 Share Posted August 18, 2018 Quote So we'd be left with /foo/ and the wrong /bar/, and we've now got a foobar problem. Nice play on words there. -- In the article you mentioned you could modify your tables to InnoDB by exporting, doing a search/replace, then re-importing. You can also do it like this: <?php namespace ProcessWire; // assuming this script is in the pw root dir; backup your database first, just incase! include(dirname(__FILE__).'/index.php'); $query = $database->query("SELECT table_name FROM information_schema.tables WHERE table_schema='{$config->dbName}';"); foreach($query->fetchAll() as $row) { $table = $row[0]; $database->query("ALTER TABLE $table ENGINE=InnoDB;"); } 7 Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 18, 2018 Share Posted August 18, 2018 @Jonathan Lahijani That snippet changes the engine for tables, but there are other things need to be changed of InnoDB when using utf8mb4: https://github.com/processwire/processwire/blob/341342dc5b1c58012ae7cb26cffe2c57cd915552/install.php#L958-L969 4 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now