Exemple #1
0
        public static void DropObject(this IDatabaseSource conn, IAbstractObjectStructure obj)
        {
            DatabaseStructure oldDb = new DatabaseStructure();

            oldDb.AddObject(obj, true);
            DatabaseStructure newDb = new DatabaseStructure(oldDb);

            newDb.DropObject(obj);
            conn.AlterDatabase(oldDb, newDb, DbDiffOptions.AlterStructureOptions());
        }
Exemple #2
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());
        }