'PG::UndefinedTable: ERROR: relation "entries" does not exist

I'm trying to deploy a simple Rails app in heroku but I'm getting this message in the heroku logs: PG::UndefinedTable: ERROR: relation "entries" does not exist

My migration file is like this:

class CreateEntries < ActiveRecord::Migration[6.0]
  def change
    create_table :entries do |t|
      t.string :meal_type
      t.integer :calories
      t.integer :proteins
      t.integer :carbs
      t.integer :fats

      t.timestamps
    end
  end
end

I've tried a few thing(including changing the name of the migration file manuallly) but don't know what to do.

terminal



Solution 1:[1]

Did you run the migrations in heroku? if not then you can do it like this: heroku run rake db:migrate --app=your_app_name

Solution 2:[2]

Probably you don't have an 'entries' column on your DB

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arianit Gerqina
Solution 2 Kürşat Karslı