alexbevi / redmine_knowledgebase

A knowledgebase plugin for Redmine
453 stars 197 forks source link

Redmine 2.3 -> 3 upgrade error: 20121205100143 AddVersioning: migrating #281

Closed tazzytazzy closed 9 years ago

tazzytazzy commented 9 years ago

Upgrading from redmine 2.3 to 3. Steps: Fresh install of ruby/rails/redmine. Install redmine 3. Copy database settings file. Download/clone knowledgbase plugin. Run: bundle exec rake db:migrate RAILS_ENV=production bundle exec rake redmine:plugins:migrate RAILS_ENV=production

That didn't work. So, then I did this to remove the tables.. This worked, and validated tables are gone (I only had a couple entries, so it doesn't matter):

/opt/redmine/redmine-3.0.3$ bundle exec rake redmine:plugins:migrate NAME=redmine_knowledgebase RAILS_ENV=production VERSION=0 --trace * Invoke redmine:plugins:migrate (first_time) * Invoke environment (first_time) * Execute environment * Execute redmine:plugins:migrate Migrating redmine_knowledgebase (Knowledgebase)... == 20121030102100 AddProjectIdToCategories: reverting ========================= -- remove_column(:kb_categories, :project_id) -> 0.0077s == 20121030102100 AddProjectIdToCategories: reverted (0.0079s) ================

== 20121005075010 AddUpdaterToArticle: reverting ============================== -- remove_column(:kb_articles, :updater_id) -> 0.0056s == 20121005075010 AddUpdaterToArticle: reverted (0.0058s) =====================

== 20110131145123 AddProjectIdToArticles: reverting =========================== -- remove_column(:kb_articles, :project_id) -> 0.0049s == 20110131145123 AddProjectIdToArticles: reverted (0.0051s) ==================

== 20100329103527 AddCommentsCountToArticles: reverting ======================= -- remove_column(:kb_articles, :comments_count) -> 0.0054s == 20100329103527 AddCommentsCountToArticles: reverted (0.0056s) ==============

== 20100317201659 AddRatingsToArticles: reverting ============================= == 20100317201659 AddRatingsToArticles: reverted (0.0021s) ====================

== 20100216000133 AddNestedSetBoundriesToCategory: reverting ================== -- remove_column(:kb_categories, :lft) -> 0.0051s -- remove_column(:kb_categories, :rgt) -> 0.0046s == 20100216000133 AddNestedSetBoundriesToCategory: reverted (0.0101s) =========

== 20100213201848 AddViewingTables: reverting ================================= == 20100213201848 AddViewingTables: reverted (0.0097s) ========================

== 20100213145708 AddAuthorToArticle: reverting =============================== -- remove_column(:kb_articles, :author_id) -> 0.0044s == 20100213145708 AddAuthorToArticle: reverted (0.0046s) ======================

== 20100211212704 CreateArticles: reverting =================================== -- drop_table(:kb_articles) -> 0.0040s == 20100211212704 CreateArticles: reverted (0.0042s) ==========================

== 20100211210218 AddParentIdToCategories: reverting ========================== -- remove_column(:kb_categories, :parent_id) -> 0.0076s == 20100211210218 AddParentIdToCategories: reverted (0.0079s) =================

== 20100210212009 CreateCategories: reverting ================================= -- drop_table(:kb_categories) -> 0.0024s == 20100210212009 CreateCategories: reverted (0.0026s) ========================

* Invoke db:schema:dump (first_time) * Invoke environment * Invoke db:load_config (first_time) * Execute db:load_config \ Execute db:schema:dump

---then tried again----- /opt/redmine/redmine-3.0.3$ rm -rf public/plugin_assets/redmine_knowledgebase/


/opt/redmine/redmine-3.0.3$ bundle exec rake redmine:plugins:migrate NAME=redmine_knowledgebase RAILS_ENV=production --trace * Invoke redmine:plugins:migrate (first_time) * Invoke environment (first_time) * Execute environment * Execute redmine:plugins:migrate Migrating redmine_knowledgebase (Knowledgebase)... == 20100210212009 CreateCategories: migrating ================================= -- create_table(:kb_categories) -> 0.0038s == 20100210212009 CreateCategories: migrated (0.0041s) ========================

== 20100211210218 AddParentIdToCategories: migrating ========================== -- add_column(:kb_categories, :parent_id, :int) -> 0.0058s == 20100211210218 AddParentIdToCategories: migrated (0.0060s) =================

== 20100211212704 CreateArticles: migrating =================================== -- create_table(:kb_articles) -> 0.0049s == 20100211212704 CreateArticles: migrated (0.0051s) ==========================

== 20100213145708 AddAuthorToArticle: migrating =============================== -- add_column(:kb_articles, :author_id, :int, {:default=>0, :null=>false}) -> 0.0051s == 20100213145708 AddAuthorToArticle: migrated (0.0053s) ======================

== 20100213201848 AddViewingTables: migrating ================================= == 20100213201848 AddViewingTables: migrated (0.0232s) ========================

== 20100216000133 AddNestedSetBoundriesToCategory: migrating ================== -- add_column(:kb_categories, :lft, :int) -> 0.0055s -- add_column(:kb_categories, :rgt, :int) -> 0.0059s == 20100216000133 AddNestedSetBoundriesToCategory: migrated (0.0119s) =========

== 20100317201659 AddRatingsToArticles: migrating ============================= == 20100317201659 AddRatingsToArticles: migrated (0.0211s) ====================

== 20100329103527 AddCommentsCountToArticles: migrating ======================= -- add_column(:kb_articles, :comments_count, :int) -> 0.0055s == 20100329103527 AddCommentsCountToArticles: migrated (0.0057s) ==============

