4.0.0 • Published 6 years ago

schema-migrations v4.0.0

Weekly downloads
15
License
MIT
Repository
github
Last release
6 years ago

schema-migrations

Migrate database migrations.

Getting started

Add the package to your project using the npm ecosystem:

$ npm install schema-migrations --save

Then use:

"use strict"

module.exports = async (app) => {
  /**
   * Dependencies
   */

  const SchemaMigrations = require("schema-migrations")

  /**
   * Constants
   */

  const base = app.locals.base
  const db = app.locals.db

  /**
   * Configure schema migrations.
   */

  let config = {
    type: "postgresql",
    close: false
  }

  /**
   * Run any pending migrations.
   */

  let schema_migrations = new SchemaMigrations(base, db, config)

  try {
    await schema_migrations.run()
  } catch(err) {
    console.error(err)
  }

  return true
}

Changelog

Get the project's history in CHANGELOG.md.

Maintainer

Andy Bettisworth andy@accreu.com https://andybettisworth.com

License

This project is released under the MIT License.

4.0.0

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago