Exemplo n.º 1
0
        public override bool Save()
        {
            var dialect = m_conn.Dialect ?? GenericDialect.Instance;
            var plan    = new AlterPlan();
            var opts    = new DbDiffOptions();
            var log     = new CachingLogger(LogLevel.Info);

            opts.AlterLogger = log;
            DbDiffTool.AlterDatabase(plan, new DbObjectPairing(m_origDb, m_db), opts);
            string alterSql = dialect.GenerateScript(dmp => plan.CreateRunner().Run(dmp, opts));

            if (!SqlConfirmForm.Run(alterSql, dialect, log))
            {
                return(false);
            }
            m_conn.AlterDatabase(plan, opts);
            objectGridView1.Modified = false;
            UpdateState();
            LoadStructure();
            return(true);
        }
Exemplo n.º 2
0
 private string GenerateScriptForPlan(AlterPlan plan)
 {
     return(GenerateSqlScript(dmp => plan.CreateRunner().Run(dmp, new DbDiffOptions())));
 }
Exemplo n.º 3
0
 private void RunPlan(AlterPlan plan)
 {
     RunSqlScript(dmp => plan.CreateRunner().Run(dmp, new DbDiffOptions()));
 }
Exemplo n.º 4
0
 public void AlterDatabase(AlterPlan plan, DbDiffOptions opts)
 {
     Reload();
     plan.CreateRunner().Run(m_conn.DbStruct, opts);
     SaveToFile();
 }