internal override void Tran(KeyWordInfomation info) { AlterTableCondition con = info.Condition as AlterTableCondition; if (con == null) { return; } IDBAdapter ida = info.DBInfo.CurrentDbAdapter; con.Operator.Append("ADD CONSTRAINT "); con.SqlParams.Append(ida.FormatTableName(_name)); con.SqlParams.Append(" PRIMARY KEY ("); foreach (string prm in _pkParams) { con.SqlParams.Append(ida.FormatParam(prm) + ","); } if (con.SqlParams[con.SqlParams.Length - 1] == ',') { con.SqlParams.Remove(con.SqlParams.Length - 1, 1); } con.SqlParams.Append(")"); }
internal override void Tran(KeyWordInfomation info) { AlterTableCondition con = info.Condition as AlterTableCondition; if (con == null) { return; } string sName = null; string tName = null; string tTable = null; if (_item.SourceProperty != null && _item.TargetProperty != null) { sName = _item.SourceProperty.ParamName; tName = _item.TargetProperty.ParamName; tTable = _item.TargetProperty.BelongInfo.TableName; } else { sName = _item.SourceName; tName = _item.TargetName; tTable = _item.TargetTable; } IDBAdapter ida = info.DBInfo.CurrentDbAdapter; con.Operator.Append("add constraint "); con.SqlParams.Append(_item.Name); con.SqlParams.Append(" foreign key (" + ida.FormatParam(sName) + ") "); con.SqlParams.Append("references "); con.SqlParams.Append(ida.FormatTableName(tTable) + "(" + ida.FormatParam(tName) + ")"); }
internal override void Tran(KeyWordInfomation info) { StringBuilder sb = new StringBuilder(); sb.Append(_param.DisplayInfo(info, TableName)); AlterTableCondition con = info.Condition as AlterTableCondition; if (con != null) { con.Operator.Append(info.DBInfo.DBStructure.GetAddParamSQL()); } info.Condition.SqlParams.Append(sb.ToString()); }