diff options
Diffstat (limited to 'phpBB/phpbb')
| -rw-r--r-- | phpBB/phpbb/db/migration/schema_generator.php | 20 | 
1 files changed, 19 insertions, 1 deletions
| diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index 871fd97aca..818e27a362 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -109,7 +109,25 @@ class schema_generator  							{  								foreach ($add_columns as $column => $column_data)  								{ -									$this->tables[$table]['COLUMNS'][$column] = $column_data; +									if (isset($column_data['after'])) +									{ +										$columns = $this->tables[$table]['COLUMNS']; +										$offset = array_search($column_data['after'], array_keys($columns)); +										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)); +										} +									} +									else +									{ +										$this->tables[$table]['COLUMNS'][$column] = $column_data; +									}  								}  							}  						} | 
