I have successfully imported a PostgreSQL dump and linked it with my Rails application.
When trying to run rails migrations I get this error:
ActiveRecord::NoDatabaseError: FATAL: role "username" does not exist
Where "username" is my account name. I have the following configuration in the database.yml file:
development: &default
  adapter: postgresql
  encoding: unicode
  database: name_of_the_db
  host: localhost
  username: postgres
  password: password
  template: template0
I would like to run the migrations with the postgres user, not creating a new role like in this answer.
Why is username being used as the role for the migrations? I thought the user defined in the database.yml would be used.
How can I config postgres instead?
Edit:
I've made the following changes to my pg_hba.conf file:
# Database administrative login by Unix domain socket
local   all             postgres                                password
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     password
But I've only been able to change the way the user authenticates, not which user is used on the migrations. I can't see how to change that in this file.
 
    