コード例 #1
0
 public void CallChangedAction(DbDiffAction action)
 {
     if (ChangedAction != null)
     {
         ChangedAction(action);
     }
 }
コード例 #2
0
ファイル: DatabaseDiff.cs プロジェクト: dbshell/dbshell
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: DatabaseDiff.cs プロジェクト: dbshell/dbshell
 public void CallChangedAction(DbDiffAction action)
 {
     if (ChangedAction != null) ChangedAction(action);
 }