Jump to content
ryan

Blog post: Using InnoDB with ProcessWire

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

Share this post


Link to post
Share on other sites

@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!

  • Like 2

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...