private static List <IMigration> Compare(SqlEngineVersion version, DatabaseDefinitions dds)
        {
            var comparer = new Comparer(GetContext(version));
            var changes  = comparer.Compare(dds.Original, dds.New);

            return(changes);
        }
Exemplo n.º 2
0
 private void FBXpertMainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     FormOnClosing = true;
     //CopyrightForm.Instance().Close();
     //DbExplorerForm.Instance().Close();
     DatabaseDefinitions.Instance().SerializeCurrent("Definition data changed");
     LanguageClass.Instance().OnRaiseLanguageChangedHandler -= FBXpertMainForm_OnRaiseLanguageChangedHandler;
     Application.Exit();
 }
Exemplo n.º 3
0
 private void GetDatabases()
 {
     cbConnection.Items.Clear();
     foreach (var dbr in DatabaseDefinitions.Instance().Databases)
     {
         cbConnection.Items.Add(dbr);
     }
     if (FbXpertMainForm.Instance().ActRegistrationObject != null)
     {
         int n = cbConnection.FindString(FbXpertMainForm.Instance().ActRegistrationObject.ToString());
         cbConnection.SelectedIndex = n;
     }
 }
Exemplo n.º 4
0
        private void GetAllDatabases()
        {
            this.Cursor = Cursors.WaitCursor;
            var databases = DatabaseDefinitions.Instance().Databases;

            slbDatabase1.ClearItems();
            slbDatabase2.ClearItems();
            foreach (var dbReg in databases)
            {
                slbDatabase1.Add(dbReg.Alias, CheckState.Checked, dbReg);
                slbDatabase2.Add(dbReg.Alias, CheckState.Checked, dbReg);
            }

            if (slbDatabase1.ItemDatas.Count > 0)
            {
                slbDatabase1.SelectedIndex = 0;
            }
            if (slbDatabase2.ItemDatas.Count > 0)
            {
                slbDatabase2.SelectedIndex = 0;
            }
            this.Cursor = Cursors.Default;
        }
        private static void Document(SqlEngineVersion version, DatabaseDefinitions dds)
        {
            var changeDocumenter = new ChangeDocumenter(DataDefinitionDocumenterTestsHelper.CreateTestChangeContext(version), version, dds.DbNameOriginal, dds.DbNameNew);

            changeDocumenter.Document(dds.Original, dds.New);
        }
        private static DatabaseMigrator ProcessAndGetMigrator(SqlEngineVersion version, DatabaseDefinitions dds, out List <IMigration> changes)
        {
            Init(version, dds.Original);

            var ddlReader    = DataDefinitionReaderFactory.CreateDataDefinitionReader(SqlExecuterTestAdapter.ConnectionStrings[version.UniqueName], SqlExecuterTestAdapter.GetContext(version), dds.Original.GetSchemaNames().ToList());
            var ddInDatabase = ddlReader.GetDatabaseDefinition();

            var comparer = new Comparer(SqlExecuterTestAdapter.GetContext(version));

            changes = comparer.Compare(ddInDatabase, dds.New);

            var databaseMigrator = new DatabaseMigrator(SqlExecuterTestAdapter.GetExecuter(version.UniqueName), SqlGeneratorFactory.CreateMigrationGenerator(version, SqlExecuterTestAdapter.GetContext(version)));

            return(databaseMigrator);
        }