summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-02-27 21:52:46 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-02-27 21:52:46 +0100
commit93b8aba3a174beed499ffe96d6b1c74e96775052 (patch)
treeb45f7afe453e2406121e3574f7af4058db99eeee
parente30480961246c33c3938bb5023e4e06675ad5c48 (diff)
parent22adc397dea060150e6982ba9dda1483eebbfa67 (diff)
downloadnextcloud-server-93b8aba3a174beed499ffe96d6b1c74e96775052.tar.gz
nextcloud-server-93b8aba3a174beed499ffe96d6b1c74e96775052.zip
Merge pull request #7439 from owncloud/unit-test-for-7430
adding test for migrations on columns using keywords
-rw-r--r--lib/private/db/mdb2schemamanager.php3
-rw-r--r--tests/data/db_structure.xml15
-rw-r--r--tests/data/db_structure2.xml15
3 files changed, 33 insertions, 0 deletions
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) {
diff --git a/tests/data/db_structure.xml b/tests/data/db_structure.xml
index d98066c4b7e..858c9ab1002 100644
--- a/tests/data/db_structure.xml
+++ b/tests/data/db_structure.xml
@@ -223,4 +223,19 @@
</declaration>
</table>
+<table>
+ <name>*dbprefix*migratekeyword</name>
+
+ <declaration>
+
+ <field>
+ <name>select</name>
+ <type>text</type>
+ <default></default>
+ <notnull>true</notnull>
+ <length>255</length>
+ </field>
+ </declaration>
+</table>
+
</database>
diff --git a/tests/data/db_structure2.xml b/tests/data/db_structure2.xml
index ae5f22e9573..568d90ab0a9 100644
--- a/tests/data/db_structure2.xml
+++ b/tests/data/db_structure2.xml
@@ -119,4 +119,19 @@
</declaration>
</table>
+ <table>
+ <name>*dbprefix*migratekeyword</name>
+
+ <declaration>
+
+ <field>
+ <name>select</name>
+ <type>text</type>
+ <default></default>
+ <notnull>false</notnull>
+ <length>255</length>
+ </field>
+ </declaration>
+ </table>
+
</database>