VR Migrations

raw JSON →
1.0.38 verified Sat Apr 25 auth: no javascript

VR Migrations is a database migration and seeding library for Node.js applications, built on Sequelize. It supports PostgreSQL, MySQL, SQLite, and other Sequelize-compatible databases. The package is actively maintained with frequent updates (current stable version 1.0.38, released in 2025). It offers CLI and programmatic migration management, with TypeScript type definitions included. Key differentiators from generic migration tools (like db-migrate) include tight integration with Sequelize models and a VR-themed API (universe, planets for migrations/seeds).

error TypeError: (0 , vr_migrations.migrate) is not a function
cause CJS require() used on an ESM-only package
fix
Switch to ES modules or use dynamic import: const { migrate } = await import('vr-migrations')
error Cannot find module 'vr-migrations'
cause Package not installed or import path misspelled
fix
Run npm install vr-migrations and verify the import is correct.
error Error: Cannot sequelize connection. Please provide valid sequelize instance.
cause Missing or invalid sequelize option passed to migrate/seed
fix
Ensure you pass a configured Sequelize instance: migrate({ sequelize: yourSequelizeInstance })
breaking Default export removed in v1.0.0 in favor of named exports.
fix Replace `import VrMigrations from 'vr-migrations'` with `import { migrate, seed } from 'vr-migrations'`.
deprecated Function `runMigrations` is deprecated since v0.9.0.
fix Use `migrate` function instead.
gotcha TypeScript types are only available for named exports; default export lacks typings.
fix Import named symbols to get full type support.
gotcha Sequelize v6 is required; v7 may break compatibility.
fix Ensure your project uses Sequelize v6.x.
npm install vr-migrations
yarn add vr-migrations
pnpm add vr-migrations

Shows how to run migrations and seed using an in-memory SQLite database with the library's provided functions.

import { migrate, seed } from 'vr-migrations';
import { Sequelize } from 'sequelize';

const sequelize = new Sequelize({
  dialect: 'sqlite',
  storage: ':memory:',
  logging: false
});

async function run() {
  await migrate({
    sequelize,
    migrationsDir: './migrations',
    tableName: 'migrations'
  });

  await seed({
    sequelize,
    seedsDir: './seeds',
    tableName: 'seeds'
  });

  await sequelize.close();
}

run().catch(console.error);