Fix error when creating a fresh database
This commit is contained in:
parent
6086242524
commit
59c857da59
3 changed files with 7 additions and 3 deletions
|
@ -89,7 +89,12 @@ database.init = async (silent: boolean) => {
|
|||
|
||||
for (const modelName of Object.keys(database)) {
|
||||
if ('associate' in database[modelName]) {
|
||||
database[modelName].associate(database)
|
||||
try {
|
||||
database[modelName].associate(database)
|
||||
} catch (err) {
|
||||
logger.error('Cannot associate model %s.', modelName, err)
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue