This is an automated email from the ASF dual-hosted git repository.
snoopdave pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/roller.git
The following commit(s) were added to refs/heads/master by this push:
new 826751c [ROL-2074] fix for "DB upgrade fails on MySQL 5.6"
826751c is described below
commit 826751ce16f4068736675c91920a4179350e631d
Author: David M. Johnson <[email protected]>
AuthorDate: Fri Dec 24 17:25:03 2021 -0500
[ROL-2074] fix for "DB upgrade fails on MySQL 5.6"
---
app/src/main/resources/sql/520-to-610-migration.vm | 2 +-
app/src/main/resources/sql/macros.vm | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/src/main/resources/sql/520-to-610-migration.vm
b/app/src/main/resources/sql/520-to-610-migration.vm
index 35599ed..3ee715e 100644
--- a/app/src/main/resources/sql/520-to-610-migration.vm
+++ b/app/src/main/resources/sql/520-to-610-migration.vm
@@ -4,4 +4,4 @@
DON'T RUN THIS, IT'S NOT A DATABASE CREATION SCRIPT!!!
**#
-#alterColumnName('weblog' 'blacklist' 'bannedwordslist')
+#alterColumnName('weblog' 'blacklist' 'bannedwordslist' $db.TEXT_SQL_TYPE)
diff --git a/app/src/main/resources/sql/macros.vm
b/app/src/main/resources/sql/macros.vm
index 0c74ddd..6d05ae7 100644
--- a/app/src/main/resources/sql/macros.vm
+++ b/app/src/main/resources/sql/macros.vm
@@ -164,13 +164,15 @@ alter table $tableName alter column $columnName
$columnType;
#**
Rename a table column.
-this is trivial generic SQL - this should work everywhere, right?
**#
-#macro(alterColumnName $tableName $columnName $newColumnName)
+#macro(alterColumnName $tableName $columnName $newColumnName $columnType)
#if ($db.DBTYPE == "MSSQL")
sp_rename '$tableName.$columnName', '$newColumnName', 'COLUMN';
#elseif ($db.DBTYPE == "HSQLDB")
alter table $tableName alter column $columnName rename to $newColumnName;
+#elseif ($db.DBTYPE == "MYSQL")
+#** MySQL 5.7 and earlier need this syntax **#
+alter table $tableName change $columnName $newColumnName $columnType;
#else
alter table $tableName rename column $columnName to $newColumnName;
#end