Ejemplo n.º 1
0
        private void RunAfterMigration(IMigration migration, DatabaseVersionModel databaseVersion)
        {
            // Check Actual DatabaseVersion against the migration version
            // Don't run unless the MigrationVersion is 1 more than DatabaseVersion
            if (databaseVersion.IsAfterMigrationComplete == false)
            {
                migration.DbProvider = _dbProvider;

                // After Migrate
                migration.AfterMigrate();
                if (_systemRole == SystemRole.Server)
                {
                    migration.ServerAfterMigrate();
                }
                if (_systemRole == SystemRole.Client)
                {
                    migration.ClientAfterMigrate();
                }

                // Update the database version to show the after migration has been run
                databaseVersion.IsAfterMigrationComplete = true;
                _dbProvider.Query <DatabaseVersionModel>().Where(dbv => dbv.VersionNumber == migration.MigrationVersion).Update(databaseVersion);
            }
        }