我已经安装了一个RefineryCMS应用程序,在我决定安装它的博客引擎之前一切正常。
我们从头开始运行应用程序迁移(包括博客),我收到以下错误:
Mysql2::Error: Unknown column 'custom_title' in 'field list': INSERT INTO `pages` (`browser_title`, `path`, `meta_description`, `created_at`, `link_url`, `custom_title_type`, `draft`, `title`, `skip_to_first_child`, `deletable`, `updated_at`, `position`, `rgt`, `custom_title`, `meta_keywords`, `parent_id`, `menu_match`, `lft`, `show_in_menu`, `depth`) VALUES (NULL, NULL, NULL, '2011-03-10 16:32:08', '/blog', 'none', 0, 'Blog', 0, 0, '2011-03-10 16:32:08', 2, 8, NULL, NULL, NULL, '^/blogs?(/|/.+?|)$', 7, 1, NULL)
我已经看到这是一个已知问题,但我找不到适用于开发和生产环境的简洁解决方案。
顺便说一句,我使用rails g engine_name
命令安装的自定义引擎看到了这种情况。奇怪的是,如果您在之前的所有迁移都运行过之后运行这些迁移,则不会发生这种情况。它只是在从头开始运行所有应用程序迁移时发生。
有任何想法吗?
更新:
这是我db/seeds/refinerycms_blog.rb
在这里收到评论后的文件:
Page.reset_column_information
User.find(:all).each do |user|
user.plugins.create(:name => "refinerycms_blog",
:position => (user.plugins.maximum(:position) || -1) +1)
end
page = Page.create(
:title => "Blog",
:link_url => "/blog",
:deletable => false,
:position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
:menu_match => "^/blogs?(\/|\/.+?|)$"
)
Page.default_parts.each do |default_page_part|
page.parts.create(:title => default_page_part, :body => nil)
end
但它仍然无法正常工作。有任何想法吗?