Example #1
0
 public override bool IsDuplicateOf(AlterOperation alterOperation)
 {
     if (alterOperation is AlterOperation_Drop drop && drop.OldObject == OldObject)
     {
         return(true);
     }
     return(false);
 }
Example #2
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     foreach (var op in ((AlterOperation_RecreateTable)src).AlterTableOps)
     {
         AlterTableOps.Add(op.CloneForStructure(null));
     }
 }
Example #3
0
        public static int OrderGroupCompare(AlterOperation a, AlterOperation b)
        {
            int res = a.OrderGroup - b.OrderGroup;

            if (res != 0)
            {
                return(res);
            }
            return(a.m_tmpOrder - b.m_tmpOrder);
        }
Example #4
0
        public void InsertOp(AlterOperation op)
        {
            var rop = op as AlterOperation_RecreateTable;

            if (rop != null)
            {
                AlterTableOps.InsertRange(0, rop.AlterTableOps);
            }
            else
            {
                AlterTableOps.Insert(0, op);
            }
        }
Example #5
0
        private void AddOperation(AlterOperation op, PlanPosition position = PlanPosition.End)
        {
            switch (position)
            {
            case PlanPosition.Begin:
                Operations.Insert(0, op);
                break;

            case PlanPosition.End:
                Operations.Add(op);
                break;
            }
        }
Example #6
0
        public void AppendOp(AlterOperation op)
        {
            var rop = op as AlterOperation_RecreateTable;

            if (rop != null)
            {
                AlterTableOps.AddRange(rop.AlterTableOps);
            }
            else
            {
                AlterTableOps.Add(op);
            }
        }
Example #7
0
        public override bool AbsorbOperation(AlterProcessorCaps caps, AlterOperation op)
        {
            var cop = op as AlterOperation_Create;

            if (cop != null)
            {
                var pk = cop.NewObject as PrimaryKeyInfo;
                if (pk != null && pk.Columns.Count == 1 && pk.Columns[0].Name == ((ColumnInfo)NewObject).Name)
                {
                    pk = pk.ClonePrimaryKey();
                    pk.SetDummyTable(ParentTable.FullName);
                    AdditionalConstraints.Add(pk);
                    return(true);
                }
            }
            return(base.AbsorbOperation(caps, op));
        }
Example #8
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeDatabaseOptions)src).Options;
     DbName  = ((AlterOperation_ChangeDatabaseOptions)src).DbName;
 }
Example #9
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Script = ((AlterOperation_UpdateData)src).Script;
 }
Example #10
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     AdditionalConstraints.AddRange(((AlterOperation_ChangeColumn)src).AdditionalConstraints);
 }
Example #11
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Change)src).OldObject;
     NewObject = ((AlterOperation_Change)src).NewObject;
 }
Example #12
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewObject = ((AlterOperation_Create)src).NewObject;
 }
Example #13
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Drop)src).OldObject;
 }
Example #14
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeTableOptions)src).Options;
 }
Example #15
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Script = ((AlterOperation_UpdateData)src).Script;
 }
Example #16
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewColumnOrder = new List<string>(((AlterOperation_PermuteColumns)src).NewColumnOrder);
 }
Example #17
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     AdditionalConstraints.AddRange(((AlterOperation_ChangeColumn)src).AdditionalConstraints);
 }
Example #18
0
 public override bool AbsorbOperation(AlterProcessorCaps caps, AlterOperation op)
 {
     var cop = op as AlterOperation_Create;
     if (cop != null)
     {
         var pk = cop.NewObject as PrimaryKeyInfo;
         if (pk != null && pk.Columns.Count == 1 && pk.Columns[0].Name == ((ColumnInfo)NewObject).Name)
         {
             pk = pk.ClonePrimaryKey();
             pk.SetDummyTable(ParentTable.FullName);
             AdditionalConstraints.Add(pk);
             return true;
         }
     }
     return base.AbsorbOperation(caps, op);
 }
Example #19
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Change)src).OldObject;
     NewObject = ((AlterOperation_Change)src).NewObject;
 }
Example #20
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Rename)src).OldObject;
     NewName = ((AlterOperation_Rename)src).NewName;
 }
Example #21
0
 public virtual bool IsDuplicateOf(AlterOperation alterOperation)
 {
     return(false);
 }
Example #22
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeDatabaseOptions)src).Options;
     DbName = ((AlterOperation_ChangeDatabaseOptions)src).DbName;
 }
Example #23
0
 public virtual bool AbsorbOperation(AlterProcessorCaps caps, AlterOperation op) { return false; }
Example #24
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     foreach (var op in ((AlterOperation_RecreateTable)src).AlterTableOps)
     {
         AlterTableOps.Add(op.CloneForStructure(null));
     }
 }
Example #25
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Rename)src).OldObject;
     NewName   = ((AlterOperation_Rename)src).NewName;
 }
Example #26
0
 public void AppendOp(AlterOperation op)
 {
     var rop = op as AlterOperation_RecreateTable;
     if (rop != null) AlterTableOps.AddRange(rop.AlterTableOps);
     else AlterTableOps.Add(op);
 }
Example #27
0
 public void InsertOp(AlterOperation op)
 {
     var rop = op as AlterOperation_RecreateTable;
     if (rop != null) AlterTableOps.InsertRange(0, rop.AlterTableOps);
     else AlterTableOps.Insert(0, op);
 }
Example #28
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Data = ((AlterOperation_CreateTable)src).Data;
 }
Example #29
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewColumnOrder = new List <string>(((AlterOperation_PermuteColumns)src).NewColumnOrder);
 }
Example #30
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Data = ((AlterOperation_CreateTable)src).Data;
 }
Example #31
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeTableOptions)src).Options;
 }
Example #32
0
 private void AddOperation(AlterOperation op, PlanPosition position = PlanPosition.End)
 {
     switch (position)
     {
         case PlanPosition.Begin:
             Operations.Insert(0, op);
             break;
         case PlanPosition.End:
             Operations.Add(op);
             break;
     }
 }
Example #33
0
 public virtual void AssignFrom(AlterOperation src)
 {
     ParentTable = src.ParentTable;
 }
Example #34
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Drop)src).OldObject;
 }
Example #35
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Query = ((AlterOperation_CustomAction)src).Query;
     Order = ((AlterOperation_CustomAction)src).Order;
 }
Example #36
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewObject = ((AlterOperation_Create)src).NewObject;
 }
Example #37
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Query = ((AlterOperation_CustomAction)src).Query;
     Order = ((AlterOperation_CustomAction)src).Order;
 }
Example #38
0
 public virtual void AssignFrom(AlterOperation src)
 {
     ParentTable = src.ParentTable;
 }
Example #39
0
 public static int OrderGroupCompare(AlterOperation a, AlterOperation b)
 {
     int res = a.OrderGroup - b.OrderGroup;
     if (res != 0) return res;
     return a.m_tmpOrder - b.m_tmpOrder;
 }
Example #40
0
 public virtual bool AbsorbOperation(AlterProcessorCaps caps, AlterOperation op)
 {
     return(false);
 }