mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 16:53:10 +08:00
A bit more code styling in MySqlCommandInterpreter to avoid a ton of whitespace in the query
This commit is contained in:
@@ -97,9 +97,9 @@ namespace Orchard.Data.Migration.Interpreters {
|
|||||||
|
|
||||||
if (columnList.Count > 1) {
|
if (columnList.Count > 1) {
|
||||||
sqlCommand.CommandText = $@"
|
sqlCommand.CommandText = $@"
|
||||||
SELECT SUM(CHARACTER_MAXIMUM_LENGTH)
|
SELECT SUM(CHARACTER_MAXIMUM_LENGTH)
|
||||||
FROM INFORMATION_SCHEMA.COLUMNS
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
WHERE table_name = '{tableName}'
|
WHERE table_name = '{tableName}'
|
||||||
AND COLUMN_NAME in ({columnNames})
|
AND COLUMN_NAME in ({columnNames})
|
||||||
AND TABLE_SCHEMA = '{session.Connection.Database}'
|
AND TABLE_SCHEMA = '{session.Connection.Database}'
|
||||||
AND (Data_type = 'varchar');";
|
AND (Data_type = 'varchar');";
|
||||||
@@ -117,9 +117,9 @@ namespace Orchard.Data.Migration.Interpreters {
|
|||||||
}
|
}
|
||||||
// Check whether the index contains big nvarchar columns or text fields.
|
// Check whether the index contains big nvarchar columns or text fields.
|
||||||
sqlCommand.CommandText = $@"
|
sqlCommand.CommandText = $@"
|
||||||
SELECT COLUMN_NAME
|
SELECT COLUMN_NAME
|
||||||
FROM INFORMATION_SCHEMA.COLUMNS
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
WHERE table_name = '{tableName}'
|
WHERE table_name = '{tableName}'
|
||||||
AND COLUMN_NAME in ({columnNames})
|
AND COLUMN_NAME in ({columnNames})
|
||||||
AND TABLE_SCHEMA = '{session.Connection.Database}'
|
AND TABLE_SCHEMA = '{session.Connection.Database}'
|
||||||
AND ((Data_type = 'varchar' and CHARACTER_MAXIMUM_LENGTH > {indexMaximumLength}) OR data_type= 'text');";
|
AND ((Data_type = 'varchar' and CHARACTER_MAXIMUM_LENGTH > {indexMaximumLength}) OR data_type= 'text');";
|
||||||
|
|||||||
Reference in New Issue
Block a user