Skip to content

Commit 887bacc

Browse files
authored
Update SchemaMigrationService.js
1 parent b77c474 commit 887bacc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

api/services/SchemaMigrationService.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ module.exports = class SchemaMigrationService extends Service {
1313
* @param model model object
1414
*/
1515
dropModel(model) {
16-
const dialect = connection.dialect.connectionManager.dialectName
17-
return model.sequelize.query(dialect === 'sqlite' ? 'PRAGMA foreign_keys = OFF' : 'SET FOREIGN_KEY_CHECKS = 0').then(() => {
16+
return model.sequelize.query('SET FOREIGN_KEY_CHECKS = 0').then(() => {
1817
return model.sync({force: true})
1918
}).then(() => {
20-
return model.sequelize.query(dialect === 'sqlite' ? 'PRAGMA foreign_keys = ON' : 'SET FOREIGN_KEY_CHECKS = 1')
19+
return model.sequelize.query('SET FOREIGN_KEY_CHECKS = 1')
2120
}).catch(err => {
2221
return model.sync({force: true})
2322
})

0 commit comments

Comments
 (0)