简体   繁体   中英

PG Error trying to push rails db to heroku

I'm trying to push my rails db to heroku using: heroku run rake db:migrate and getting the following error:

=  ChangeDateFormatInMyTable: migrating ======================================
-- change_column(:users, :date_of_birth, :datetime)
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR:  column "date_of_birth" cannot be cast to type "pg_catalog.timestamp"
: ALTER TABLE "users" ALTER COLUMN "date_of_birth" TYPE timestamp

Try a heroku run rake db:reset

Often times with Heroku and my PG Database, I have to do resets when I have massively changed things.

Yes "Heroku run rake db:reset" definitely works. I have been having a similar problem

RemoveGirthFromProfile: migrating =========================================
-- remove_column(:profiles, :girth)
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR:  column "girth" of relation "profiles" does not exist
: ALTER TABLE "profiles" DROP "girth"

but when i reseted the database it solve the application errors i was even having on heroku

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM