August 2016
Intermediate to advanced
376 pages
6h 33m
English
Let's create the schema that will store in the database the data of each band that the user creates in the system.
sequelize model:create --name Band --attributes "name:string,
description:string, album:string, year:string, UserId:integer"
'use strict'; module.exports = function(sequelize, DataTypes) { var Band = sequelize.define('Band', { name: DataTypes.STRING, description: DataTypes.STRING, album: DataTypes.STRING, year: DataTypes.STRING, UserId: DataTypes.INTEGER }, { classMethods: { associate: function(models) { // associations can ...Read now
Unlock full access