Git Product home page Git Product logo

u3_lab_sequelize_associations_exercise's Introduction

Associations Exercise

Getting Started

  • Fork and Clone
  • npm install
  • npm run test (Ensure that everything was installed correctly)
  • npx sequelize-cli db:create
  • npx sequelize-cli db:migrate
  • npx sequelize-cli db:seed:all

Overview

We'll be practicing associating the provided models. Foreign Keys have already been set up for you in the migrations. To confirm this open psql and connect to associations_development. Verify the schema is setup and the tables were created successfully. You'll only be working in the User and Article models. Utilizing the Resources Provided, associate the provided models and eager load the associated data. You must have 3 passing tests for completion. Run npm run test to check your work. Write your queries in the provided query.js file.

The associations are as follows:

  • User has many Articles as creator
  • Article belongs to User as creator

BONUS

  • User belongs to many Articles as bookmarks through UserBookmark
  • Article belongs to many User as bookmarks through UserBookmark

Lab

You'll need to setup the associations in the respective model in order for the queries to complete correctly. Run npm run test to check your work. If everything was done correctly 2 tests should pass. (3rd test is a bonus.)

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.