mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Merge pull request #1043 from sy0574/githubsy/SqlSugar5-indexfix
解决mysql同一个实例下多个数据库不能创建同名索引的问题
This commit is contained in:
commit
e6621064cf
@ -393,7 +393,8 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public virtual bool IsAnyIndex(string indexName)
|
public virtual bool IsAnyIndex(string indexName)
|
||||||
{
|
{
|
||||||
string sql = string.Format(this.IsAnyIndexSql, indexName);
|
//string sql = string.Format(this.IsAnyIndexSql, indexName);
|
||||||
|
string sql = string.Format(this.IsAnyIndexSql, indexName, this.Context.Ado.Connection.Database);
|
||||||
return this.Context.Ado.GetInt(sql)>0;
|
return this.Context.Ado.GetInt(sql)>0;
|
||||||
}
|
}
|
||||||
public virtual bool AddRemark(EntityInfo entity)
|
public virtual bool AddRemark(EntityInfo entity)
|
||||||
|
@ -269,7 +269,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return "SELECT count(*) FROM information_schema.statistics WHERE index_name = '{0}'";
|
return "SELECT count(*) FROM information_schema.statistics WHERE index_name = '{0}' and index_schema = '{1}'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user