Registry / devops / co-migrator

co-migrator

JSON →
library0.0.6jsnpmunverified

Database migration tool for compound.js applications (v0.0.6, no recent updates). Provides command-line migration creation and running/rolling back migrations using JugglingDB schema definitions. Tightly integrated with compound.js framework autoload system and uses generator-based (co) patterns. No longer actively maintained; alternatives include db-migrate or knex.

npm install co-migrator
INSTALL
IMPORT
SIG · CO-MIGRATOR
C
co-migrator
devopsjavascriptv0.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Schema.Migration
import { Schema } from 'co-migrator'; const Migration = Schema.Migration;
const { Schema } = require('co-migrator'); const Migration = Schema.Migration;
CommonJS usage; no ESM export. Schema.Migration is a JugglingDB schema definition.
Models.Migration
import { Models } from 'co-migrator'; const Migration = Models.Migration;
const { Models } = require('co-migrator');
Provides a model for the Migration schema.
default import
import coMigrator from 'co-migrator';
const coMigrator = require('co-migrator');
Default import yields an object with Schema and Models.

Shows integration with compound.js: autoload, schema definition, model creation, and CLI commands.

// Add to config/autoload.js module.exports = function (compound) { return [ 'ejs-ext', 'jugglingdb', 'seedjs', 'co-logger', 'co-migrator' ].map(require); }; // In db/schema.js var migration = require('co-migrator').Schema.Migration; schema.define('Migration', migration); // In app/models/migration.js module.exports = require('co-migrator').Models.Migration; // Create migration: compound m create // Run: compound m // Rollback: compound m down
Debug
Known issues
breakingRequires compound.js framework; not standalone.
fix
Use knex or db-migrate for non-compound projects.
affects: >=0.0.1
deprecatedPackage is unmaintained since 2015; no updates for Node.js versions >6.
fix
Consider migrating to db-migrate or knex.
affects: *
gotchaMigrations use co (generator-based) patterns; may not work with async/await.
fix
Wrap in co or use a different tool.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'co-migrator'
Package not installed or not in node_modules.
fix
Run npm install co-migrator --save.
TypeError: compound.m is not a function
co-migrator not added to autoload as per installation step 2.
fix
Add 'co-migrator' to config/autoload.js array.
Error: Migration schema not defined
Missing schema definition in db/schema.js.
fix
Add var migration = require('co-migrator').Schema.Migration; schema.define('Migration', migration);
Upgrade
Version history
0.0.6latest on npm
Audit
Dependencies
compoundrequiredRequired framework integration; migrations depend on compound's schema and models.
Agent activity
6 hits · last 30 days
node
6
Resources
co-migrator — npm install co-migrator · libregistry