<commit_before>grunt-db-migrate
================

Migrate database schema and data with consistent and flexible [db-migrate](https://github.com/kunklejr/node-db-migrate)

## Getting started

Install with npm:

```bash
npm i grunt-db-migrate --save-dev
```

You may want to start with simple configuration:

```JavaScript
   migrate: {
      options: {
        env: {
          DATABASE_URL: databaseUrl
        },
        verbose: true
      }
    }
```

where `databaseUrl` may be exctracted from your environment config like this:

```JavaScript
var CONF = require('config'),
 databaseUrl = 'postgres://' + CONF.db.user + ':' + CONF.db.password + '@' + CONF.db.host + ':5432/' + CONF.db.name;
```

Create migration with command line command:

```bash
$ grunt migrate:create:migrate_name
```
It generates a new file based on template in your 'migrations' folder (see configuration section). For example, edit this file, using `async` library:

```JavaScript
/* global exports, require */

var async = require('async');
exports.up = function (db, callback) {
  async.series([
    db.createTable.bind(db, 'users', {
      id: {
        type: 'int',
        primaryKey: true,
        autoIncrement: true<commit_msg>Fixed a typo<commit_after>grunt-db-migrate
================

Migrate database schema and data with consistent and flexible [db-migrate](https://github.com/kunklejr/node-db-migrate)

## Getting started

Install with npm:

```bash
npm i grunt-db-migrate --save-dev
```

You may want to start with simple configuration:

```JavaScript
   migrate: {
      options: {
        env: {
          DATABASE_URL: databaseUrl
        },
        verbose: true
      }
    }
```

where `databaseUrl` may be extracted from your environment config like this:

```JavaScript
var CONF = require('config'),
 databaseUrl = 'postgres://' + CONF.db.user + ':' + CONF.db.password + '@' + CONF.db.host + ':5432/' + CONF.db.name;
```

Create migration with command line command:

```bash
$ grunt migrate:create:migrate_name
```
It generates a new file based on template in your 'migrations' folder (see configuration section). For example, edit this file, using `async` library:

```JavaScript
/* global exports, require */

var async = require('async');
exports.up = function (db, callback) {
  async.series([
    db.createTable.bind(db, 'users', {
      id: {
        type: 'int',
        primaryKey: true,
        autoIncrement: true
{'fraction_non_alphanumeric': 0.14356435643564355, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 3.3536804308797126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2903064', 'n_tokens_mistral': 779, 'n_tokens_neox': 747, 'n_words': 225}