昨天跟一资深老用户沟通之后,发现DTcms MySql版用得人越来越多了,整个运行于Linux主机下,比一定要Windows和MSSQL数据库的要求降低了很多,优势太明显。
于是昨晚加班,国庆假期前,搞定如下升级:
1、完成MySql.Data.dll更新
消除了报错:MySql.Data.MySqlClient.MySqlException:Fatal error encountered attempting to read the resultset,以便支持较新版本的MySql数据库。
2、完善读取MySql数据库的表列表和字段属性的脚本
SELECT table_name TableName,TABLE_COMMENT TableDescription
FROM INFORMATION_SCHEMA.TABLES WHERE table_type = ‘base table’
ORDER BY table_nameSELECT CASE ORDINAL_POSITION WHEN 1 THEN TABLE_NAME ELSE ” END TableName,
ORDINAL_POSITION 序,COLUMN_NAME ColumnName,
CASE EXTRA WHEN ‘AUTO_INCREMENT’ THEN ‘Y’ ELSE ” END IsIdentity,
case COLUMN_Key when ‘PRI’ then ‘Y’ else ” END PrimaryKey,
DATA_TYPE DataType,
CASE DATA_TYPE
WHEN ‘double’ THEN NUMERIC_PRECISION
WHEN ‘decimal’ THEN NUMERIC_PRECISION
WHEN ‘tinyint’ THEN NUMERIC_PRECISION
WHEN ‘int’ THEN NUMERIC_PRECISION
WHEN ‘bigint’ THEN NUMERIC_PRECISION
ELSE CASE WHEN CHARACTER_MAXIMUM_LENGTH IS NULL THEN 0 ELSE CHARACTER_MAXIMUM_LENGTH END
END ByteLength,
CASE DATA_TYPE
WHEN ‘double’ THEN NUMERIC_PRECISION
WHEN ‘decimal’ THEN NUMERIC_PRECISION
WHEN ‘tinyint’ THEN NUMERIC_PRECISION
WHEN ‘int’ THEN NUMERIC_PRECISION
WHEN ‘bigint’ THEN NUMERIC_PRECISION
ELSE CASE WHEN CHARACTER_MAXIMUM_LENGTH IS NULL THEN 0 ELSE CHARACTER_MAXIMUM_LENGTH END
END Length,
IFNULL(numeric_scale,”) IsNumeric,
CASE is_nullable WHEN ‘YES’ THEN ‘Y’ ELSE ” END AllowNull,
column_default DefaultValue,
COLUMN_COMMENT Description
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = ‘tableName ‘
3、增加DTcms4/5 MySql版DAL生成
生成到新目录:DTcms.DAL.MySql,2个模板,同时支持DTcms4和DTcms5两个版本。
4、发布V20181001国庆版
5、下一步计划整理在线版的帮助文档
图文和视频汇总在一起,并增加开发实例视频教程