migrations-engine
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

migrations-engine npm travis

Simple library to manage database migrations in-memory:

  • migration must have a name
  • migrations are applied in order, by name (using String.localeCompare to order)
npm i migrations-engine --save
import { up, down } from 'migrations-engine';
 
const all = [
  // these are all available migrations
  {
    name: 'A',
  },
  {
    name: 'B',
  },
];
 
const applied = [
  // these are all applied migrations so far
  {
    name: 'A',
  },
];
 
const migrationsToApply = up(applied, all); // [{ name: 'B' }]
 
// apply migrations

The storage and applying of migrations is up to you.

Readme

Keywords

none

Package Sidebar

Install

npm i migrations-engine

Weekly Downloads

0

Version

0.1.2

License

LGPL-3.0-only

Unpacked Size

15.3 kB

Total Files

12

Last publish

Collaborators

  • orkon