code: func Validate(d Driver, migrations []Migration) error {
  	sort.Sort(byMigrationVersion(migrations))
  
  	if version, invalid := isInvalidVersion(migrations); invalid {
  		return IllegalMigrationVersionError{Version: version}
  	}
  
  	if version, dup := isDuplicated(migrations); dup {
  		return DuplicateMigrationVersionError{Version: version}
  	}
  
  	applied, err := d.All()
  
  	if err != nil {
  		return err
  	}
  
  	if version, removed := wasRemovedMigration(applied, migrations); removed {
  		return RemovedMigrationError{Version: version}
  	}
  
  	if version, invalid := isInvalidChecksumMigration(applied, migrations); invalid {
  		return InvalidChecksumError{Version: version}
  	}
  
  	return nil
  }
docs: // Validate if the database migrations are applied and consistent