mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
Update quest support unique index
This commit is contained in:
@@ -228,7 +228,10 @@ namespace SqlSugar
|
||||
public override bool CreateIndex(string tableName, string[] columnNames, bool isUnique = false)
|
||||
{
|
||||
if (isUnique)
|
||||
throw new Exception("no support unique index");
|
||||
{
|
||||
this.Context.Ado.ExecuteCommand($"ALTER TABLE {tableName} DEDUP ENABLE UPSERT KEYS({string.Join(",",columnNames)})");
|
||||
return true;
|
||||
}
|
||||
var columnInfos = this.Context.Ado.SqlQuery<QuestDbColumn>("SHOW COLUMNS FROM '" + tableName + "'");
|
||||
foreach (var columnInfo in columnInfos)
|
||||
{
|
||||
|
Reference in New Issue
Block a user