From 459b5086d56d97b2ccf42b1fd50a7924883b6c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 26 Feb 2014 20:42:45 +0100 Subject: [PATCH 1/3] adding test for migrations on columns using keywords --- tests/data/db_structure.xml | 15 +++++++++++++++ tests/data/db_structure2.xml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/data/db_structure.xml b/tests/data/db_structure.xml index d98066c4b7e..5fffd5475f9 100644 --- a/tests/data/db_structure.xml +++ b/tests/data/db_structure.xml @@ -223,4 +223,19 @@ + + *dbprefix*migratekeyword + + + + + key + text + + true + 255 + + +
+ diff --git a/tests/data/db_structure2.xml b/tests/data/db_structure2.xml index ae5f22e9573..aa6e94a2a84 100644 --- a/tests/data/db_structure2.xml +++ b/tests/data/db_structure2.xml @@ -119,4 +119,19 @@ + + *dbprefix*migratekeyword + + + + + key + text + + false + 255 + + +
+ From 230e5e3788f8289447602b70e2445c134e532e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 26 Feb 2014 20:47:07 +0100 Subject: [PATCH 2/3] let's name the column 'select' because this is a keyword on all platforms --- tests/data/db_structure.xml | 2 +- tests/data/db_structure2.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/db_structure.xml b/tests/data/db_structure.xml index 5fffd5475f9..858c9ab1002 100644 --- a/tests/data/db_structure.xml +++ b/tests/data/db_structure.xml @@ -229,7 +229,7 @@ - key + select text true diff --git a/tests/data/db_structure2.xml b/tests/data/db_structure2.xml index aa6e94a2a84..568d90ab0a9 100644 --- a/tests/data/db_structure2.xml +++ b/tests/data/db_structure2.xml @@ -125,7 +125,7 @@ - key + select text false From 22adc397dea060150e6982ba9dda1483eebbfa67 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 26 Feb 2014 16:26:16 +0100 Subject: [PATCH 3/3] Also quote old column name during DB migration This fixes alter table commands that didn't quote the old column name --- lib/private/db/mdb2schemamanager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php index c050d47b499..aaf2ea543b9 100644 --- a/lib/private/db/mdb2schemamanager.php +++ b/lib/private/db/mdb2schemamanager.php @@ -82,6 +82,9 @@ class MDB2SchemaManager { $platform = $this->conn->getDatabasePlatform(); foreach($schemaDiff->changedTables as $tableDiff) { $tableDiff->name = $platform->quoteIdentifier($tableDiff->name); + foreach($tableDiff->changedColumns as $column) { + $column->oldColumnName = $platform->quoteIdentifier($column->oldColumnName); + } } if ($generateSql) {