parent
d7112909eb
commit
9291cbafdc
|
@ -26,7 +26,8 @@ exports.initialize = function initializeSchema(schema, callback) {
|
|||
|
||||
// schema.client.query('SET TIME_ZONE = "+04:00"', callback);
|
||||
schema.client.query('USE `' + s.database + '`', function (err) {
|
||||
if (err && err.message.match(/(^|: )unknown database/i)) {
|
||||
if (err) {
|
||||
if (err.message.match(/(^|: )unknown database/i)) {
|
||||
var dbName = s.database;
|
||||
schema.client.query('CREATE DATABASE ' + dbName, function (error) {
|
||||
if (!error) {
|
||||
|
@ -35,6 +36,7 @@ exports.initialize = function initializeSchema(schema, callback) {
|
|||
throw error;
|
||||
}
|
||||
});
|
||||
} else throw error;
|
||||
} else callback();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue