507 questions
-4 votes
0 answers
27 views
Dockerize backend ExpressJS made with sequelize [closed]
I'm trying to fully Dockerize my application, which includes: Next.js (frontend) Express.js (backend) PostgreSQL Sequelize ORM for models and migrations my backend can't connect to the PostgreSQL ...
0 votes
2 answers
52 views
sequelize relationships Cannot read properties of undefined (reading 'hasMany')
I'm trying to integrate sequelize with the db conection to postgres and i am getting an error where relationships are built. i don't know if i'm missing something at this point index.js 'use strict'; ...
1 vote
0 answers
29 views
Cannot generate model using sequelize-cli enum with defaultValue
My sequelize-cli is npx sequelize-cli model:generate --name Profile --attributes username:string,imageUrl:string,fullname:string,dateOfBirth:date,UserId:UUID,role:enum:'{staff,admin}':defaultValue:...
0 votes
1 answer
73 views
Using import vs require with Node and Sequelize
I'm using type module/import syntax for the rest of my project, but the Sequelize CLI generates files with require syntax. How should I handle this? I'm already having trouble with not being able to ...
1 vote
1 answer
52 views
Netlify app can't login to Express app only on mobile
I have a Vue 3 app hosted on Netlify, and the backend is hosted on Heroku. The login is a simple /login endpoint made with Express and Sequelize. It works well on desktop, but when I try to log in on ...
0 votes
0 answers
31 views
Using Sequelize to define a 1:m relationship between two models (+ creating migrations)
I am confused on the intended workflow with Sequelize. I have found some documentation that refers to a workflow that uses sequelize-cli, while others seem to create bespoke one-off javascript scripts ...
0 votes
1 answer
54 views
In nodejs (sequelize), Add new key or column in MySql via migration
In nodejs (sequelize) ,Add new key or column in MySql via migration but it is not defined in the model so how it update automatically in the model I have make new migration on adding new column and ...
0 votes
1 answer
31 views
Sequelize column region.region_id does not exist error
What am i missing? any help is appreciated. Thanks facility migration file await queryInterface.createTable("facility", { id: { allowNull: false, autoIncrement: true, ...
0 votes
0 answers
36 views
Error Implementing Lifecycle Hooks for Password Hashing with Sequelize-Typescript
I am working on a Node.js project using Sequelize-Typescript, and I'm trying to hash user passwords using lifecycle hooks (BeforeCreate and BeforeUpdate). However, I encounter an error related to how ...
0 votes
0 answers
112 views
SequelizeConnectionError: role "node" does not exist
I have integrated sequlize into my NextJS project. Also, write the migration script for the schemas to be created into PostgreSQL. But, at the time of POST api call I am receiving the error saying: &...
0 votes
1 answer
65 views
Getting error in fetching data with Sequelize for Mysql Database (Backend Node.js)
I am using Sequelize ORM with mysql database for nodejs application. Somewhere I am stuck with one api whose job is just to show list based on the queryparam values. Issue is when I am not applying ...
1 vote
0 answers
40 views
SequelizeCLI: Cannot read properties of undefined (reading 'findAll')
I'm trying to build a simple next.js app using Sequelize CLI. However, there are issues with querying the database (migrations are run and all so DB connection is good). For instance: import { ...
0 votes
1 answer
389 views
How to fix sequelize 'npx sequelize-cli db:migrate' from docker-compose.yml?
I am facing Sequelize CLI [Node: 21.7.1, CLI: 6.6.2, ORM: 6.37.1] | | Loaded configuration file "database/config/config.json". | Using environment "production". | ERROR: Access ...
0 votes
1 answer
733 views
Cannot read properties of undefined (reading 'use_env_variable') when connect to DB
I'm trying to connect the DataBase with Sequelize and NodeJS but an error happen and I can't connect to DB. Through inspection I see that the 'config' variable is null and 'config.use_env_variable' ...
0 votes
0 answers
93 views
sequelize: How to count a select subquery
I dont know how to create a non-raw query using sequelize like this: SELECT COUNT(res.id) FROM ( SELECT clients.id, COUNT(client_addresses.id) AS total_client_addresses ...