果糖网
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
1 deletions
-
Src/Asp.NetCore2/MySqlTest/Models/Order.cs
-
Src/Asp.NetCore2/SqlSugar/Realization/MySql/DbMaintenance/MySqlDbMaintenance.cs
|
|
@ -11,8 +11,9 @@ namespace OrmTest |
|
|
|
{ |
|
|
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
|
|
|
public int Id { get; set; } |
|
|
|
|
|
|
|
[SugarColumn(ColumnDescription ="名称")] |
|
|
|
public string Name { get; set; } |
|
|
|
[SugarColumn(ColumnDescription = "价格")] |
|
|
|
public decimal Price { get; set; } |
|
|
|
[SugarColumn(IsNullable = true)] |
|
|
|
public DateTime CreateTime { get; set; } |
|
|
|
|
|
@ -392,6 +392,10 @@ namespace SqlSugar |
|
|
|
string primaryKey = null; |
|
|
|
string identity = item.IsIdentity ? this.CreateTableIdentity : null; |
|
|
|
string addItem = string.Format(this.CreateTableColumn, this.SqlBuilder.GetTranslationColumnName(columnName), dataType, dataSize, nullType, primaryKey, identity); |
|
|
|
if (!string.IsNullOrEmpty(item.ColumnDescription)) |
|
|
|
{ |
|
|
|
addItem += "COMMENT '"+item.ColumnDescription+"' "; |
|
|
|
} |
|
|
|
columnArray.Add(addItem); |
|
|
|
} |
|
|
|
string tableString = string.Format(this.CreateTableSql, this.SqlBuilder.GetTranslationTableName(tableName), string.Join(",\r\n", columnArray)); |
|
|
|