I'm using sails.js and mySQL db to build a website. For solving this particular problem, I have thought of pre-defining my ID attribute of my model(taking care of uniqueness by using the timestamp). So once I create a record with the ID that I've defined, I will be able to associate the files(which I upload using JQuery file upload plugin) with this particular record that I created. But I am not sure how to do this in sails.js. Is this possible?
Or can I just define a separate attribute which will have the property unique: true
and generate it on front end and pass it over to backend and use this attribute to associate my files.