J
J
jenya77712018-07-17 18:31:53
Node.js
jenya7771, 2018-07-17 18:31:53

How to make a sequelize request?

Hello, how to get all records from the table of codes of a certain user, in which there is an ad id, but no user id, and the user id is in the ad table?

const codes = sequelize.define('codes', {
  ads_id: { 
    type: Sequelize.INTEGER,
    allowNull: false
  },
  name: { 
    type: Sequelize.STRING,
    allowNull: true
  },

})

const codes = sequelize.define('ads', {
  user_id: { 
    type: Sequelize.INTEGER,
    allowNull: false
  },
  name: { 
    type: Sequelize.STRING,
    allowNull: true
  },

})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question