Closed reumia closed 6 years ago
I made associations like this.
const LikesComic = db.models['likes_comic'] LikesComic.hasOne('target', Comics) LikesComic.hasOne('user', Users)
then, target_id and user_id columns are created automatically on likes_comic table.
target_id
user_id
likes_comic
and I want to set multiple unique index like this.
// if these columns - user_id & target_id - are not created automatically, db.define('likes_comic', { user_id: {type: 'integer', unique: 'user_id_target_id'}, target_id: {type: 'integer', unique: 'user_id_target_id'} })
my currently defining is like above.
db.define('likes_comic', { // nothings on here. })
is there any way to do this?
moved to #816
I made associations like this.
then,
target_id
anduser_id
columns are created automatically onlikes_comic
table.and I want to set multiple unique index like this.
my currently defining is like above.
is there any way to do this?