Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when using require #143

Merged
merged 1 commit into from Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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