mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-17 16:58:51 +00:00
[ticket/12561] Add check to see if "after" column actually exists
If not, just append to the end PHPBB3-12561
This commit is contained in:
parent
05839f8599
commit
c51b926631
1 changed files with 9 additions and 1 deletions
|
@ -112,8 +112,16 @@ class schema_generator
|
||||||
$columns = $this->tables[$table]['COLUMNS'];
|
$columns = $this->tables[$table]['COLUMNS'];
|
||||||
$offset = array_search($column_data['after'], array_keys($columns));
|
$offset = array_search($column_data['after'], array_keys($columns));
|
||||||
unset($column_data['after']);
|
unset($column_data['after']);
|
||||||
|
|
||||||
|
if ($offset == false)
|
||||||
|
{
|
||||||
|
$this->tables[$table]['COLUMNS'][$column] = array_values($column_data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$this->tables[$table]['COLUMNS'] = array_merge(array_slice($columns, 0, $offset + 1, true), array($column => array_values($column_data)), array_slice($columns, $offset));
|
$this->tables[$table]['COLUMNS'] = array_merge(array_slice($columns, 0, $offset + 1, true), array($column => array_values($column_data)), array_slice($columns, $offset));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->tables[$table]['COLUMNS'][$column] = $column_data;
|
$this->tables[$table]['COLUMNS'][$column] = $column_data;
|
||||||
|
|
Loading…
Add table
Reference in a new issue