Skip to content
Advertisement

Tag: sequelize.js

How to seed a one file only with sequelize-cli?

sequqlize-cli db:seed:all is working fine, but how to seed only one file? Tried to db:seed:[name-that-i-gave-with-create-command] and db:seed:[full-path-to-seed-file.js] but it doesnt work. It outputs nothing. Docs say sequelize db:seed Run specified seeder But how to do that? Answer To run a specific seed indicate –seed <seed_file_nams.js>:

Apply filters to a list and show data

Front-end: After return(): Service.js: Controller.js: So, this page of my web-app serves to show a list of all the companies saved in my database. I created a filter that allows you to show only those of a certain type, via findByType. I would like to insert other filters such as: findByRevenue, findByEmployeesNumber. I don’t know if should I write new

Why sequelize ignore the references property?

I using sequelize: I have two tables in my sql database: user and task. task_user_id in task table has references to user table: So why when I run findAll function I don’t get the user details inside the object I’m getting? Maybe something missing in my code? task.ts: user.ts: Answer In order to request a model with linked models you

AuthenticationController always throws error, TypeError: Cannot read property ‘create’ of undefined

I have an issue with the Authenticati onController used with sequelize and sqlite When I test the POST request using postman, it always gives status 400 with the response { error: ‘Something is wrong’ } This is the log ::1 – – [21/Jul/2020:15:40:33 +0000] “POST /register HTTP/1.1” 400 30 “-” “PostmanRuntime/7.26.1” Here is the code of AuthenticationController User model code

Sequelize CLI migration error “Cannot read property ‘type’ of undefined” when creating table with db:migrate

I’m running yarn sequelize db:migrate to create the table in the database using a postgres image in the docker and returns the following message: Configuration of the .sequelizerc file: Code to create the table in the file migrations.js: OS: Linux Focal Fossa 20.04 LTS Would anyone know what the possible solution would be? Answer Error seems to be a typo,

Advertisement