Ejemplo n.º 1
0
        public void MigrateToLatest()
        {
            logger.WriteToLog(@"Ensuring SchemaTable");

            schema.EnsureSchemaVersionTable();
            var previousSchemaApplied = schema.GetLatestSchemaVersion();
            var migrationsToApply     = FindChangesSinceLastMigrationInAssembly(previousSchemaApplied, assembly);

            if (migrationsToApply.Count() > 0)
            {
                logger.WriteToLog(@"Found {0} Migrations...", migrationsToApply.Count());
                ApplyUpMigrations(migrationsToApply);
            }
            else
            {
                logger.WriteToLog(@"No Migrations Found");
            }
        }