mecano
Version:
Common functions for system deployment.
32 lines (29 loc) • 738 B
JavaScript
// Generated by CoffeeScript 1.11.1
var db;
module.exports = function(options) {
var k, ref, ref1, v;
if (options.db == null) {
options.db = {};
}
ref = options.db;
for (k in ref) {
v = ref[k];
if (options[k] == null) {
options[k] = v;
}
}
if (!options.engine) {
throw Error('Missing option: "engine"');
}
options.engine = options.engine.toLowerCase();
if ((ref1 = options.engine) !== 'postgres') {
throw Error("Unsupport engine: " + (JSON.stringify(options.engine)));
}
if (options.schema == null) {
options.schema = options.argument;
}
return this.execute({
cmd: db.cmd(options, "DROP SCHEMA IF EXISTS " + options.schema + ";")
});
};
db = require('../../misc/db');