Kevin K
Kevin K

Reputation: 2227

Heroku rake db:migrate aborted

I have an app which is working fine in development, but when I pushed it to heroku and tried to run "heroku run rake db:migrate", the rake aborted with the following message:

rake aborted!
PG::Error: ERROR:  relation "submissions" does not exist
LINE 4:              WHERE a.attrelid = '"submissions"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"submissions"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum

I am not sure where to begin testing this. I can't find a problem in my schema. rake db:setup doesn't work either. Here is my schema:

ActiveRecord::Schema.define(:version => 20120913202908) do

  create_table "active_admin_comments", :force => true do |t|
    t.string   "resource_id",   :null => false
    t.string   "resource_type", :null => false
    t.integer  "author_id"
    t.string   "author_type"
    t.text     "body"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
    t.string   "namespace"
  end

  add_index "active_admin_comments", ["author_type", "author_id"], :name => "index_active_admin_comments_on_author_type_and_author_id"
  add_index "active_admin_comments", ["namespace"], :name => "index_active_admin_comments_on_namespace"
  add_index "active_admin_comments", ["resource_type", "resource_id"], :name => "index_admin_notes_on_resource_type_and_resource_id"

  create_table "admin_users", :force => true do |t|
    t.string   "email",                  :default => "", :null => false
    t.string   "encrypted_password",     :default => "", :null => false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          :default => 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at",                             :null => false
    t.datetime "updated_at",                             :null => false
  end

  add_index "admin_users", ["email"], :name => "index_admin_users_on_email", :unique => true
  add_index "admin_users", ["reset_password_token"], :name => "index_admin_users_on_reset_password_token", :unique => true

  create_table "categories", :force => true do |t|
    t.string   "name"
    t.text     "description"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
    t.integer  "festival_id"
  end

  create_table "categories_users", :id => false, :force => true do |t|
    t.integer "category_id", :null => false
    t.integer "user_id",     :null => false
  end

  create_table "festivals", :force => true do |t|
    t.date     "opening_date"
    t.date     "closing_date"
    t.string   "title"
    t.string   "slogan"
    t.string   "tag"
    t.datetime "submission_start_date"
    t.datetime "submission_end_date"
    t.boolean  "published"
    t.datetime "created_at",            :null => false
    t.datetime "updated_at",            :null => false
  end

  create_table "links", :force => true do |t|
    t.string   "name"
    t.string   "url"
    t.string   "kind"
    t.integer  "submission_id"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
  end

  create_table "performers", :force => true do |t|
    t.string   "name"
    t.string   "email"
    t.integer  "submission_id"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
  end

  create_table "submissions", :force => true do |t|
    t.string   "show_title"
    t.string   "group_name"
    t.string   "home_city"
    t.string   "home_theater"
    t.string   "country"
    t.text     "promotional_description"
    t.text     "additional_information"
    t.string   "contact_name"
    t.string   "contact_phone"
    t.string   "contact_email"
    t.boolean  "glbt_showcase"
    t.boolean  "diversity_showcase"
    t.integer  "user_id"
    t.integer  "category_id"
    t.datetime "created_at",              :null => false
    t.datetime "updated_at",              :null => false
  end

  create_table "users", :force => true do |t|
    t.string   "email",                  :default => "", :null => false
    t.string   "encrypted_password",     :default => "", :null => false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          :default => 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at",                             :null => false
    t.datetime "updated_at",                             :null => false
    t.string   "name"
    t.string   "confirmation_token"
    t.datetime "confirmed_at"
    t.datetime "confirmation_sent_at"
    t.string   "unconfirmed_email"
    t.boolean  "curator"
  end

  add_index "users", ["email"], :name => "index_users_on_email", :unique => true
  add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true

  create_table "venues", :force => true do |t|
    t.string   "name"
    t.string   "address1"
    t.string   "address2"
    t.string   "city"
    t.string   "state"
    t.string   "zip"
    t.string   "box_office_number"
    t.string   "website"
    t.string   "stage_name"
    t.text     "description"
    t.string   "contact_name"
    t.string   "contact_phone_number"
    t.string   "contact_email"
    t.datetime "created_at",           :null => false
    t.datetime "updated_at",           :null => false
  end

end

Any suggestions of where I should look for the problem? What I should be searching for?

I've seen a number of similar problems, but there doesn't seem to be a clear answer of what to look for.

UPDATE: Here is my initializer for ActiveAdmin:

ActiveAdmin.setup do |config|
  config.site_title = "Cif4"
  config.authentication_method = :authenticate_admin_user!
  config.current_user_method = :current_admin_user
  config.logout_link_path = :destroy_admin_user_session_path
  config.batch_actions = true
end

Upvotes: 0

Views: 287

Answers (1)

Michael Durrant
Michael Durrant

Reputation: 96454

This has happened to a lot of people lately due to a change in heroku's pricing and db size.

If your app has over 10,000 rows and you're not on a high enough plan, writes fail.

Our answer to this was that we had to:

1) Select a higehr plan that would allow 400,000 rows, not just 10,000

2) Repoint our app to the new db. I wasn't involved but apparently this step was thought to have been done but actually wasn't, so search on that too if necessary.

Upvotes: 2

Related Questions