Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
MySQL adapter for east which uses the MySQL driver
All executed migrations names will be stored at _migrations
collection in the current database. Object with
following properties will be passed to migrate
and rollback
functions:
db
- instance of the database drivernpm install -g east east-mysql
alternatively you could install it locally
Go to project dir and run
east init
create .eastrc
file at current directory
{
"adapter": "east-mysql",
"url": "mysql://user:password@host/dbname"
}
where url
is url of database which you want to migrate in MySQL URL format
now we can create some migrations
east create users
create files will look like this one
"use strict";
exports.migrate = function (client, done) {
var db = client.db;
done();
};
exports.rollback = function (client, done) {
var db = client.db;
done();
};
Inside the migrations
and rollback
functions you can create the scripts to migrate up to that version
and to rollback from it, eg
exports.migrate = function(client, done) {
var db = client.db;
var sql = "CREATE TABLE users ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP)";
db.query(sql, function (err, rows, fields) {
done(err);
});
};
exports.rollback = function(client, done) {
var db = client.db;
var sql = "DROP TABLE users";
db.query(sql, function (err, rows, fields) {
done(err);
});
};
to execute the migrations
east migrate
to rollback the migration
east rollback
if the database doesn't exist when first migration is created, add the following to the JSON in your .eastrc
file
"createDbOnConnect": true
This will automatically create the database if it doesn't exist
Clone this repo and run npm test
. You can also check code coverage by running grunt coverage
MIT
FAQs
MySQL adapter for "east" (node.js database migration tool)
The npm package east-mysql receives a total of 0 weekly downloads. As such, east-mysql popularity was classified as not popular.
We found that east-mysql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.