aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migration
diff options
context:
space:
mode:
authorPayBas <contact@paybas.com>2014-05-26 19:28:37 +0200
committerPayBas <contact@paybas.com>2014-05-26 19:28:37 +0200
commitc51b926631eb8e339c7a29cf3ff145e9e158b04f (patch)
treed4b4a9702199509e4f222a7eab266d9c673779ea /phpBB/phpbb/db/migration
parent05839f85994c1281936d2dd64215c068e55b6d54 (diff)
downloadforums-c51b926631eb8e339c7a29cf3ff145e9e158b04f.tar
forums-c51b926631eb8e339c7a29cf3ff145e9e158b04f.tar.gz
forums-c51b926631eb8e339c7a29cf3ff145e9e158b04f.tar.bz2
forums-c51b926631eb8e339c7a29cf3ff145e9e158b04f.tar.xz
forums-c51b926631eb8e339c7a29cf3ff145e9e158b04f.zip
[ticket/12561] Add check to see if "after" column actually exists
If not, just append to the end PHPBB3-12561
Diffstat (limited to 'phpBB/phpbb/db/migration')
-rw-r--r--phpBB/phpbb/db/migration/schema_generator.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php
index 872430e078..f36e6a96d5 100644
--- a/phpBB/phpbb/db/migration/schema_generator.php
+++ b/phpBB/phpbb/db/migration/schema_generator.php
@@ -112,7 +112,15 @@ class schema_generator
$columns = $this->tables[$table]['COLUMNS'];
$offset = array_search($column_data['after'], array_keys($columns));
unset($column_data['after']);
- $this->tables[$table]['COLUMNS'] = array_merge(array_slice($columns, 0, $offset + 1, true), array($column => array_values($column_data)), array_slice($columns, $offset));
+
+ 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
{