public static void ChangeObject(this IAlterProcessor proc, DatabaseObjectInfo obj, DatabaseObjectInfo newObj) { var tbl = obj as TableInfo; if (tbl != null) { throw new AlterNotPossibleError(); } var col = obj as ColumnInfo; if (col != null) { proc.ChangeColumn(col, (ColumnInfo) newObj); return; } //var cnt = obj as ConstraintInfo; //if (cnt != null) //{ // proc.ChangeConstraint(cnt, (IConstraint) newObj); // return; //} //var spe = obj as ISpecificObjectStructure; //if (spe != null) //{ // proc.ChangeSpecificObject(spe, (ISpecificObjectStructure) newObj); // return; //} //var sch = obj as ISchemaStructure; //if (sch != null) //{ // proc.ChangeSchema(sch, (ISchemaStructure) newObj); // return; //} //var dom = obj as IDomainStructure; //if (dom != null) //{ // proc.ChangeDomain(dom, (IDomainStructure) newObj); // return; //} }
public static void ChangeColumn(this IAlterProcessor proc, ColumnInfo oldcol, ColumnInfo newcol) { proc.ChangeColumn(oldcol, newcol, null); }