I am absolutely new to Postgres. I have previously set up a sails app using MongoDB as the underlying database. It was quite simple. However, with postgres, I am facing some issues.
I am following this tutorial
Here are the contents of my config/local.js file
//config/local.js
module.exports = {
port: process.env.PORT || 1337,
environment: process.env.NODE_ENV || 'development',
adapters: {
'default': 'postgres',
postgres: {
module : 'sails-postgresql',
host : 'localhost',
port : 5432,
user : 'root',
password : '',
database : 'postgres',
schema: true //This makes sure that sails matches
//the database schema to your models.
}
}
};
When I run sails lift with verbose logs, The process gets stuck at the following stage:
verbose: Grunt ::
Running "sails-linker:devTplJADE" (sails-linker) task
verbose: Grunt ::
verbose: Grunt :: Running "watch" task
verbose: Grunt :: Waiting...
Any help ?
EDIT:
It's working now. Had to create a unix user with the same name as postgre user and db.
Now the porblem is, I want to create a table with two columns
CREATE TABLE users ( user_id serial, user_name varchar(50) );
I create this schema in postgre. The when I submit a POST request, it overrides the schema. I don't want that to happen. Any clues?