I am using waterline ORM in sails.js. I have a user model and another coins model which associates to the user model.
//coins.js
attributes: {
name: 'string',
// Associations
userId: {
model: 'user'
}
}
The query generated for this model is
CREATE TABLE `coins` (`name` VARCHAR(255) , `userId` INT , `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `createdAt` DATETIME , `updatedAt` DATETIME )
The query should contain foreign key constraint for userId but doesn't. Is there a workaround for this?