0

It's giving the following error:

Mysql2::Error: Table 'aperture_developement.content_pages' doesn't exist: SHOW FULL FIELDS FROM `content_pages`

Which is odd, as it should be trying to create that table.

Migration:

class CreateContentPages < ActiveRecord::Migration
  def change
    create_table :content_pages do |t|
      t.string :title
      t.string :permalink
      t.string :subtitle
      t.text :content

      t.timestamps
    end
  end
end

Full trace here

Mild Fuzz
  • 29,463
  • 31
  • 100
  • 148
  • can you paste the code ? – mkk Dec 17 '12 at 23:04
  • have posted the migration, need anything else? – Mild Fuzz Dec 17 '12 at 23:07
  • 1
    Why is the error about creating table.models, when the migration is creating content_pages table? Is it getting hung up on an earlier migration than the one you pasted? – Unixmonkey Dec 17 '12 at 23:13
  • no, I changed the wording initially to be more generic – Mild Fuzz Dec 17 '12 at 23:36
  • So...what did it originally say? How about updating the question with **the actual error**? – deefour Dec 18 '12 at 00:05
  • It would be nice if you show the error message as it is. I think the problem may be a bad configuration or a conflict, for example, check this thread http://stackoverflow.com/questions/12636355/rails-dbmigrate-fails-model-users-doesnt-exist-show-full-fields-from-use (it won't solve your problem, but it suggest you that it could be a bad configuration). When did the problem start? When was your last good migration? What did you do between your good migration and this one? – pablomarti Dec 18 '12 at 02:53
  • Yeah, no problem. I've also attached a full trace of the issue – Mild Fuzz Dec 18 '12 at 07:57
  • By the looks of it the content pages model is being loaded (possibly because of something in your rails admin config) and your model tries to run a query while it's loaded (possibly to define a scope). This is before the migration has run so it all falls over. Not familiar with rails admin so don't know how you'd fix it, but details of your rails admin might help someone who does – Frederick Cheung Dec 18 '12 at 08:18

1 Answers1

0

You may have a filter or something else set up in ActiveAdmin which retrieves ContentPages and which you need to wrap in a proc. See this issue:

https://github.com/gregbell/active_admin/issues/1360

mccannf
  • 16,619
  • 3
  • 51
  • 63