{"repo":"NodePit/node-migrate-state-store-mongodb","free":true,"listed":false,"github":"https://github.com/NodePit/node-migrate-state-store-mongodb","clone":"git clone https://github.com/NodePit/node-migrate-state-store-mongodb.git","description":"MongoDB-based state storage implementation for the migrate aka. node-migrate framework","language":"TypeScript","stars":10,"topics":["nodejs","mongodb","migration"],"license":"MIT","category":"ecommerce","readme_excerpt":"node-migrate state storage for MongoDB This is a state storage implementation for the node-migrate framework. It will store your migation state in a MongoDB collection called migrations which contains a single document. In case you’re using node-migrate for migrating your MongoDB, it makes sense to keep the state within the database itself, instead of a separate file which is used by node-migrate per default. Installation Usage Either create a wrapper script such as run-migrations.ts which calls the migration API like so: Per default, the migrations are stored in a collection called migrations . If you want to customize the collection name, instantiate the MongoStateStore with an object instead: Synchronization If you’re running in a clustered environments with more than one node, there will likely be concurrency issues when more than one node tries to run a migration (also see here). The plugin provides a locking mechanism which ensures that only one node can run migrations at a given time (and other ones will just wait until the migration has finished). For this, initialize MongoStateStore with a lockCollectionName : … then use the synchronizedUp function instead of calling migrate.load and set.up directly to ensure that the migration is only run on one instance at a time: CLI Usage Alternatively, you can also pass the store on the migrate CLI using the --store flag. For that, create a a file which has as default export a configured subclass with a zero-arg constructor of t","default_branch":null,"files":null,"tree":[],"storefront":"/r/NodePit","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/NodePit/node-migrate-state-store-mongodb/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}