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

Commit 3dce6292 by Jan Aagaard Meier

Merge pull request #4989 from oravecz/patch-1

[ci skip] Doc change - custom auto-generated values
2 parents 9ff2fed3 d60dbd7c
Showing with 14 additions and 0 deletions
...@@ -36,6 +36,20 @@ var util = require('util') ...@@ -36,6 +36,20 @@ var util = require('util')
* } * }
* }) * })
* ``` * ```
* There may be times when you want to generate your own UUID conforming to some other algorithm. This is accomplised
* using the defaultValue property as well, but instead of specifying one of the supplied UUID types, you return a value
* from a function.
* ```js
* sequelize.define('model', {
* uuid: {
* type: DataTypes.UUID,
* defaultValue: function() {
* return generateMyId()
* },
* primaryKey: true
* }
* })
* ```
* *
* @class DataTypes * @class DataTypes
*/ */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!