I have a working sails js application with postgresql as database, to improve the performance I am trying to use database views, I was able to sucessfully create the model/controller using sails js generate command, and filled in column names and types just like any other model. I was getting the error: **A hook (`orm`) failed to load!** which I was able to resolve after updating migrate: 'safe' in config->models.js.
But now I am getting server error 500 when trying to access via sails blueprints. Database permissions are OK. Is there anything else required, I searched the documentation but could not find any help on connecting the database views.
**Model**
module.exports = {
migrate: 'safe',
attributes: {
name: {type: 'string'},
enquiryDate: {type: 'datetime'},
totalFee: {type: 'float'},
}
Controller:
**My Setup:**
*"sails": "^0.10.2",
"sails-postgresql": "^0.10.7"*