fields: [ 'podId' ]
},
{
- fields: [ 'userId' ]
+ fields: [ 'userId' ],
+ unique: true
+ },
+ {
+ fields: [ 'name', 'podId' ],
+ unique: true
}
],
classMethods: {
if (transaction) query.transaction = transaction
this.findOrCreate(query).asCallback(function (err, result) {
+ if (err) return callback(err)
+
// [ instance, wasCreated ]
- return callback(err, result[0])
+ return callback(null, result[0])
})
}