From 9c8ce40842ba21cac3abd4f40ec1599fa60149ff Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 9 Dec 2024 17:07:27 +0800 Subject: [PATCH] Update xugudb --- .../SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec | 2 +- .../SqlSugar.XuguCore/Xugu/CodeFirst/XuguCodeFirst.cs | 5 +++-- .../Xugu/DbMaintenance/XuguDbMaintenance.cs | 9 ++++++++- Src/Asp.NetCore2/XuGuTest/T_User2.cs | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec b/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec index e3c90968d..483c06df2 100644 --- a/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec +++ b/Src/Asp.NetCore2/SqlSugar.XuguCore/SqlSugar.OdbcCore.nuspec @@ -2,7 +2,7 @@ SqlSugar.XuguCoreNew - 5.1.4.171 + 5.1.4.172 sunkaixuan 果糖大数据 http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/CodeFirst/XuguCodeFirst.cs b/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/CodeFirst/XuguCodeFirst.cs index d544b4285..293c951b5 100644 --- a/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/CodeFirst/XuguCodeFirst.cs +++ b/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/CodeFirst/XuguCodeFirst.cs @@ -1,5 +1,5 @@ using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; namespace SqlSugar.Xugu @@ -72,11 +72,12 @@ namespace SqlSugar.Xugu protected override void ExistLogicEnd(List dbColumns) { + var dbMain = new XuguDbMaintenance() { Context = this.Context }; foreach (EntityColumnInfo column in dbColumns) { if (column.DefaultValue != null) { - this.Context.DbMaintenance.AddDefaultValue(column.DbTableName, column.DbColumnName, column.DefaultValue.ToSqlValue().TrimStart('\'').TrimEnd('\'')); + this.Context.DbMaintenance.AddDefaultValue(dbMain.SqlBuilder.GetTranslationTableName(column.DbTableName), dbMain.SqlBuilder.GetTranslationTableName(column.DbColumnName), column.DefaultValue.ToSqlValue().TrimStart('\'').TrimEnd('\'')); } } } diff --git a/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/DbMaintenance/XuguDbMaintenance.cs b/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/DbMaintenance/XuguDbMaintenance.cs index 45103c451..39fac9d6c 100644 --- a/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/DbMaintenance/XuguDbMaintenance.cs +++ b/Src/Asp.NetCore2/SqlSugar.XuguCore/Xugu/DbMaintenance/XuguDbMaintenance.cs @@ -211,7 +211,14 @@ WHERE T.TABLE_NAME='{0}' AND T.DB_ID=CURRENT_DB_ID return tableString; } - + public override bool DeleteColumnRemark(string columnName, string tableName) + { + return base.DeleteColumnRemark(this.SqlBuilder.GetTranslationColumnName(columnName), this.SqlBuilder.GetTranslationColumnName(tableName)); + } + public override bool AddColumnRemark(string columnName, string tableName, string description) + { + return base.AddColumnRemark(this.SqlBuilder.GetTranslationColumnName(columnName), this.SqlBuilder.GetTranslationColumnName(tableName), description); + } public override bool AddDefaultValue(string tableName, string columnName, string defaultValue) { if (defaultValue == "''") diff --git a/Src/Asp.NetCore2/XuGuTest/T_User2.cs b/Src/Asp.NetCore2/XuGuTest/T_User2.cs index 6146a3849..ac8ff6ea5 100644 --- a/Src/Asp.NetCore2/XuGuTest/T_User2.cs +++ b/Src/Asp.NetCore2/XuGuTest/T_User2.cs @@ -6,9 +6,10 @@ using System.Threading.Tasks; namespace Data.Model { + [SqlSugar.SugarTable("T_User222")] public class T_User2 { - [SqlSugar.SugarColumn(DefaultValue ="0",ColumnDescription ="aaa")] - public int num { get; set; } + [SqlSugar.SugarColumn(DefaultValue = "0", ColumnDescription = "aaa")] + public int number { get; set; } } }