Registry / database / oe-migration

oe-migration

JSON →
library2.3.0jsnpmunverified

This module is an app-list module for oe-Cloud based applications, version 2.3.0. It provides data migration and seeding from JSON files or custom JS into the app database. Supports versioned migrations, zip download/upload, rollback, and HTTP endpoints. Designed for the oe-Cloud ecosystem with Node >=6.

npm install oe-migration
INSTALL
IMPORT
SIG · OE-MIGRATION
O
oe-migration
databasejavascriptv2.3.0
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.

migrate
const { migrate } = require('oe-migration');
import { migrate } from 'oe-migration';
CommonJS module, no ESM export. Use require.
migration
const migration = require('oe-migration');
import migration from 'oe-migration';
Default export is a function or object. Check actual export.

Shows how to require and call the migrate function with typical options.

const { migrate } = require('oe-migration'); const app = require('oe-cloud'); const options = { app: app, dataSource: app.dataSources.db, migrate: 'up', dir: path.join(__dirname, '..', 'migrations') }; migrate(options, function(err, result) { if (err) { console.error('Migration failed:', err); } else { console.log('Migration completed:', result); } });
Debug
Known issues
gotchaES module import syntax does not work; use CommonJS require.
fix
Replace 'import' with 'const ... = require()'
affects: >=2.0.0
gotchaRequires oe-Cloud application context; cannot be used standalone.
fix
Ensure app is an instance of oe-Cloud.
affects: >=2.0.0
gotchaNode version >=6 required; older versions break.
fix
Upgrade Node to v6 or higher.
affects: <6.0.0
Errors
Common errors & fixes
Error: Cannot find module 'oe-migration'
Package not installed or missing in node_modules.
fix
Run 'npm install oe-migration'
TypeError: migrate is not a function
Incorrect import method (ESM vs CJS).
fix
Use 'const { migrate } = require('oe-migration');'
Error: app is not defined
Migration options missing 'app' property.
fix
Pass an oe-Cloud app instance in options.
Upgrade
Version history
2.3.0latest on npm
Audit
Dependencies
oe-cloudoptionalRequired peer dependency for oe-Cloud based applications
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
oe-migration — npm install oe-migration · libregistry