{"id":15011491,"url":"https://github.com/aboviq/emigrate","last_synced_at":"2025-04-12T03:32:18.898Z","repository":{"id":206472085,"uuid":"716988123","full_name":"aboviq/emigrate","owner":"aboviq","description":"The modern, modular and flexible migration tool for any database","archived":false,"fork":false,"pushed_at":"2024-09-23T02:12:20.000Z","size":1676,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-02T07:34:17.754Z","etag":null,"topics":["bun","database","database-migrations","database-schema","javascript","migrations","nodejs","sql","tools","typescript"],"latest_commit_sha":null,"homepage":"https://emigrate.dev/","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/aboviq.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":"2023-11-10T09:57:12.000Z","updated_at":"2024-08-09T14:03:46.000Z","dependencies_parsed_at":"2023-11-24T16:24:10.480Z","dependency_job_id":"f6266811-df85-43a3-bddb-03bda9127529","html_url":"https://github.com/aboviq/emigrate","commit_stats":{"total_commits":252,"total_committers":3,"mean_commits":84.0,"dds":"0.19841269841269837","last_synced_commit":"6eb60177c5df20386ac83403e53c5fecbc9fcf19"},"previous_names":["aboviq/emigrate"],"tags_count":135,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboviq%2Femigrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboviq%2Femigrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboviq%2Femigrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboviq%2Femigrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aboviq","download_url":"https://codeload.github.com/aboviq/emigrate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223494312,"owners_count":17154526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bun","database","database-migrations","database-schema","javascript","migrations","nodejs","sql","tools","typescript"],"created_at":"2024-09-24T19:41:09.468Z","updated_at":"2024-11-07T10:04:53.055Z","avatar_url":"https://github.com/aboviq.png","language":"TypeScript","readme":"# Emigrate\n\n\u003e The modern, modular and flexible migration tool for any database\n\nIt's effectively a successor of [klei-migrate](https://www.npmjs.com/package/klei-migrate) and [Immigration](https://www.npmjs.com/package/immigration).\n\n📖 Read the [documentation](https://emigrate.dev) for more information!\n\n## Features\n\n- Database agnostic\n  - Emigrate can migrate any database\n- Works at any scale\n  - Supports any database as storage so multiple instances of the same app can share the same migration history\n  - Supports multiple projects/apps doing migrations on the same database without interfering with each other\n  - Uses smart locking to ensure only one instance migrates a certain migration at a time\n  - Thanks to the smart locking it's safe to run migrations in parallel\n- Can be run inside containers\n  - It's common for Docker or Kubernetes to kill containers with health checks if migrations takes too long to run\n  - Emigrate makes sure the migration history does not get stuck in a locked state if that's the case\n- Supports any file type for your migration files\n  - You can easily write migrations in JavaScript, TypeScript or plain SQL (or any other language)\n  - JavaScript migration files written using CommonJS or ES modules (ESM) are supported out of the box\n  - You can customize the template for your migration files to fit your needs (or use a plugin to do it for you)\n- Easy to debug\n  - Emigrate will store any errors that occur during migration in the migration history so you can easily debug them\n\n## Installation\n\nInstall the Emigrate CLI in your project:\n\n```bash\nnpm install @emigrate/cli\n# or\npnpm add @emigrate/cli\n# or\nyarn add @emigrate/cli\n# or\nbun add @emigrate/cli\n```\n\n## Usage\n\n```text\nUsage: emigrate up [options]\n\nRun all pending migrations\n\nOptions:\n\n  -h, --help              Show this help message and exit\n\n  -d, --directory \u003cpath\u003e  The directory where the migration files are located (required)\n\n  -i, --import \u003cmodule\u003e   Additional modules/packages to import before running the migrations (can be specified multiple times)\n                          For example if you want to use Dotenv to load environment variables or when using TypeScript\n\n  -s, --storage \u003cname\u003e    The storage to use for where to store the migration history (required)\n\n  -p, --plugin \u003cname\u003e     The plugin(s) to use (can be specified multiple times)\n\n  -r, --reporter \u003cname\u003e   The reporter to use for reporting the migration progress\n\n  -l, --limit \u003ccount\u003e     Limit the number of migrations to run\n\n  -f, --from \u003cname/path\u003e  Start running migrations from the given migration name or relative file path to a migration file,\n                          the given name or path needs to exist. The same migration and those after it lexicographically will be run\n\n  -t, --to \u003cname/path\u003e    Skip migrations after the given migration name or relative file path to a migration file,\n                          the given name or path needs to exist. The same migration and those before it lexicographically will be run\n\n  --dry                   List the pending migrations that would be run without actually running them\n\n  --color                 Force color output (this option is passed to the reporter)\n\n  --no-color              Disable color output (this option is passed to the reporter)\n\n  --no-execution          Mark the migrations as executed and successful without actually running them,\n                          which is useful if you want to mark migrations as successful after running them manually\n\n  --abort-respite \u003csec\u003e   The number of seconds to wait before abandoning running migrations after the command has been aborted (default: 10)\n\nExamples:\n\n  emigrate up --directory src/migrations -s fs\n  emigrate up -d ./migrations --storage @emigrate/mysql\n  emigrate up -d src/migrations -s postgres -r json --dry\n  emigrate up -d ./migrations -s mysql --import dotenv/config\n  emigrate up --limit 1\n  emigrate up --to 20231122120529381_some_migration_file.js\n  emigrate up --to 20231122120529381_some_migration_file.js --no-execution\n```\n\n### Examples\n\nCreate a new migration:\n\n```bash\nnpx emigrate new -d migrations create some fancy table\n# or\npnpm emigrate new -d migrations create some fancy table\n# or\nyarn emigrate new -d migrations create some fancy table\n# or\nbunx --bun emigrate new -d migrations create some fancy table\n```\n\nWill create a new empty JavaScript migration file with the name \"YYYYMMDDHHmmssuuu_create_some_fancy_table.js\" in the `migrations` directory.\n\n## License\n\nEmigrate is licensed under the MIT license. See [LICENSE](LICENSE) for the full license text.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboviq%2Femigrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboviq%2Femigrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboviq%2Femigrate/lists"}