mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 01:47:06 +08:00
Synchronization code
This commit is contained in:
parent
5eeb85deb8
commit
25285367de
@ -598,6 +598,10 @@ namespace SqlSugar
|
||||
this.Context.Ado.ExecuteCommand(sql);
|
||||
return true;
|
||||
}
|
||||
public virtual bool IsAnyProcedure(string procName) {
|
||||
string sql = string.Format(this.IsAnyProcedureSql, procName);
|
||||
return this.Context.Ado.GetInt(sql)>0;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
|
@ -55,6 +55,7 @@ namespace SqlSugar
|
||||
protected abstract string DeleteTableRemarkSql { get; }
|
||||
protected abstract string IsAnyTableRemarkSql { get; }
|
||||
protected abstract string RenameTableSql { get; }
|
||||
protected virtual string IsAnyProcedureSql { get; }
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
|
@ -218,6 +218,7 @@ namespace SqlSugar
|
||||
return "alter table {0} rename to {1}";
|
||||
}
|
||||
}
|
||||
protected override string IsAnyProcedureSql => throw new NotImplementedException();
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
|
@ -153,6 +153,13 @@ namespace SqlSugar
|
||||
return "alter table {0} change column {1} {2}";
|
||||
}
|
||||
}
|
||||
protected override string IsAnyProcedureSql
|
||||
{
|
||||
get
|
||||
{
|
||||
return "select count(*) from information_schema.Routines where ROUTINE_NAME='{0}' and ROUTINE_TYPE='PROCEDURE'";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
|
@ -221,6 +221,13 @@ namespace SqlSugar
|
||||
return "alter table {0} rename to {1}";
|
||||
}
|
||||
}
|
||||
protected override string IsAnyProcedureSql
|
||||
{
|
||||
get
|
||||
{
|
||||
return "SELECT COUNT(*) FROM user_objects WHERE OBJECT_TYPE = 'PROCEDURE' AND OBJECT_NAME ='{0}'";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
|
@ -204,7 +204,7 @@ namespace SqlSugar
|
||||
return " SELECT count(1) WHERE upper('{0}') IN ( SELECT upper(indexname) FROM pg_indexes )";
|
||||
}
|
||||
}
|
||||
|
||||
protected override string IsAnyProcedureSql => throw new NotImplementedException();
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
|
@ -269,6 +269,13 @@ namespace SqlSugar
|
||||
return "select count(*) from sys.indexes where name='{0}'";
|
||||
}
|
||||
}
|
||||
protected override string IsAnyProcedureSql
|
||||
{
|
||||
get
|
||||
{
|
||||
return "select count(*) from sys.objects where [object_id] = OBJECT_ID(N'sp_GetSubLedgerJoinWithdrawalApplicationRecords') and [type] in (N'P')";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
@ -563,7 +570,7 @@ namespace SqlSugar
|
||||
string sql = string.Format(this.RenameColumnSql, tableName, oldColumnName, newColumnName);
|
||||
this.Context.Ado.ExecuteCommand(sql);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user