Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/orkon/migrations-engine

Simple library to manage database migrations in-memory
https://github.com/orkon/migrations-engine

Last synced: 2 months ago
JSON representation

Simple library to manage database migrations in-memory

Awesome Lists containing this project

README

        


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
```

```ts
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.