Custom Forms

This commit is contained in:
witzig 2017-03-19 13:36:57 +01:00
parent 5332c81739
commit 2e50fbc8ae
67 changed files with 3335 additions and 34834 deletions

View file

@ -204,14 +204,57 @@ function applyUpdate(update, callback) {
});
}
module.exports = callback => {
runUpdates(err => {
function verifyInnodbFileFormat(callback) {
db.getConnection((err, connection) => {
if (err) {
return callback(err);
}
db.end(() => {
log.info('sql', 'Database check completed');
return callback(null, true);
connection.query('SELECT @@GLOBAL.innodb_file_format as value', [], (err, rows) => {
if (err) {
return callback(err);
}
let format = rows && rows[0] && rows[0].value;
if (!format || format.toLowerCase() !== 'barracuda') {
log.warn('sql', 'Temporary setting innodb_file_format to barracuda');
log.warn('sql', 'Please modify the [mysqld] section of your my.cnf');
log.warn('sql', '------------------------------');
log.warn('sql', '[mysqld]');
log.warn('sql', 'innodb_file_per_table = 1');
log.warn('sql', 'innodb_file_format = barracuda');
log.warn('sql', '------------------------------');
connection.query('SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_format = Barracuda', [], err => {
connection.release();
if (err) {
return callback(err);
}
callback(null);
});
} else {
return callback(null);
}
});
});
}
module.exports = callback => {
verifyInnodbFileFormat(err => {
if (err) {
return callback(err);
}
runUpdates(err => {
if (err) {
return callback(err);
}
db.end(() => {
log.info('sql', 'Database check completed');
return callback(null, true);
});
});
});
};