mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
ClickHouse Add Column
This commit is contained in:
parent
69db2bda2b
commit
83f6d88fa9
@ -65,7 +65,7 @@ namespace SqlSugar.ClickHouse
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return "ALTER TABLE {0} ADD COLUMN {1} {2}{3} {4} {5} {6}";
|
return "ALTER TABLE {0} ADD COLUMN {1} {2} ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected override string AlterColumnToTableSql
|
protected override string AlterColumnToTableSql
|
||||||
@ -218,6 +218,17 @@ namespace SqlSugar.ClickHouse
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
public override bool AddColumn(string tableName, DbColumnInfo columnInfo)
|
||||||
|
{
|
||||||
|
if (columnInfo.IsNullable)
|
||||||
|
{
|
||||||
|
if (!columnInfo.DataType.ObjToString().ToLower().Contains("nullable"))
|
||||||
|
{
|
||||||
|
columnInfo.DataType = $"Nullable({columnInfo.DataType})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return base.AddColumn(tableName, columnInfo);
|
||||||
|
}
|
||||||
public override bool AddPrimaryKey(string tableName, string columnName)
|
public override bool AddPrimaryKey(string tableName, string columnName)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user