enable email for existing cloudrons
This commit is contained in:
@@ -2,8 +2,13 @@ var dbm = global.dbm || require('db-migrate');
|
||||
var type = dbm.dataType;
|
||||
|
||||
exports.up = function(db, callback) {
|
||||
// everyday at 1am
|
||||
db.runSql('INSERT settings (name, value) VALUES("mail_config", ?)', [ JSON.stringify({ enabled: false }) ], callback);
|
||||
db.all('SELECT * FROM users WHERE admin=1', function (error, results) {
|
||||
if (error) return done(error);
|
||||
|
||||
// existing cloudrons have email enabled by default. future cloudrons will have it disabled by default
|
||||
var enable = results.length !== 0;
|
||||
db.runSql('INSERT settings (name, value) VALUES("mail_config", ?)', [ JSON.stringify({ enabled: enable }) ], callback);
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function(db, callback) {
|
||||
|
||||
Reference in New Issue
Block a user