不要怂,就是干,撸起袖子干!

Commit 59cf815e by Sascha Depold

added comment for parsing on sequelizejs.com

1 parent 8d9b79e7
Showing with 15 additions and 7 deletions
var Sequelize = require(__dirname + "/../../lib/sequelize/Sequelize").Sequelize,
sequelize = new Sequelize("sequelize_test", "root", null, {disableLogging: true})
/*
Title: Working with associations
var Person = sequelize.define('person', {
name: Sequelize.STRING
})
This example demonstrates the use of associations.
First of all, Person is getting associated via many-to-many with other Person objects (e.g. Person.hasMany('brothers')).
Afterwards a Person becomes associated with a 'father' and a mother using a one-to-one association created by hasOneAndBelongsTo.
The last association has the type many-to-one and is defined by the function hasManyAndBelongsTo.
The rest of the example is about setting and getting the associated data.
*/
var Pet = sequelize.define('pet', {
var Sequelize = require(__dirname + "/../../lib/sequelize/Sequelize").Sequelize,
sequelize = new Sequelize("sequelize_test", "root", null, {disableLogging: true}),
Person = sequelize.define('person', {
name: Sequelize.STRING
})
}),
Pet = sequelize.define('pet', {
name: Sequelize.STRING
})
Person.hasMany('brothers')
Person.hasMany('sisters')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!