@giftwizard/db-models
Advanced tools
Comparing version 5.0.0 to 5.0.1
17
index.js
const { Sequelize, DataTypes } = require('sequelize'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { logging: { logger } } = require('@giftwizard/utils'); | ||
const _ = require('lodash'); | ||
@@ -15,4 +14,3 @@ const cookie = require('cookie'); | ||
if (!(env.MYSQL_HOST && env.MYSQL_DATABASE && env.MYSQL_USER && env.MYSQL_PASSWORD)) { | ||
logger.fatal(`${env.SERVICE_NAME}(common) - Failed connecting to DB, missing connection details`); | ||
throw new Error('Failed'); | ||
throw new Error(`${env.SERVICE_NAME}(common) - Failed connecting to DB, missing connection details`); | ||
} | ||
@@ -35,3 +33,2 @@ | ||
dialect: 'mysql', | ||
logging: env.SEQUELIZE_DEBUG === 'true' ? logger.debug : false, | ||
retry: { | ||
@@ -71,14 +68,2 @@ match: [/Deadlock/i], | ||
sequelizeConnection | ||
.authenticate() | ||
.then(() => { | ||
logger.info( | ||
`${env.SERVICE_NAME}(common) is connected to MySQL - ${env.MYSQL_HOST}, | ||
replica: ${process.env.MYSQL_READ_REPLICATION_HOSTS} max retry - ${env.MYSQL_MAX_RETRY}`, | ||
); | ||
}) | ||
.catch((error) => { | ||
logger.fatal(`${env.SERVICE_NAME} failed connecting to MySQL`, { error }); | ||
}); | ||
module.exports = db; |
{ | ||
"name": "@giftwizard/db-models", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Rise.ai package for 'sequelize' models used by several projects.", | ||
@@ -20,3 +20,2 @@ "main": "index.js", | ||
"dependencies": { | ||
"@giftwizard/utils": "^5.0.0", | ||
"bcryptjs": "^2.4.3", | ||
@@ -23,0 +22,0 @@ "cookie": "^0.4.1", |
9
3
81798
3074
- Removed@giftwizard/utils@^5.0.0