- Notifications
You must be signed in to change notification settings - Fork 369
Open
Description
I already know the way to defining when define models like this.
db.define('likes_user', { userId: {type: 'integer', unique: 'userId_targetId'}, targetId: {type: 'integer', unique: 'userId_targetId'} })but i define those keys automatically when make associations.
so i want to know is there any ways for defining unique keys when make associations :(
here is my codes for associations. need helps!
LikesUser.hasOne('target', Users, {reverse: 'likes', field: 'targetId', mapsTo: 'target_id', required: true}) LikesUser.hasOne('user', Users, {reverse: 'likeUsers', field: 'userId', mapsTo: 'user_id', required: true})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels