public void CallChangedAction(DbDiffAction action) { if (ChangedAction != null) { ChangedAction(action); } }
public DatabaseDiff(DatabaseInfo src, DatabaseInfo dst, DbDiffOptions options, IDatabaseFactory factory) { _factory = factory; _src = src.CloneDatabase(); _dst = dst.CloneDatabase(); _actions = new DbDiffAction(this); //m_actions = new DiffActionDatabase(this, m_src, m_dst); _options = options; RebuildGroupIdDictionary(); if (_src.GroupId != _dst.GroupId) CreatePairing(); CreateActions(); }
public DatabaseDiff(DatabaseInfo src, DatabaseInfo dst, DbDiffOptions options, IDatabaseFactory factory) { _factory = factory; _src = src.CloneDatabase(); _dst = dst.CloneDatabase(); _actions = new DbDiffAction(this); //m_actions = new DiffActionDatabase(this, m_src, m_dst); _options = options; RebuildGroupIdDictionary(); if (_src.GroupId != _dst.GroupId) { CreatePairing(); } CreateActions(); }
private void CreateActions() { _plan = new AlterPlan(_dst); DbDiffTool.AlterDatabase(Plan, new DbObjectPairing(_dst, _src), _options); DbDiffAction lastAlterTable = null; foreach (var op in _plan.Operations) { DbDiffAction act; if (op.ParentTable != null) { // this operation should be added to ALTER TABLE operation if (lastAlterTable == null || lastAlterTable.ParentTable != op.ParentTable) { lastAlterTable = new DbDiffAction(this); lastAlterTable.ParentTable = op.ParentTable; lastAlterTable.AfterCreate(); _actions.Elements.Add(lastAlterTable); } act = new DbDiffAction(this); act.Operation = op; //act.IsChecked = true; act.AfterCreate(); lastAlterTable.Elements.Add(act); } else { act = new DbDiffAction(this); act.Operation = op; lastAlterTable = null; act.AfterCreate(); _actions.Elements.Add(act); } } //this.AlterDatabase(m_dst, m_src, m_options); }
public void CallChangedAction(DbDiffAction action) { if (ChangedAction != null) ChangedAction(action); }