so my application worked fine. I created a new model and some associations, providing all the old seed data in my heroku application is useless. so I tried reset it and filled it again. but I can't even transfer my db to a hero using the heroku rake db:migrate command. I am using SQLite, but it seems my error is related to Postgres. I don't know what that means if anything
Here is the error:
rake aborted! An error has occurred, this and all later migrations canceled: PGError: ERROR: column "to" cannot be cast to type "pg_catalog.int4" : ALTER TABLE "emails" ALTER COLUMN "to" TYPE integer Tasks: TOP => db:migrate
My migration:
class ChangeDataTypeForEmailUsers < ActiveRecord::Migration def self.up change_column :emails, :to, :integer change_column :emails, :from, :integer end def self.down change_column :to, :string change_column :from, :string end end
What is the problem? My deployed application is working fine. I added a new model and decided that I should reset the deployed database. So, I ran heroku pg:reset , and then clicked my code on the hero. then tried to migrate db, but it does not work! What I've done? I have been trying to figure this out for the last 4 hours. I can’t think straight. Any help would be greatly appreciated.
Brian source share