mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[ticket/11367] Migrator throws error if migrations table does not exist
Force load_migration_state to not throw errors if the table does not exist. PHPBB3-11367
This commit is contained in:
@@ -99,10 +99,15 @@ class phpbb_db_migrator
|
|||||||
{
|
{
|
||||||
$this->migration_state = array();
|
$this->migration_state = array();
|
||||||
|
|
||||||
|
// prevent errors in case the table does not exist yet
|
||||||
|
$this->db->sql_return_on_error(true);
|
||||||
|
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM " . $this->migrations_table;
|
FROM " . $this->migrations_table;
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
|
|
||||||
|
if (!$this->db->sql_error_triggered)
|
||||||
|
{
|
||||||
while ($migration = $this->db->sql_fetchrow($result))
|
while ($migration = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$this->migration_state[$migration['migration_name']] = $migration;
|
$this->migration_state[$migration['migration_name']] = $migration;
|
||||||
@@ -113,6 +118,9 @@ class phpbb_db_migrator
|
|||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->db->sql_return_on_error(false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the list of available migration class names to the given array.
|
* Sets the list of available migration class names to the given array.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user