mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
Code synchronization .NET
This commit is contained in:
@@ -184,6 +184,15 @@ namespace SqlSugar
|
|||||||
this.Context.Ado.ExecuteCommand(sql);
|
this.Context.Ado.ExecuteCommand(sql);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public bool AddPrimaryKeys(string tableName, string[] columnNames,string pkName)
|
||||||
|
{
|
||||||
|
tableName = this.SqlBuilder.GetTranslationTableName(tableName);
|
||||||
|
var columnName = string.Join(",", columnNames);
|
||||||
|
//var pkName = string.Format("PK_{0}_{1}", this.SqlBuilder.GetNoTranslationColumnName(tableName), columnName.Replace(",", "_"));
|
||||||
|
string sql = string.Format(this.AddPrimaryKeySql, tableName, pkName, columnName);
|
||||||
|
this.Context.Ado.ExecuteCommand(sql);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
public virtual bool AddColumn(string tableName, DbColumnInfo columnInfo)
|
public virtual bool AddColumn(string tableName, DbColumnInfo columnInfo)
|
||||||
{
|
{
|
||||||
tableName = this.SqlBuilder.GetTranslationTableName(tableName);
|
tableName = this.SqlBuilder.GetTranslationTableName(tableName);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace SqlSugar
|
|||||||
bool UpdateColumn(string tableName, DbColumnInfo column);
|
bool UpdateColumn(string tableName, DbColumnInfo column);
|
||||||
bool AddPrimaryKey(string tableName,string columnName);
|
bool AddPrimaryKey(string tableName,string columnName);
|
||||||
bool AddPrimaryKeys(string tableName, string [] columnNames);
|
bool AddPrimaryKeys(string tableName, string [] columnNames);
|
||||||
|
bool AddPrimaryKeys(string tableName, string[] columnNames,string pkName);
|
||||||
bool DropConstraint(string tableName, string constraintName);
|
bool DropConstraint(string tableName, string constraintName);
|
||||||
bool BackupDataBase(string databaseName,string fullFileName);
|
bool BackupDataBase(string databaseName,string fullFileName);
|
||||||
bool BackupTable(string oldTableName, string newTableName, int maxBackupDataRows = int.MaxValue);
|
bool BackupTable(string oldTableName, string newTableName, int maxBackupDataRows = int.MaxValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user