aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/migrator.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/db/migrator.php')
-rw-r--r--phpBB/includes/db/migrator.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php
index 41d996b1e3..ea5de3372f 100644
--- a/phpBB/includes/db/migrator.php
+++ b/phpBB/includes/db/migrator.php
@@ -99,18 +99,26 @@ class phpbb_db_migrator
{
$this->migration_state = array();
+ // prevent errors in case the table does not exist yet
+ $this->db->sql_return_on_error(true);
+
$sql = "SELECT *
FROM " . $this->migrations_table;
$result = $this->db->sql_query($sql);
- while ($migration = $this->db->sql_fetchrow($result))
+ if (!$this->db->sql_error_triggered)
{
- $this->migration_state[$migration['migration_name']] = $migration;
+ while ($migration = $this->db->sql_fetchrow($result))
+ {
+ $this->migration_state[$migration['migration_name']] = $migration;
+
+ $this->migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']);
+ }
- $this->migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']);
+ $this->db->sql_freeresult($result);
}
- $this->db->sql_freeresult($result);
+ $this->db->sql_return_on_error(false);
}
/**