4.1.1 • Published 1 year ago

knex-umzug v4.1.1

Weekly downloads
1,245
License
ISC
Repository
github
Last release
1 year ago

knex-umzug

Greenkeeper badge

A storage adapter for umzug, a database migration library.

It supports namespacing and custom database table names. This storage adapter not only shows you the current state of a migration but also shows all the migration paths and tracks hostname and system user which executed a migration.

This library only makes knex work with umzug. Please check out the umzug api for more details: https://www.npmjs.com/package/umzug#api

Umzug v3:

const {Umzug} = require('umzug')
const knex = require('knex')
const KnexUmzug = require('knex-umzug')

const db = require('knex')({
  client: 'sqlite3',
  connection: {filename: './db.sql'}
})

const umzug = new Umzug({
  storage: new KnexUmzug({
    // The context allows you to reuse the same migrations table
    // to maintain the state for multiple isolated migration setups.
    // e.g. 'upstream', 'downstream'
    context: 'default',
    connection: db,
    tableName: 'migrations'
  })
})

umzug.up().then(function (result) {

})

Umzug v2:

const Umzug = require('umzug')
const db = require('knex')({
    client: 'sqlite3',
    connection: {filename: './db.sql'}
})

const umzug = new Umzug({
    storage: 'knex-umzug',
    storageOptions: {
      // The context allows you to reuse the same migrations table
      // to maintain the state for multiple isolated migration setups.
      // e.g. 'upstream', 'downstream'
      context: 'default',
      connection: db,
      tableName: 'migrations'
    }
})

umzug.up().then(function (result) {

})
4.1.1

1 year ago

4.1.0

2 years ago

4.0.0

3 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

7 years ago

1.2.1

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.3

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago