
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@edirect/migration
Advanced tools
$ npm i -S @btime/migration
$ npm i -S github:Btime/btime-migration
$ cp ./{PACKAGE_ROOT}/.env.dist {PROJECT_ROOT}/.env
:bulb: TIP Both migrate and rollback allows for the specification of a custom env file,
through the --env flag.
To facilitate the use of this CLI tool, you might install it globally or map its commands to the package.json scripts, as follows:
"scripts": {
"generate": "./node_modules/.bin/generate",
"migrate": "./node_modules/.bin/migrate",
"rollback": "./node_modules/.bin/rollback"
}
:information_source: IMPORTANT Don't forget that the mapping above requires you to invoke such scripts as npm run <script>. More on NPM scripts.
$ generate -t sql
Example output: Generated new migration file: /home/user/projects/btime-migration/migrations/Version20181002114415382.js
All run migrations get versioned, based on it's name - which reflects a unique timestamp. That's the version used when rolling back the migration.
By default, migration files are created at ./migrations (project root). You can specify a custom directory by utilizing the --workdir flag:
$ generate -t sql --workdir ./custom-mirations-dir
The generate, migrate and rollback commands support a custom directory to be specified.
:information_source: IMPORTANT The directory must exist in order to be used.
$ migrate
The above command will run (up) all migration files, considering default options (flags).
The migration process might target multiple databases through the "--multiple" flag.
$ migrate --multiple
:information_source: IMPORTANT Environment variables prefixed with "MULTIPLE_" are used in order to find target databases.
$ rollback --version [version]
The above command will run (down) the specified migration, considering default options (flags).
Just like the migrate command, you can make use of the --multiple flag and target multiple databases:
$ rollback --version [version] --multiple
All commands come with a --help flag, which displays useful information about it's usage options.
All pushes must come with a new tag. The tag usage must consider semantic versions.
[major version: incompatible changes].[minor version: compatible with major].[patch version: bug fixes]
Before pushing each version, type:
npm version patchnpm version minornpm version majorThe version set must also be set in package.json file, at version field.
Tests are run using Mocha and Chai. Coverage is provided by Istanbul CLI.
Run test suite (coverage included)
$ npm test
To scan the code base and "auto-fix" all that violates the defined lint rules, run:
$ npm run fixStyle
FAQs
## Usage
The npm package @edirect/migration receives a total of 6 weekly downloads. As such, @edirect/migration popularity was classified as not popular.
We found that @edirect/migration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.