public override void CreateInitialVersion(DatabaseConnection databaseConnection, SqlDatabaseUpdate update) { var result = CreateUpdate(update.Sql); string path = FileManager.Manager.GeneratePhysicalUpdate(databaseConnection.DatabaseName, DatabaseManager.CreateVersionNumber, result.Content); DatabaseVersionCollection databaseVersion = VersionTracker.GetDatabaseVersions(databaseConnection.DatabaseName); databaseVersion.AddVersion(new DatabaseVersion() { Name = DatabaseManager.CreateVersionNumber, From = DatabaseManager.CreateVersionNumber, To = DatabaseManager.InitialVersionNumber, Path = path }); VersionTracker.WriteFile(); }
public override void CreateDatabaseUpdate(DatabaseConnection databaseConnection, SqlDatabaseUpdate update) { var result = CreateUpdate(update.Sql); string currentVersion = GetDatabaseVersion(databaseConnection); string newVersion = GenerateVersionLabel(); string path = FileManager.Manager.GeneratePhysicalUpdate(databaseConnection.DatabaseName, newVersion, result.Content); DatabaseVersionCollection databaseVersion = VersionTracker.GetDatabaseVersions(databaseConnection.DatabaseName); databaseVersion.AddVersion(new DatabaseVersion() { Name = newVersion, To = newVersion, From = currentVersion, Path = path }); VersionTracker.WriteFile(); }