fix issue Sequence contains more than one element

This commit is contained in:
yubaolee 2022-03-03 23:17:21 +08:00
parent 44fd165dec
commit f4a8e93de9
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ namespace OpenAuth.App
var jsonArray = JsonHelper.Instance.Deserialize<JObject>(form.ContentData)["list"];
// 数据库名称
string tableName = form.DbName;
var exist = _unitWork.FromSql<QueryStringObj>($"select table_name as value from information_schema.tables where table_name ='{tableName}'").SingleOrDefault();
var exist = _unitWork.FromSql<QueryStringObj>($"select distinct table_name as value from information_schema.tables where table_name ='{tableName}'").SingleOrDefault();
if (exist != null) return string.Empty;
// 创建数据表
StringBuilder sql = new StringBuilder($"create table if not exists `{tableName}` ( Id varchar(50) not null primary key,"); //主键

View File

@ -61,7 +61,7 @@ namespace OpenAuth.App
var jsonArray = JArray.Parse(form.ContentData);
// 数据库名称
string tableName = form.DbName;
var exist = _unitWork.FromSql<QueryStringObj>($"select table_name as value from information_schema.tables where table_name ='{tableName}'").SingleOrDefault();
var exist = _unitWork.FromSql<QueryStringObj>($"select distinct table_name as value from information_schema.tables where table_name ='{tableName}'").SingleOrDefault();
if (exist != null) return string.Empty;
// 创建数据表
StringBuilder sql = new StringBuilder($"create table if not exists `{tableName}` ( Id varchar(50) not null primary key,"); //主键