Right now, when Demonstration Site is restoring a database, it uses "CREATE TABLE IF NOT EXISTS". This is fine if the tables don't already exist, but it isn't fine if the tables already exist and have the incorrect schema, or already existing data. This patch moves from "CREATE TABLE IF NOT EXISTS" to "DROP TABLE IF EXISTS", followed by a "CREATE TABLE". This ensures that the correct schema is in place, as well empty start data.

CommentFileSizeAuthor
droptablebeforecreate.patch835 bytesrobloach

Comments

robloach’s picture

As a side note, this allows Demonstration Site Install Profile to install a site over an already existing database, which is good when restoring from a fresh settings.php.

sun’s picture

Hm. I'm not really sure we want to do (force) this. How about an option?

robloach’s picture

Status: Needs review » Closed (works as designed)

Correction to my statement at #1. When you try to install on top of an existing Demo site, it tells you that Drupal is already installed. This is not Demo doing it, but Drupal. An alternative solution will have to do.