0.0.8 • Published 2 years ago

@vyce/migrate-state-store-mongodb v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

node-migrate-state-store-mongodb

This is a state storage implementation for the node-migrate framework. It will store your migation state in a MongoDB collection called migrations as separate documents.

Usage

  1. Install the package
$ npm install @vyce/migrate-state-store-mongodb
$ yarn add @vyce/migrate-state-store-mongodb
  1. Create a file to configure and expose the state storage
// state-store.ts
const { MongoStateStore } = require('@vyce/migrate-state-store-mongodb');

class StateStore extends MongoStateStore {
	constructor() {
		super({
			uri: 'mongodb://localhost:27017',
			collectionName: 'migrations',
		});
	}
};

module.exports = StateStore;
  1. Use the state storage in your migration scripts
// package.json
{
  "scripts": {
    "migrate:up": "migrate --store=\"./state-store.ts\" up",
		    "migrate:down": "migrate --store=\"./state-store.ts\" down",
  }
}

Development

  • Clone the repository
  • Run npm install to install dependencies
  • Make changes, create new branch and commit & push

Releasing a new version

  • Run npm run version [patch|minor|major] to bump the version
  • Commit and push changes
  • Create pull request to master
  • Merge PR to master and GitHub Action will build, publish and then tag the commit if successful
0.0.3

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago