1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/migrations/20141020151056-initial-schema.js

13 lines
423 B
JavaScript
Raw Normal View History

2014-10-20 17:46:41 +02:00
var fs = require('fs');
var util = require('util');
var path = require('path').resolve(__dirname, 'sql/001-initial-schema.%s.sql');
exports.up = function(db, callback) {
var content = fs.readFileSync(util.format(path, 'up'), {encoding: 'utf8'});
db.runSql(content, callback);
};
exports.down = function(db, callback) {
db.runSql(fs.readFileSync(util.format(path, 'down'), {encoding: 'utf8'}), callback);
};