
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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 2 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.