$ heroku run rails db:setup
... FATAL: permission denied for database "postgres"
DETAIL: User does not have CONNECT privilege.
heroku run rails db:migrate
For Rails apps you should look to use db:schema:load, db:structure:load or db:migrate instead of db:setup.