I have run a migration when trying to change on heroku table column from string to integer: This is my migration:
class ChangePriceTypeInItems < ActiveRecord::Migration
def change
change_column :items, :price, :integer
end
end
And this is my error: What do I do?
ActiveRecord::StatementInvalid: PG::Error: ERROR: column "price" cannot be cast automatically to type integer
HINT: You might need to specify "USING price::integer".
: ALTER TABLE "items" ALTER COLUMN "price" TYPE integer