When I tried to switching from sqlite3 to postgresql in my existing application I faced this problem with rake db:migrate, I did the following
1 - rake db:create
2- rake db:migrate I got this error:
== AddColumn1: migrating ===================================================== -- add_column(:users, :first_name, :string) rake aborted! An error has occurred, this and all later migrations canceled: PG::Error: ERROR: relation "users" does not exist
3- rake db:reset
4- rake db:migrate , now migration is done with no errors
I have lost my data specially my admin user because of rake db:reset and my questions is :
1- why I forced to use rake db:reset ?
2- is there ways to transfer my data from a database engine to another without losing it in the next time ?
3- and for PostgreSQL I couldn’t use a blank password , it said fe_sendauth: no password supplied , after adding password this error is gone , using password in another database engine instead of Sqlite3 is a must ?
4- will heroku require a reset also or its like Github will accept the data if I use another db engine in development ?