From 39f2bfd16adf1a6c79fbce448415bdf610ebce4e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 17 Feb 2025 10:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=A4=A7=E9=87=91=E4=BB=93[SqlServer]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs index 257cbc332..73e9e5646 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/DbMaintenance/KdbndpDbMaintenance.cs @@ -669,7 +669,7 @@ WHERE tgrelid = '" + tableName + "'::regclass"); } } } - private static void ConvertCreateColumnInfo(DbColumnInfo x) + private void ConvertCreateColumnInfo(DbColumnInfo x) { string[] array = new string[] { "int4", "text", "int2", "int8", "date", "bit", "text", "timestamp" }; @@ -678,6 +678,16 @@ WHERE tgrelid = '" + tableName + "'::regclass"); x.Length = 0; x.DecimalDigits = 0; } + + if (IsSqlServerModel()) + { + if (x.DataType=="int8") + { + x.DataType = "bigint"; + x.Length = 0; + x.Scale = 0; + } + } } private bool IsPgModel() {