<commit_before>/// Console `Command` for running newly added migrations.
///
/// Add this `Command` to your `CommandConfig` to enable it.
///
///     var commandConfig = CommandConfig.default()
///     commandConfig.use(MigrateCommand.self, as: "migrate")
///     services.register(commandConfig)
///
/// Once added to your `CommandConfig`, you can call the command using the configured name, usually `"migrate"`.
///
///     swift run Run migrate
///
public final class MigrateCommand: Command, Service {
    /// Runs the container's migrations.
    static func migrate(on container: Container) throws -> Future<Void> {
        let logger = try container.make(Logger.self)
        if let migrations = try? container.make(MigrationConfig.self) {
            return migrations.storage.map { (uid, migration) in
                return {
                    logger.info("Migrating '\(uid)' database")
                    return migration.migrationPrepareBatch(on: container)
                }
            }.syncFlatten(on: container).map {
                logger.info("Migrations complete")
            }
        } else {
            logger.info("No migrations configured.")
            return .done(on: container)
        }<commit_msg>move MigrateCommand to using MigrationConfig methods<commit_after>/// Console `Command` for running newly added migrations.
///
/// Add this `Command` to your `CommandConfig` to enable it.
///
///     var commandConfig = CommandConfig.default()
///     commandConfig.use(MigrateCommand.self, as: "migrate")
///     services.register(commandConfig)
///
/// Once added to your `CommandConfig`, you can call the command using the configured name, usually `"migrate"`.
///
///     swift run Run migrate
///
public final class MigrateCommand: Command, Service {
    /// Runs the container's migrations.
    static func migrate(on container: Container) throws -> Future<Void> {
        let logger = try container.make(Logger.self)
        if let migrations = try? container.make(MigrationConfig.self) {
            return migrations.prepare(on: container)
        } else {
            logger.info("No migrations configured.")
            return .done(on: container)
        }
{'fraction_non_alphanumeric': 0.11943687556766576, 'fraction_numerical': 0.0, 'mean_word_length': 2.436817472698908, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1448606', 'n_tokens_mistral': 561, 'n_tokens_neox': 561, 'n_words': 178}