We use only mysql, so updating this means a lot of unused db backends like sqlite do not need to be built with gyp anymore. Note that this version is not yet released as stable, but works fine for us. The outstanding issues are not related to our use-case from what I can tell. Fixes #82
22 lines
594 B
JavaScript
22 lines
594 B
JavaScript
'use strict';
|
|
|
|
exports.up = function(db, callback) {
|
|
var cmd = "CREATE TABLE IF NOT EXISTS groupMembers(" +
|
|
"groupId VARCHAR(128) NOT NULL," +
|
|
"userId VARCHAR(128) NOT NULL," +
|
|
"FOREIGN KEY(groupId) REFERENCES groups(id)," +
|
|
"FOREIGN KEY(userId) REFERENCES users(id));";
|
|
|
|
db.runSql(cmd, function (error) {
|
|
if (error) console.error(error);
|
|
callback(error);
|
|
});
|
|
};
|
|
|
|
exports.down = function(db, callback) {
|
|
db.runSql('DROP TABLE groupMembers', function (error) {
|
|
if (error) console.error(error);
|
|
callback(error);
|
|
});
|
|
};
|