Registry / database / migri
library0.5.0jsnpmunverified

migri is a one-way database migration tool supporting PostgreSQL and ArangoDB. Version 0.5.0 is the current stable release, but the project is in early stages and appears to have low maintenance cadence. It differentiates by organizing migrations into logical groups per table (instead of a flat structure) and uses YAML or JS format for migration files. Supports environment variable injection in config. Requires peer dependencies pg (^7.5.0) and arangojs (^6.7.0).

npm install migri
INSTALL
IMPORT
SIG · MIGRI
M
migri
databasejavascriptv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Shows how to configure migri for PostgreSQL with environment variables and run a YAML migration.

// Create migri.json (PostgreSQL example) { "connector": { "name": "psql", "host": "localhost", "port": 5432, "database": { "env": "POSTGRES_DATABASE" }, "username": { "env": "POSTGRES_USERNAME" }, "password": { "env": "POSTGRES_PASSWORD" } } } // Create migration file migrations/account.yaml - depends: null version: account_1 query: > CREATE TABLE account ( id SERIAL PRIMARY KEY ); - depends: account_1 version: account_2 query: > ALTER TABLE account ADD COLUMN name TEXT; // Run migration npx migri run -c migri.json
Debug
Known issues
gotchaArangoDB connector requires 'js' parser format in config (parser.name: 'js'), not the default YAML.
fix
Set parser.name to 'js' in migri.json for ArangoDB.
affects: >=0.1.0
gotchaMigration version names must be unique across all files. Using same version in different files will cause runtime errors.
fix
Prefix version with filename or use globally unique identifiers.
affects: >=0.1.0
deprecatedThe CLI command 'help' shows only one command. Future versions may change CLI API.
fix
Do not rely on CLI output for scripting; use programmatic API if needed.
affects: <=0.5.0
gotchaEnvironment variables in config must be referenced as { "env": "VAR_NAME" }, not directly as strings.
fix
Use object format: { "env": "VAR_NAME" } instead of just the variable name.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'pg'
Missing peer dependency 'pg' when using PostgreSQL connector.
fix
Install pg: npm install pg
Error: Cannot find module 'arangojs'
Missing peer dependency 'arangojs' when using ArangoDB connector.
fix
Install arangojs: npm install arangojs
Error: Invalid version format. Version must match pattern 'file_version'
Version string does not contain an underscore separating file and version parts.
fix
Use format like 'account_1' where 'account' is the filename (without extension) and '1' is the version number.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
pgrequiredRequired for PostgreSQL connector
arangojsoptionalRequired for ArangoDB connector
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
packagemigri
migri — npm install migri · libregistry