We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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})
The text was updated successfully, but these errors were encountered:
.hasOne()
No branches or pull requests
I already know the way to defining when define models like this.
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!
The text was updated successfully, but these errors were encountered: