When I run the command heroku run rake db:migrate for deploy my app to Heroku, I get this error:
PG::Error: ERROR: relation "roles" does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"roles"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Tasks: TOP => db:reset => environment
(See full trace by running task with --trace)
Also I have tried heroku run rake db:reset or heroku restart, but didn’t help me.
The RoR & PostgreSQL version I used in the app is
gem 'rails', '3.2.1'
gem 'pg', '~> 0.13.2'
On localhost is working everything well, but because of this error I can migrate my database to Heroku.
Could anyone give me please some advice, how to solve this problem?
Thank you so much
rails rake commands are restricted on Heroku. You can use ‘heroku pg’ to manipulate the db. ‘heroku pg help’ to see all available commands.
Try
Then: heroku run rake db:migrate
Then restart: heroku restart