Registry / database / migration-registrar

migration-registrar

JSON →
library1.0.19jsnpmunverified

A migration management application for the Naawan CMS Registrar system. This package provides tools for handling database schema changes and data migrations, specifically tailored for registrar-related workflows. Version 1.0.19 is the latest stable release, with a low release cadence. Key differentiators include integration with Naawan CMS and focus on registrar data structures.

npm install migration-registrar
INSTALL
IMPORT
SIG · MIGRATION-REGISTRA
M
migration-registrar
databasejavascriptv1.0.19
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.

MigrationRegistrar
import { MigrationRegistrar } from 'migration-registrar'
const MigrationRegistrar = require('migration-registrar')
ESM-only; CommonJS require() is not supported.
runMigrations
import { runMigrations } from 'migration-registrar'
import runMigrations from 'migration-registrar'
runMigrations is a named export, not default.
MigrationConfig
import type { MigrationConfig } from 'migration-registrar'
import { MigrationConfig } from 'migration-registrar'
MigrationConfig is a TypeScript type; use `import type` to avoid runtime bundle.

Shows how to import MigrationRegistrar and runMigrations, connect to MongoDB, execute migrations, and handle errors.

import { MigrationRegistrar, runMigrations } from 'migration-registrar'; const config = { dbUrl: process.env.DB_URL ?? 'mongodb://localhost:27017/registrar', migrationsDir: './migrations', collection: 'migrations' }; const registrar = new MigrationRegistrar(config); async function main() { try { await registrar.connect(); const results = await runMigrations(registrar); console.log('Migrations executed:', results); } catch (err) { console.error('Migration failed:', err); } finally { await registrar.close(); } } main();
Debug
Known issues
breakingClass 'MigrationRegistrar' requires constructor arguments; omitting them throws Error: Missing config.
fix
Provide config object with at least dbUrl and migrationsDir.
affects: >=1.0.0
deprecatedMethod 'runAll' is deprecated; use 'runMigrations' instead.
fix
Replace registrar.runAll() with runMigrations(registrar).
affects: >=1.0.5
gotchaDefault export is not available; importing 'migration-registrar' without destructuring yields undefined.
fix
Use named imports: import { MigrationRegistrar } from 'migration-registrar'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'migration-registrar'
Package not installed or incorrect import path.
fix
Run npm install migration-registrar and ensure import uses correct casing.
TypeError: MigrationRegistrar is not a constructor
Default import used instead of named import; MigrationRegistrar is not a default export.
fix
Use named import: import { MigrationRegistrar } from 'migration-registrar'.
Missing config: dbUrl is required
Constructor called without config or config missing dbUrl.
fix
Pass a config object with dbUrl property.
Upgrade
Version history
1.0.19latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
migration-registrar — npm install migration-registrar · libregistry