0
我已經安裝了RefineryCMS應用程序,並且一切正常,直到我決定安裝其Blog引擎。使用Blog引擎創建數據庫時出錯
我們我跑的應用程序遷移(包括博客)從頭開始,我收到以下錯誤:
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)
我看到這是一個known issue,但我不能找到既很好地解決開發和生產環境。
順便說一句,我看到這發生在我使用rails g engine_name
命令安裝的自定義引擎。奇怪的是,如果在之前運行過所有先前的遷移之後運行這些遷移,則不會發生這種情況。它只是在從頭開始運行所有應用程序遷移時發生。
任何想法?
UPDATE:
這是我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
但它仍然沒有工作。有任何想法嗎?
這不是解決問題。我將編輯帖子以便使用此代碼進行更新。 – 2011-05-23 15:53:11