Skip to content

Commit

Permalink
Fix error when using require
Browse files Browse the repository at this point in the history
  • Loading branch information
rafiss committed Jan 11, 2022
1 parent 7cabe7c commit 47d245d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Install Sequelize dependencies
working-directory: ./.downloaded-sequelize
run: npm install
run: npm install --ignore-scripts

- name: Provide the `sequelize-cockroachdb` patches
# This script needs `fs-jetpack` as an extra dependency
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"mocha": "^8.2.0",
"p-timeout": "^4.1.0",
"prettier": "2.2.1",
"sequelize": "^6.3.5",
"sequelize": "^6.13.0",
"sinon": "^9.2.4",
"sinon-chai": "^3.5.0"
},
Expand Down
4 changes: 2 additions & 2 deletions source/index.js
Expand Up @@ -51,7 +51,7 @@ if (semver.satisfies(sequelizeVersion, '5.x')) {

//// [2] Disable `EXCEPTION` support

const PostgresDialect = require('sequelize/lib/dialects/postgres');
const PostgresDialect = require('sequelize/lib/dialects/postgres/index');
// This prevents, for example, usage of CREATE/REPLACE FUNCTION when using Model.findOrCreate()
PostgresDialect.prototype.supports.EXCEPTION = false;

Expand Down Expand Up @@ -171,7 +171,7 @@ Model.findByPk = async function findByPk(param, options) {
// Copied from: https://github.com/sequelize/sequelize/blob/29901187d9560e7d51ae1f9b5f411cf0c5d8994a/lib/model.js#L2270
Model.findOrCreate = async function findOrCreate(options) {
const _ = require('lodash');
const Utils = require('sequelize/lib/utils.js');
const Utils = require('sequelize/lib/utils');
const { logger } = require('sequelize/lib/utils/logger');
const sequelizeErrors = require('sequelize/lib/errors');

Expand Down

0 comments on commit 47d245d

Please sign in to comment.