The modern, modular and flexible migration tool for any database
Installations
npm install @emigrate/cli
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.9.0
NPM Version
10.1.0
Score
69.7
Supply Chain
96.8
Quality
83
Maintenance
100
Vulnerability
99.6
License
Releases
@emigrate/mysql@0.3.2
Published on 25 Jun 2024
@emigrate/types@0.12.2
Published on 30 May 2024
@emigrate/storage-fs@0.4.7
Published on 30 May 2024
@emigrate/reporter-pino@0.6.4
Published on 30 May 2024
@emigrate/postgres@0.3.1
Published on 30 May 2024
@emigrate/plugin-tools@0.9.7
Published on 30 May 2024
Contributors
Unable to fetch Contributors
Languages
TypeScript (90.11%)
JavaScript (9.73%)
Shell (0.16%)
Developer
Download Statistics
Total Downloads
3,277
Last Day
7
Last Week
10
Last Month
42
Last Year
2,495
GitHub Statistics
3 Stars
252 Commits
3 Watching
12 Branches
1 Contributors
Package Meta Information
Latest Version
0.18.3
Package Id
@emigrate/cli@0.18.3
Unpacked Size
284.08 kB
Size
47.52 kB
File Count
127
NPM Version
10.1.0
Node Version
20.9.0
Publised On
30 May 2024
Total Downloads
Cumulative downloads
Total Downloads
3,277
Last day
600%
7
Compared to previous day
Last week
400%
10
Compared to previous week
Last month
-87.1%
42
Compared to previous month
Last year
219.1%
2,495
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@emigrate/cli
Emigrate is a tool for managing database migrations. It is designed to be simple yet support advanced setups, modular and extensible.
š Read the documentation for more information!
Installation
Install the Emigrate CLI in your project:
1npm install @emigrate/cli 2# or 3pnpm add @emigrate/cli 4# or 5yarn add @emigrate/cli 6# or 7bun add @emigrate/cli
Usage
1Usage: emigrate <options>/<command> 2 3Options: 4 5 -h, --help Show this help message and exit 6 -v, --version Print version number and exit 7 8Commands: 9 10 up Run all pending migrations (or do a dry run) 11 new Create a new migration file 12 list List all migrations and their status 13 remove Remove entries from the migration history
emigrate up
1Usage: emigrate up [options] 2 3Run all pending migrations 4 5Options: 6 7 -h, --help Show this help message and exit 8 9 -d, --directory <path> The directory where the migration files are located (required) 10 11 -i, --import <module> Additional modules/packages to import before running the migrations (can be specified multiple times) 12 For example if you want to use Dotenv to load environment variables or when using TypeScript 13 14 -s, --storage <name> The storage to use for where to store the migration history (required) 15 16 -p, --plugin <name> The plugin(s) to use (can be specified multiple times) 17 18 -r, --reporter <name> The reporter to use for reporting the migration progress 19 20 -l, --limit <count> Limit the number of migrations to run 21 22 -f, --from <name/path> Start running migrations from the given migration name or relative file path to a migration file, 23 the given name or path needs to exist. The same migration and those after it lexicographically will be run 24 25 -t, --to <name/path> Skip migrations after the given migration name or relative file path to a migration file, 26 the given name or path needs to exist. The same migration and those before it lexicographically will be run 27 28 --dry List the pending migrations that would be run without actually running them 29 30 --color Force color output (this option is passed to the reporter) 31 32 --no-color Disable color output (this option is passed to the reporter) 33 34 --no-execution Mark the migrations as executed and successful without actually running them, 35 which is useful if you want to mark migrations as successful after running them manually 36 37 --abort-respite <sec> The number of seconds to wait before abandoning running migrations after the command has been aborted (default: 10) 38 39Examples: 40 41 emigrate up --directory src/migrations -s fs 42 emigrate up -d ./migrations --storage @emigrate/mysql 43 emigrate up -d src/migrations -s postgres -r json --dry 44 emigrate up -d ./migrations -s mysql --import dotenv/config 45 emigrate up --limit 1 46 emigrate up --to 20231122120529381_some_migration_file.js 47 emigrate up --to 20231122120529381_some_migration_file.js --no-execution
Examples
Create a new migration:
1npx emigrate new -d migrations create some fancy table 2# or 3pnpm emigrate new -d migrations create some fancy table 4# or 5yarn emigrate new -d migrations create some fancy table 6# or 7bunx --bun emigrate new -d migrations create some fancy table
Will create a new empty JavaScript migration file with the name "YYYYMMDDHHmmssuuu_create_some_fancy_table.js" in the migrations
directory.
No vulnerabilities found.
No security vulnerabilities found.