== 20110131145123 AddProjectIdToArticles: migrating =========================== -- add_column(:kb_articles, :project_id, :int, {:default=>0}) -> 0.0135s == 20110131145123 AddProjectIdToArticles: migrated (0.0138s) ==================

== 20121005075010 AddUpdaterToArticle: migrating ============================== -- add_column(:kb_articles, :updater_id, :int, {:default=>0, :null=>false}) -> 0.0239s == 20121005075010 AddUpdaterToArticle: migrated (0.0242s) =====================

== 20121030102100 AddProjectIdToCategories: migrating ========================= -- add_column(:kb_categories, :project_id, :int, {:default=>0}) -> 0.0401s == 20121030102100 AddProjectIdToCategories: migrated (0.0404s) ================

== 20121205100143 AddVersioning: migrating ==================================== -- add_column(:kb_articles, :version_comments, :string, {:limit=>255, :default=>""}) -> 0.0293s rake aborted! StandardError: An error has occurred, all later migrations canceled:

Unknown key: :include. Valid keys are: :columns, :project_key, :date_column, :permission, :scope, :preload/usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/core_ext/hash/keys.rb:75:in block in assert_valid_keys' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/core_ext/hash/keys.rb:73:ineach_key' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/core_ext/hash/keys.rb:73:in assert_valid_keys' /opt/redmine/redmine-3.0.3/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:37:inacts_as_searchable' /opt/redmine/redmine-3.0.3/plugins/redmine_knowledgebase/app/models/kb_article.rb:28:in <class:KbArticle>' /opt/redmine/redmine-3.0.3/plugins/redmine_knowledgebase/app/models/kb_article.rb:5:in<top (required)>' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in require' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inblock in require' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in load_dependency' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inrequire' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:360:in require_or_load' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:494:inload_missing_constant' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in const_missing' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:526:inload_missing_constant' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in const_missing' /opt/redmine/redmine-3.0.3/plugins/redmine_knowledgebase/db/migrate/20121205100143_add_versioning.rb:4:inup' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:569:in up' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:609:inexec_migration' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:in block (2 levels) in migrate' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:288:inmeasure' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in block in migrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:inwith_connection' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in migrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:inmigrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in block in execute_migration_in_transaction' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:1043:inddl_transaction' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in execute_migration_in_transaction' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:inblock in migrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in each' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:inmigrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in up' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:inmigrate' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:474:in migrate_plugin' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:446:inmigrate' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:457:in migrate' /opt/redmine/redmine-3.0.3/lib/tasks/redmine.rake:127:inblock (3 levels) in <top (required)>' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in call' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:inblock in execute' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in each' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:inexecute' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/monitor.rb:211:inmon_synchronize' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:165:ininvoke' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:150:in invoke_task' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:inblock (2 levels) in top_level' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in each' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:inblock in top_level' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in run_with_threads' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:100:intop_level' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in block in run' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:176:instandard_exception_handling' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in run' /usr/local/rvm/rubies/ruby-2.2.2/bin/rake:33:in

' ArgumentError: Unknown key: :include. Valid keys are: :columns, :project_key, :date_column, :permission, :scope, :preload /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/core_ext/hash/keys.rb:75:in block in assert_valid_keys' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/core_ext/hash/keys.rb:73:ineach_key' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/core_ext/hash/keys.rb:73:in assert_valid_keys' /opt/redmine/redmine-3.0.3/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb:37:inacts_as_searchable' /opt/redmine/redmine-3.0.3/plugins/redmine_knowledgebase/app/models/kb_article.rb:28:in <class:KbArticle>' /opt/redmine/redmine-3.0.3/plugins/redmine_knowledgebase/app/models/kb_article.rb:5:in<top (required)>' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in require' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inblock in require' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in load_dependency' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inrequire' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:360:in require_or_load' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:494:inload_missing_constant' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in const_missing' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:526:inload_missing_constant' /usr/local/rvm/gems/ruby-2.2.2/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:184:in const_missing' /opt/redmine/redmine-3.0.3/plugins/redmine_knowledgebase/db/migrate/20121205100143_add_versioning.rb:4:inup' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:569:in up' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:609:inexec_migration' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:in block (2 levels) in migrate' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:288:inmeasure' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in block in migrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:inwith_connection' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in migrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:inmigrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in block in execute_migration_in_transaction' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:1043:inddl_transaction' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in execute_migration_in_transaction' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:inblock in migrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in each' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:inmigrate' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in up' /usr/local/rvm/gems/ruby-2.2.2/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:inmigrate' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:474:in migrate_plugin' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:446:inmigrate' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:457:in migrate' /opt/redmine/redmine-3.0.3/lib/tasks/redmine.rake:127:inblock (3 levels) in <top (required)>' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:in call' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:240:inblock in execute' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:in each' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:235:inexecute' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:179:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/monitor.rb:211:inmon_synchronize' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:172:in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/task.rb:165:ininvoke' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:150:in invoke_task' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:inblock (2 levels) in top_level' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in each' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:106:inblock in top_level' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in run_with_threads' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:100:intop_level' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in block in run' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:176:instandard_exception_handling' /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in run' /usr/local/rvm/rubies/ruby-2.2.2/bin/rake:33:in
' Tasks: TOP => redmine:plugins:migrate

alexbevi commented 9 years ago

Try the https://github.com/alexbevi/redmine_knowledgebase/tree/redmine-3.0-compat branch and let me know if that helps ...

alexbevi commented 9 years ago

@tazzytazzy did the compat branch work? I'm going to close this issue (soon-ish) unless there's more info you can provide to help me troubleshoot

tazzytazzy commented 9 years ago

Sorry for the delay. Yes. This fixed it. Thanks. :-)