Exemplo n.º 1
0
 public override bool IsDuplicateOf(AlterOperation alterOperation)
 {
     if (alterOperation is AlterOperation_Drop drop && drop.OldObject == OldObject)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     foreach (var op in ((AlterOperation_RecreateTable)src).AlterTableOps)
     {
         AlterTableOps.Add(op.CloneForStructure(null));
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 6
0
        public void AppendOp(AlterOperation op)
        {
            var rop = op as AlterOperation_RecreateTable;

            if (rop != null)
            {
                AlterTableOps.AddRange(rop.AlterTableOps);
            }
            else
            {
                AlterTableOps.Add(op);
            }
        }
Exemplo n.º 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));
        }
Exemplo n.º 8
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeDatabaseOptions)src).Options;
     DbName  = ((AlterOperation_ChangeDatabaseOptions)src).DbName;
 }
Exemplo n.º 9
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Script = ((AlterOperation_UpdateData)src).Script;
 }
Exemplo n.º 10
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     AdditionalConstraints.AddRange(((AlterOperation_ChangeColumn)src).AdditionalConstraints);
 }
Exemplo n.º 11
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Change)src).OldObject;
     NewObject = ((AlterOperation_Change)src).NewObject;
 }
Exemplo n.º 12
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewObject = ((AlterOperation_Create)src).NewObject;
 }
Exemplo n.º 13
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Drop)src).OldObject;
 }
Exemplo n.º 14
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeTableOptions)src).Options;
 }
Exemplo n.º 15
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Script = ((AlterOperation_UpdateData)src).Script;
 }
Exemplo n.º 16
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewColumnOrder = new List<string>(((AlterOperation_PermuteColumns)src).NewColumnOrder);
 }
Exemplo n.º 17
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     AdditionalConstraints.AddRange(((AlterOperation_ChangeColumn)src).AdditionalConstraints);
 }
Exemplo n.º 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);
 }
Exemplo n.º 19
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Change)src).OldObject;
     NewObject = ((AlterOperation_Change)src).NewObject;
 }
Exemplo n.º 20
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Rename)src).OldObject;
     NewName = ((AlterOperation_Rename)src).NewName;
 }
Exemplo n.º 21
0
 public virtual bool IsDuplicateOf(AlterOperation alterOperation)
 {
     return(false);
 }
Exemplo n.º 22
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeDatabaseOptions)src).Options;
     DbName = ((AlterOperation_ChangeDatabaseOptions)src).DbName;
 }
Exemplo n.º 23
0
 public virtual bool AbsorbOperation(AlterProcessorCaps caps, AlterOperation op) { return false; }
Exemplo n.º 24
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     foreach (var op in ((AlterOperation_RecreateTable)src).AlterTableOps)
     {
         AlterTableOps.Add(op.CloneForStructure(null));
     }
 }
Exemplo n.º 25
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Rename)src).OldObject;
     NewName   = ((AlterOperation_Rename)src).NewName;
 }
Exemplo n.º 26
0
 public void AppendOp(AlterOperation op)
 {
     var rop = op as AlterOperation_RecreateTable;
     if (rop != null) AlterTableOps.AddRange(rop.AlterTableOps);
     else AlterTableOps.Add(op);
 }
Exemplo n.º 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);
 }
Exemplo n.º 28
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Data = ((AlterOperation_CreateTable)src).Data;
 }
Exemplo n.º 29
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewColumnOrder = new List <string>(((AlterOperation_PermuteColumns)src).NewColumnOrder);
 }
Exemplo n.º 30
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Data = ((AlterOperation_CreateTable)src).Data;
 }
Exemplo n.º 31
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Options = ((AlterOperation_ChangeTableOptions)src).Options;
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 33
0
 public virtual void AssignFrom(AlterOperation src)
 {
     ParentTable = src.ParentTable;
 }
Exemplo n.º 34
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Drop)src).OldObject;
 }
Exemplo n.º 35
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Query = ((AlterOperation_CustomAction)src).Query;
     Order = ((AlterOperation_CustomAction)src).Order;
 }
Exemplo n.º 36
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewObject = ((AlterOperation_Create)src).NewObject;
 }
Exemplo n.º 37
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     Query = ((AlterOperation_CustomAction)src).Query;
     Order = ((AlterOperation_CustomAction)src).Order;
 }
Exemplo n.º 38
0
 public virtual void AssignFrom(AlterOperation src)
 {
     ParentTable = src.ParentTable;
 }
Exemplo n.º 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;
 }
Exemplo n.º 40
0
 public virtual bool AbsorbOperation(AlterProcessorCaps caps, AlterOperation op)
 {
     return(false);
 }