Jump to content

Blog post: Using InnoDB with ProcessWire


ryan
 Share

Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

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;");
}

 

  • Like 7
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...