---
title: "#foreignkey articles | Hashnode"
description: "Explore 1 articles tagged #foreignkey on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/foreignkey"
---

Tag

# #foreignkey

1 posts · 0 followers

[Suman Adhikari](https://hashnode.com/@SumanAdhikari) · [Aug 18, 2023](https://hashnode.com/posts/define-association-in-sequelize-nest-js/64df20ffcaac9dadf50d2a4d)

### [Define association in Sequelize - Nest js](https://sumanad.hashnode.dev/define-association-in-sequelize-nest-js?utm_source=hashnode&utm_medium=feed)

Say we have two model portfolio and stock. Each item from the portfolio belongs to one stock. We need to define this relationship in sequelize. The general rule is to have a column stockId in the portfolio that will map with the id from stock table. ...

2 min read · [sumanad.hashnode.dev](https://sumanad.hashnode.dev/define-association-in-sequelize-nest-js?utm_source=hashnode&utm_medium=feed)
