{"repo":"mycodeself/mongo-migrate-ts","free":true,"listed":false,"github":"https://github.com/mycodeself/mongo-migrate-ts","clone":"git clone https://github.com/mycodeself/mongo-migrate-ts.git","description":"Run mongodb migrations easy from TypeScript","language":"TypeScript","stars":97,"topics":["typescript","mongodb","migrations","mongo-migrate","database","npm"],"license":"MIT","category":"databases-storage","readme_excerpt":"mongo-migrate-ts A library for easy run migrations on mongodb with TypeScript. Based on migrate-mongo (https://github.com/seppevs/migrate-mongo/), but with TypeScript support. Installation Install using your favourite package manager, example using npm You can install it globally for the CLI usage Usage CLI options Create a directory for your migrations. Instantiate a CLI within the newly created migrations directory Create a migration file in the configured migrations folder... Compile and up all migrations or run directly with ts-node Configuration Example configuration in json Transactions The up and down methods in migrations have the mongo client available to create a session and use transactions. See example Upgrading to version 2.x.x In version 1.x.x, this package stored migration file paths as absolute paths. As a result, rollbacks could only be executed from the same machine that performed the original migration, or from another with an identical directory structure. To address this limitation, version 2.x.x now uses paths relative to the migrationsDir. To update existing migration entries in your database and ensure compatibility, you can run the fix-paths command:","default_branch":null,"files":null,"tree":[],"storefront":"/r/mycodeself","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mycodeself/mongo-migrate-ts/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."}