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
19 lines
614 B
JavaScript
19 lines
614 B
JavaScript
'use strict';
|
|
|
|
var fs = require('fs'),
|
|
async = require('async'),
|
|
path = require('path');
|
|
|
|
exports.up = function(db, callback) {
|
|
var schema = fs.readFileSync(path.join(__dirname, 'initial-schema.sql')).toString('utf8');
|
|
var statements = schema.split(';');
|
|
async.eachSeries(statements, function (statement, callback) {
|
|
if (statement.trim().length === 0) return callback(null);
|
|
db.runSql(statement, callback);
|
|
}, callback);
|
|
};
|
|
|
|
exports.down = function(db, callback) {
|
|
db.runSql('DROP TABLE users, tokens, clients, apps, appPortBindings, authcodes, settings', callback);
|
|
};
|