Questions tagged [sequelize-cli]

The Sequelize Command Line Interface (CLI) supports for migrations and seeders.

The Sequelize Command Line Interface (CLI) supports for migrations and seeders.

With migrations and seeders it's possible to transfer an existing database into another state and vice versa: those state transitions are saved in migration storage and seeder storage accordingly, which describe the way how to get to the new state and how to revert the changes in order to get back to the old state.

Useful links:


Related tags:

499 questions
0
votes
1 answer

Make Sequelize seed after fields in other columns

Is there any way in Sequelize to add another column and then populate it with the contents of another column(s)?
0
votes
0 answers

Sequelize (4.2.0): Custom validation messages not working with migrations

I am learning how to use sequelize, so far it is a great ORM but I am stuck with the custom validation messages. I am using the sequelize-cli library to handle migration and I found an issue, custom validation messages don't work if you use the…
0
votes
1 answer

Node JS Sequelize, How to sync changes models on migrations

i am using sequelize cli, when i am created a model then migrations automatically created, but when i made changes on my model,then migrations can't automatically updated,so whether we can synchronize the changes that occur in the model to migration…
0
votes
2 answers

Getter method not working on PostgreSQL model

I am defining a getter method on my Users model like so, 'use strict'; module.exports = function(sequelize, DataTypes) { var Users = sequelize.define('Users', { name: DataTypes.STRING, uuid: { type: DataTypes.INTEGER, …
random_coder_101
  • 1,782
  • 3
  • 24
  • 50
0
votes
1 answer

cannot find module model with sequelize

Im trying to do a simple connection between postgres and sql using sequelize, but i get a error where i can't require the model folder, in this tutorial he can require the model folder and add it to the sync, like model.sync, what i need to do. so…
0
votes
2 answers

sequelize seed unable to insert the data in SQLite

I am trying to insert the dummy data using sequelize-cli command sequelize db:seed --seed seeders/20170212081140-subject_tags.js here is my config file { "development": { "username": "root", "password": null, "database":…
made_in_india
  • 2,109
  • 5
  • 40
  • 63
0
votes
1 answer

Sequelize association, one to many, how to retrieve the one when querying the many table?

My associations are Member.hasMany(models.Event); Event.belongsTo(models.Member); I need my query on Event model to retrieve the member data associated with the event. models.Event.findAll() // I need Member associated with each Event. Kind of…
Bhagya M
  • 255
  • 5
  • 7
0
votes
1 answer

Sequelize cli creating association belongsto user or staff

i found many things about associations but nothing to my particular case, i created some models and i'm trying to associate them, so i think it is a matter of understanding database modeling too. I've got the models user and staff, both share an…
BigZ
  • 836
  • 8
  • 19
0
votes
1 answer

Migrations with SequelizeJS and CLI

Currently I have started working on NODE JS where I am using the SEQUELIZE ORM. The Sequelize does support the migrations using sequelize-cli, but the documentation does not explain every details around how it should be used of migrations. I want to…
D Deshmane
  • 1,125
  • 4
  • 15
  • 27
0
votes
1 answer

Sequelize - Unhandled Rejection Error Not Associated

I have received a bizarre association error after running a query with a table join that has a one-to-many relationship with the primary table being queried. Despite having the association set up and relationship displayed in my database as it is…
cphill
  • 5,596
  • 16
  • 89
  • 182
0
votes
1 answer

Sequelizejs / unknown relation "xxx" after multiple tests runs

So far the setup works very fine using the database with nodejs. I've put it all on circleci, the tests are run via mocha and outputs junit Fresh database (meaning just created it and ran migrations, no tests yet), the tests pass with no problems.…
Ben
  • 5,030
  • 6
  • 53
  • 94
0
votes
1 answer

Sequelize CLI Migration classMethod Change

I am trying to update the relationship between tables in my model files that have a many-to-many relationship. I am currently getting errors with a command that I am trying to use to the default nature that the relationship must be unique. As a…
cphill
  • 5,596
  • 16
  • 89
  • 182
0
votes
1 answer

How to put condition in included model Sequelize?

I tried to put a custom condition on included model's column to be equal to value of parent model column but it is not working as expected in sequelize 3.8.7 module. Below is the code i tried Quotes.findOne({ where: {'id' : req.body.quoteId}, …
Rajendra Khabiya
  • 1,990
  • 2
  • 22
  • 39
0
votes
0 answers

Node JS Sequelize ORM date issue

I am using sequelize ORM of node js to connect to mysql database. I am having a field named "dob (date of birth)" that is of type date. When I am storing any value in that field it is storing properly, but while fetching it is giving one date less…
Swapnil Punekar
  • 197
  • 1
  • 10
0
votes
1 answer

Non mapped properties - Sequelize

The supports are: React, Redux and Sequelize. Basically I want to be able to mark an object as being dirty when the Redux store gets updated. function updateCar(carToUpdate, car) { switch(car[1]) { case "models": …
Tikkes
  • 4,599
  • 4
  • 36
  • 62
1 2 3
33
34