コード例 #1
0
        public static void ChangeObject(this IDatabaseSource conn, IAbstractObjectStructure oldObj, Action <AbstractObjectStructure> changeFunc)
        {
            DatabaseStructure oldDb = new DatabaseStructure();

            oldDb.AddObject(oldObj, true);
            DatabaseStructure       newDb  = new DatabaseStructure(oldDb);
            AbstractObjectStructure newObj = (AbstractObjectStructure)newDb.FindByGroupId(oldObj);

            changeFunc(newObj);
            conn.AlterDatabase(oldDb, newDb, DbDiffOptions.AlterStructureOptions());
        }
コード例 #2
0
 protected AbstractObjectStructure GetPossibleTableObject(AbstractObjectStructure newObject)
 {
     if (ParentTable != null)
     {
         AbstractObjectStructure res = newObject.CloneObject();
         ((TableObjectStructure)res).SetDummyTable(ParentTable.FullName);
         return(res);
     }
     else
     {
         return(newObject);
     }
 }
コード例 #3
0
        public void RecreateObject_Create(AbstractObjectStructure recreated, AbstractObjectStructure newobj)
        {
            var cnt = newobj as IConstraint;

            if (cnt != null)
            {
                CreateConstraint(((IConstraint)recreated).Table, cnt, PlanPosition.End);
            }
            var spec = newobj as ISpecificObjectStructure;

            if (spec != null)
            {
                CreateSpecificObject(spec, PlanPosition.End);
            }
        }
コード例 #4
0
        public void RecreateObject_Drop(AbstractObjectStructure obj)
        {
            var cnt = obj as IConstraint;

            if (cnt != null)
            {
                DropConstraint(cnt, PlanPosition.Begin);
            }
            var spec = obj as ISpecificObjectStructure;

            if (spec != null)
            {
                DropSpecificObject(spec, PlanPosition.Begin);
            }
        }
コード例 #5
0
        // this structure is incrementally loaded, when needed
        //int m_fixedOrderCounter = 0;

        public void RecreateObject(AbstractObjectStructure recreatedObject, AbstractObjectStructure newVersion)
        {
            foreach (var it in RecreatedItems)
            {
                if (it.RecreatedObject == recreatedObject)
                {
                    if (it.NewVersion != null && newVersion != null)
                    {
                        throw new InternalError("DAE-00033 Two new versions of object " + recreatedObject.ToString());
                    }
                    it.NewVersion = newVersion ?? it.NewVersion;
                    return;
                }
            }
            RecreatedItems.Add(new RecreatedItem {
                RecreatedObject = recreatedObject, NewVersion = newVersion
            });
        }
コード例 #6
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Change)src).OldObject;
     NewObject = ((AlterOperation_Change)src).NewObject;
 }
コード例 #7
0
 public override void ChangeStructure(DatabaseStructure s)
 {
     base.ChangeStructure(s);
     OldObject = s.FindByGroupId(OldObject.GroupId) as AbstractObjectStructure;
 }
コード例 #8
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Rename)src).OldObject;
     NewName   = ((AlterOperation_Rename)src).NewName;
 }
コード例 #9
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     NewObject = ((AlterOperation_Create)src).NewObject;
 }
コード例 #10
0
 public override void AssignFrom(AlterOperation src)
 {
     base.AssignFrom(src);
     OldObject = ((AlterOperation_Drop)src).OldObject;
 }
コード例 #11
0
 public static void MySet(this AbstractObjectStructure obj, string name, string value)
 {
     obj.SpecificData["mysql." + name] = value;
 }