Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
loopback-component-migrate
Advanced tools
A library to add simple database migration support to loopback projects.
Migrations that have been run will be stored in a table called 'Migrations'. The library will read the loopback datasources.json files based on the NODE_ENV environment variable just like loopback does. The usage is based on the node-db-migrate project.
npm install --save loopback-component-migrate
Create a component-config.json file in your server folder (if you don't already have one)
Enable the component inside component-config.json
.
{
"loopback-component-migrate": {
"key": "value"
}
}
Options:
log
[String] : Name of the logging class to use for log messages. (default: 'console')
enableRest
[Boolean] : A boolean indicating wether migrate/rollback REST api methods should be exposed on the Migration model. (default: false)
migrationsDir
[String] : Directory containing migration scripts. (default: server/migrations)
dataSource
[String] : Datasource to connect the Migration and MigrationMap models to. (default: db)
acls
[Array] : ACLs to apply to Migration and MigrationMap models. (default: [])
Migrations can be run by calling the static migrate
method on the Migration model. If you do not specify a callback, a promise will be returned.
Run all pending migrations:
Migrate.migrate('up', function(err) {});
Run all pending migrations upto and including 0002-somechanges:
Migrate.migrate('up', '0002-somechanges', function(err) {});
Rollback all migrations:
Migrate.migrate('down', function(err) {});
Rollback migrations upto and including 0002-somechanges:
Migrate.migrate('down', '0002-somechanges', function(err) {});
module.exports = {
up: function(app, next) {
app.models.Users.create({ ... }, next);
},
down: function(app, next) {
app.models.Users.destroyAll({ ... }, next);
}
};
/* executing raw sql */
module.exports = {
up: function(app, next) {
app.dataSources.mysql.connector.query('CREATE TABLE `my_table` ...;', next);
},
down: function(app, next) {
app.dataSources.mysql.connector.query('DROP TABLE `my_table`;', next);
}
};
FAQs
Migration framework for Loopback.
The npm package loopback-component-migrate receives a total of 71 weekly downloads. As such, loopback-component-migrate popularity was classified as not popular.
We found that loopback-component-migrate demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.