
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@mikro-orm/migrations
Advanced tools
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
@mikro-orm/migrations is a package for handling database migrations in MikroORM, an ORM for Node.js. It allows you to create, run, and manage database schema changes in a structured and version-controlled manner.
Creating Migrations
This feature allows you to create a new migration file based on the current state of your entities. The migration file will contain the necessary SQL statements to update the database schema.
const { MikroORM } = require('@mikro-orm/core');
const { Migrator } = require('@mikro-orm/migrations');
(async () => {
const orm = await MikroORM.init();
const migrator = orm.getMigrator();
await migrator.createMigration(); // creates file MigrationYYYYMMDDHHMMSS.ts
})();
Running Migrations
This feature allows you to apply all pending migrations to the database, ensuring that the schema is up-to-date with the latest changes.
const { MikroORM } = require('@mikro-orm/core');
const { Migrator } = require('@mikro-orm/migrations');
(async () => {
const orm = await MikroORM.init();
const migrator = orm.getMigrator();
await migrator.up(); // runs all pending migrations
})();
Reverting Migrations
This feature allows you to revert the last applied migration, which is useful for rolling back changes in case of errors or issues.
const { MikroORM } = require('@mikro-orm/core');
const { Migrator } = require('@mikro-orm/migrations');
(async () => {
const orm = await MikroORM.init();
const migrator = orm.getMigrator();
await migrator.down(); // reverts the last migration
})();
sequelize-cli is a command-line interface for Sequelize, a popular ORM for Node.js. It provides similar functionalities for managing database migrations, including creating, running, and reverting migrations. Compared to @mikro-orm/migrations, sequelize-cli is more widely used and has a larger community, but it is specific to Sequelize.
Knex is a SQL query builder for Node.js that also includes a powerful migration tool. It allows you to create, run, and rollback migrations in a similar manner to @mikro-orm/migrations. Knex is more flexible as it can be used with various SQL databases and is not tied to a specific ORM.
TypeORM is another ORM for Node.js that includes built-in support for migrations. It provides similar functionalities for managing database schema changes. TypeORM is comparable to MikroORM in terms of features and capabilities, but it has a different API and design philosophy.
FAQs
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
The npm package @mikro-orm/migrations receives a total of 164,776 weekly downloads. As such, @mikro-orm/migrations popularity was classified as popular.
We found that @mikro-orm/migrations demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.