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

Commit 88217aea by Jan Aagaard Meier

Merge pull request #4399 from pensierinmusica/patch-1

[ci skip] 📝 Added details about "unique" property (closes #4329)
2 parents 81063c12 ba2b2600
Showing with 6 additions and 0 deletions
......@@ -38,6 +38,12 @@ var Foo = sequelize.define('Foo', {
uniqueOne: { type: Sequelize.STRING, unique: 'compositeIndex'},
uniqueTwo: { type: Sequelize.INTEGER, unique: 'compositeIndex'}
// The unique property is simply a shorthand to create a unique index.
someUnique: {type: Sequelize.STRING, unique: true}
// It's exactly the same as creating the index in the model's options.
{someUnique: {type: Sequelize.STRING}},
{indexes: [{unique: true, fields: ['someUnique']}]}
// Go on reading for further information about primary keys
identifier: { type: Sequelize.STRING, primaryKey: true},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!