{"id":42774830,"url":"https://github.com/gvko/db-migrator-distributed","last_synced_at":"2026-01-29T22:04:43.031Z","repository":{"id":45875750,"uuid":"421100313","full_name":"gvko/db-migrator-distributed","owner":"gvko","description":"A tool for executing DB migrations based on Sequelize and Umzug, capable of doing migrations among multiple, distributed, synchronously launched instances, by acquiring a greedy lock on a migration table.","archived":false,"fork":false,"pushed_at":"2024-06-12T10:29:04.000Z","size":167,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-19T22:38:42.711Z","etag":null,"topics":["distributed-systems","microservice","microservices-architecture","migrations","sequelize","sequelize-orm","sequelizejs","umzug"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gvko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-25T16:24:42.000Z","updated_at":"2024-06-12T10:29:08.000Z","dependencies_parsed_at":"2024-06-12T13:00:12.802Z","dependency_job_id":null,"html_url":"https://github.com/gvko/db-migrator-distributed","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gvko/db-migrator-distributed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvko%2Fdb-migrator-distributed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvko%2Fdb-migrator-distributed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvko%2Fdb-migrator-distributed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvko%2Fdb-migrator-distributed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gvko","download_url":"https://codeload.github.com/gvko/db-migrator-distributed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvko%2Fdb-migrator-distributed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28886882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed-systems","microservice","microservices-architecture","migrations","sequelize","sequelize-orm","sequelizejs","umzug"],"created_at":"2026-01-29T22:04:42.136Z","updated_at":"2026-01-29T22:04:43.024Z","avatar_url":"https://github.com/gvko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# db-migrator-distributed\n\n# About\n\nA tool for executing DB migrations based on [Umzug](https://www.npmjs.com/package/umzug) (\nand [Sequelize](https://www.npmjs.com/package/sequelize)). Coming support for Firestore migrations...\n\nThe tool is safely executing migrations among distributed, synchronously launched server instances, by acquiring a\ngreedy lock on a migration table.\n\n### Production tested\n\nThe tool has been tested and currently used in production env of one project.\n\nIt has been successfully tested with up to 6 simultaneously deployed instances.\n\nCurrently only tested with Postgres sequelize connection.\n\n# Getting started\n\n1. Install the package:\n\n```bash\nnpm i db-migrator-distributed\n```\n\n2. In the file where you want to execute the migrations (usually the starting point of your server), import the lib and\n   instantiate the migrator:\n\n```typescript\nimport DbMigrator from 'db-migrator-distributed';\n\nconst dbMigrator = new DbMigrator({ sequelizeConnection: mySequelizeConn });\ntry {\n  await dbMigrator.run();\n} catch (err) {\n  process.exit(1); // migrations were unsuccessful\n}\n```\n\n3. Set up your migration files dir and structure. The most typical one would be to have the `/migrations` dir hold your\n   migrations and put it right under the root source files dir, eg: `myProject/src/migrations`. Otherwise, you can\n   specify the dir path in the init params of the DbMigrator constructor (see below for full list of possible params).\n\n## List possible init params\n\n* `sequelizeConnection {Sequelize}` *(mandatory)* The Sequelize connection instance that you use to connect to your DB\n\n* `migrationsTable {string}` *(optional)* The DB table where Umzug keeps track of the executed migrations so far.\n  **Default:** `'_migrations'`\n\n* `migrationsLockTable {string}` *(optional)* The DB table that is going to be used for acquiring the migrations\n  lock. **Default:** `'_migrations_lock'`\n\n* `lockTimeoutSeconds {number}` *(optional)* The time (in seconds) after which locks should expire.\n  **Default:** `60`\n\n* `migrationsDirPath {string}` *(optional)* The dir path where you store your migrations files.\n  **Default:** `'dist/migrations'`. If you don't use Typescript or a separate `/dist` dir for the compiled TS files,\n  then `dist` won't make sense for you.\n\n* `migrationFilesPattern {RegEx | string}` *(optional)* The regex by which Umzug will determine whether a file in your\n  migrations dir is an actual migration file that is to be executed. **Default:** `/^\\d+[\\w-_]+\\.js$/` . This would\n  match for example `20200330092617-create-users-table.js`\n\n* `extraMigrationFuncParams {any[]}` *(optional)* Params, values, objects that you want to pass to your `up()`\n  and `down()` migrations execution functions. By default, the first two params will be the Sequelize `queryInterface`\n  and the Sequelize instance.\n\n* `loggger {any}` *(optional)* A logger that you want to use that the migrator will also use to log events. The default\n  one is `bunyan` and it's set up to log to the console, so you don't have to provide anything, if you wish.\n\n# TODO\n\n* Finish support of Firestore migrations\n* Add support for rollback functionality\n* Test for other dialects, eg. MySQL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgvko%2Fdb-migrator-distributed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgvko%2Fdb-migrator-distributed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgvko%2Fdb-migrator-distributed/lists"}