Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/orkon/migrations-engine
- Owner: OrKoN
- License: other
- Created: 2019-12-13T21:57:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T02:58:19.000Z (almost 2 years ago)
- Last Synced: 2023-04-09T19:07:17.687Z (over 1 year ago)
- Language: TypeScript
- Size: 1.88 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
migrations-engine
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.