<commit_before>var orm        = require('orm')
var MigrationTask = require('migrate-orm2')

var configFile = /*process.argv[2] ||*/ 'config.js'
var config = require('./' + configFile)

runMigration = function (operation, grunt, done) {
  orm.settings.set('connection.debug', true)
  orm.connect(config.database, function (err, connection) {
    if (err) throw(err)

    var migrationTask = new MigrationTask(connection.driver)
    migrationTask[operation](grunt.option('file'), done)
  })
}

module.exports = function(grunt) {

  grunt.registerTask('migrate:generate', '', function () {
    var done = this.async()
    runMigration('generate', grunt, done)
  })

  grunt.registerTask('migrate:up', '', function () {<commit_msg>Fixing migrations.<commit_after>var orm           = require('orm')
var MigrationTask = require('migrate-orm2')

var configFile = 'config.js'
var config     = require('./' + configFile)

runMigration = function (operation, grunt, done) {
  orm.settings.set('connection.debug', true)
  orm.connect(config.database, function (err, connection) {
    if (err) throw(err)

    console.log('Running on db:', config.database)
    var migrationTask = new MigrationTask(connection.driver, {dir: 'data/migrations'})
    migrationTask[operation](grunt.option('file'), done)
  })
}

module.exports = function(grunt) {

  grunt.registerTask('migrate:generate', '', function () {
    var done = this.async()
    runMigration('generate', grunt, done)
  })

  grunt.registerTask('migrate:up', '', function () {
{'fraction_non_alphanumeric': 0.1611842105263158, 'fraction_numerical': 0.001973684210526316, 'mean_word_length': 4.471223021582734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1396998', 'n_tokens_mistral': 478, 'n_tokens_neox': 477, 'n_words': 98}