Example #1
0
        public static void ChangeObject(this IAlterProcessor proc, IAbstractObjectStructure obj, IAbstractObjectStructure newObj)
        {
            var tbl = obj as ITableStructure;

            if (tbl != null)
            {
                throw new AlterNotPossibleError();
            }
            var col = obj as IColumnStructure;

            if (col != null)
            {
                proc.ChangeColumn(col, (IColumnStructure)newObj);
                return;
            }
            var cnt = obj as IConstraint;

            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 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);
 }
Example #4
0
 public override void Run(IAlterProcessor proc, DbDiffOptions opts)
 {
     proc.ChangeColumn((ColumnInfo)OldObject, (ColumnInfo)GetPossibleTableObject(NewObject), AdditionalConstraints);
 }
Example #5
0
 public static void ChangeColumn(this IAlterProcessor proc, IColumnStructure oldcol, IColumnStructure newcol)
 {
     proc.ChangeColumn(oldcol, newcol, null);
 }
Example #6
0
 public override void Run(IAlterProcessor proc, DbDiffOptions opts)
 {
     proc.ChangeColumn((ColumnInfo)OldObject, (ColumnInfo)GetPossibleTableObject(NewObject), AdditionalConstraints);
 }