예제 #1
0
        public static void CreateObject(this IAlterProcessor proc, IAbstractObjectStructure obj)
        {
            var tbl = obj as ITableStructure;

            if (tbl != null)
            {
                proc.CreateTable(tbl);
                return;
            }
            var col = obj as IColumnStructure;

            if (col != null)
            {
                proc.CreateColumn(col);
                return;
            }
            var cnt = obj as IConstraint;

            if (cnt != null)
            {
                proc.CreateConstraint(cnt);
                return;
            }
            var spe = obj as ISpecificObjectStructure;

            if (spe != null)
            {
                proc.CreateSpecificObject(spe);
                return;
            }
            var sch = obj as ISchemaStructure;

            if (sch != null)
            {
                proc.CreateSchema(sch);
                return;
            }
            var dom = obj as IDomainStructure;

            if (dom != null)
            {
                proc.CreateDomain(dom);
                return;
            }
        }
        public static void CreateObject(this IAlterProcessor proc, DatabaseObjectInfo obj)
        {
            var tbl = obj as TableInfo;

            if (tbl != null)
            {
                proc.CreateTable(tbl);
                return;
            }
            var col = obj as ColumnInfo;

            if (col != null)
            {
                proc.CreateColumn(col);
                return;
            }
            var cnt = obj as ConstraintInfo;

            if (cnt != null)
            {
                proc.CreateConstraint(cnt);
                return;
            }
            var spe = obj as SpecificObjectInfo;

            if (spe != null)
            {
                proc.CreateSpecificObject(spe);
                return;
            }
            //var sch = obj as ISchemaStructure;
            //if (sch != null)
            //{
            //    proc.CreateSchema(sch);
            //    return;
            //}
            //var dom = obj as IDomainStructure;
            //if (dom != null)
            //{
            //    proc.CreateDomain(dom);
            //    return;
            //}
        }
 public static void CreateColumn(this IAlterProcessor proc, ColumnInfo col)
 {
     proc.CreateColumn(col, null);
 }
예제 #4
0
 public override void Run(IAlterProcessor proc, DbDiffOptions opts)
 {
     proc.CreateColumn((ColumnInfo)GetPossibleTableObject(NewObject), AdditionalConstraints);
 }
예제 #5
0
 public static void CreateColumn(this IAlterProcessor proc, IColumnStructure col)
 {
     proc.CreateColumn(col, null);
 }
예제 #6
0
파일: AlterOps.cs 프로젝트: dbshell/dbshell
 public override void Run(IAlterProcessor proc, DbDiffOptions opts)
 {
     proc.CreateColumn((ColumnInfo)GetPossibleTableObject(NewObject), AdditionalConstraints);
 }