Closed FLavalliere closed 7 years ago
One way I've done it currently is to comment the following line:
callback(null);
/* model.updateTable(err => {
if (err) {
model.log.warn({ err: err }, 'failed to update table %s: %s', tableName, err);
return callback(err);
}
model.log.info('waiting for table: %s to become ACTIVE', tableName);
internals.waitTillActive(model, callback);
});
*/
Just for testing.
I'm a little confused why you'd need to call createTables
if you know the tables exist. I have an application config setting that allows us to trigger table creation based off a flag or environment variable:
function maybeCreateTables(config, callback) {
if (config.createTables) {
console.log('CREATING TABLES...'); // eslint-disable-line
return dynogels.createTables(callback);
}
return callback();
}
If I've misunderstood the question then please let me know. Thanks
Hmm, i see... I though to use the "models" we had to wrap the object inside the createTables(callback);
The models need to have been initialised by calling define
method. As long as that is called before you use it then there shouldn't be a problem.
This could speed-up the environment in the event large of amount of table are being used. With a specific flag, it would assume that the table are already existing and in the right format.