mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
UPDATE DbMaintenance
This commit is contained in:
@@ -50,6 +50,25 @@ namespace SqlSugar
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
public bool IsAnyTable(string tableName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public bool IsAnyColumn(string tableName,string column)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public bool IsPrimaryKey(string tableName, string column)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public bool IsIdentity(string tableName, string column)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DDL
|
||||
public bool AddColumnToTable(string tableName, DbColumnInfo column)
|
||||
{
|
||||
@@ -71,7 +90,7 @@ namespace SqlSugar
|
||||
public bool BackupDataBase()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
|
@@ -19,8 +19,10 @@ namespace SqlSugar
|
||||
|
||||
#region DDL
|
||||
protected abstract string AddColumnToTableSql { get; }
|
||||
protected abstract string AlterColumnToTableSql { get; }
|
||||
protected abstract string BackupDataBaseSql { get; }
|
||||
protected abstract string CreateTableSql { get; }
|
||||
protected abstract string CreateTableColumn { get; }
|
||||
protected abstract string BackupTableSql { get; }
|
||||
protected abstract string TruncateTableSql { get; }
|
||||
#endregion
|
||||
|
@@ -8,6 +8,7 @@ namespace SqlSugar
|
||||
{
|
||||
SqlSugarClient Context { get; set; }
|
||||
|
||||
#region DML
|
||||
List<DbTableInfo> GetViewInfoList();
|
||||
|
||||
List<DbTableInfo> GetTableInfoList();
|
||||
@@ -17,7 +18,16 @@ namespace SqlSugar
|
||||
List<string> GetIsIdentities(string tableName);
|
||||
|
||||
List<string> GetPrimaries(string tableName);
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
bool IsAnyTable(string tableName);
|
||||
bool IsAnyColumn(string tableName, string column);
|
||||
bool IsPrimaryKey(string tableName, string column);
|
||||
bool IsIdentity(string tableName, string column);
|
||||
#endregion
|
||||
|
||||
#region DDL
|
||||
bool TruncateTable(string tableName);
|
||||
|
||||
bool CreateTable(string tableName, List<DbColumnInfo> columns);
|
||||
@@ -25,5 +35,6 @@ namespace SqlSugar
|
||||
bool AddColumnToTable(string tableName, DbColumnInfo column);
|
||||
|
||||
bool BackupDataBase();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -82,6 +82,13 @@ namespace SqlSugar
|
||||
return "ALERT TABLE {0} ADD {1} {2} {3}";
|
||||
}
|
||||
}
|
||||
protected override string AlterColumnToTableSql {
|
||||
get
|
||||
{
|
||||
return "ALERT TABLE {0} ALTER COLUMN {1}{2} {3} ";
|
||||
}
|
||||
}
|
||||
|
||||
protected override string BackupDataBaseSql
|
||||
{
|
||||
get
|
||||
@@ -93,8 +100,14 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return @"CREATE TABLE {0}
|
||||
{1}";
|
||||
return "CREATE TABLE {0}(\r\n{1})";
|
||||
}
|
||||
}
|
||||
protected override string CreateTableColumn
|
||||
{
|
||||
get
|
||||
{
|
||||
return @"{0} {1}{2} {3}{4}\r\n";
|
||||
}
|
||||
}
|
||||
protected override string TruncateTableSql
|
||||
|
Reference in New Issue
Block a user