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()); }
protected AbstractObjectStructure GetPossibleTableObject(AbstractObjectStructure newObject) { if (ParentTable != null) { AbstractObjectStructure res = newObject.CloneObject(); ((TableObjectStructure)res).SetDummyTable(ParentTable.FullName); return(res); } else { return(newObject); } }
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); } }
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); } }
// 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 }); }
public override void AssignFrom(AlterOperation src) { base.AssignFrom(src); OldObject = ((AlterOperation_Change)src).OldObject; NewObject = ((AlterOperation_Change)src).NewObject; }
public override void ChangeStructure(DatabaseStructure s) { base.ChangeStructure(s); OldObject = s.FindByGroupId(OldObject.GroupId) as AbstractObjectStructure; }
public override void AssignFrom(AlterOperation src) { base.AssignFrom(src); OldObject = ((AlterOperation_Rename)src).OldObject; NewName = ((AlterOperation_Rename)src).NewName; }
public override void AssignFrom(AlterOperation src) { base.AssignFrom(src); NewObject = ((AlterOperation_Create)src).NewObject; }
public override void AssignFrom(AlterOperation src) { base.AssignFrom(src); OldObject = ((AlterOperation_Drop)src).OldObject; }
public static void MySet(this AbstractObjectStructure obj, string name, string value) { obj.SpecificData["mysql." + name] = value; }