0

迁移时遇到此问题:

sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production

==  CreateForkedProjectLinks: migrating =======================================
-- create_table(:forked_project_links)
   -> 0.0240s
-- add_index(:forked_project_links, :forked_to_project_id, {:unique=>true})
   -> 0.0663s
==  CreateForkedProjectLinks: migrated (0.0910s) ==============================

==  AddPrivateToSnippets: migrating ===========================================
-- add_column(:snippets, :private, :boolean, {:null=>false, :default=>true})
   -> 0.0878s
==  AddPrivateToSnippets: migrated (0.0882s) ==================================

==  AddTypeToSnippets: migrating ==============================================
-- add_column(:snippets, :type, :string)
   -> 0.0544s
==  AddTypeToSnippets: migrated (0.0547s) =====================================

==  ChangeProjectIdToNullInSnipepts: migrating ================================
-- change_column(:snippets, :project_id, :integer, {:null=>true})
   -> 0.0631s
==  ChangeProjectIdToNullInSnipepts: migrated (0.0634s) =======================

==  AddTypeValueForSnippets: migrating ========================================
==  AddTypeValueForSnippets: migrated (0.0034s) ===============================

==  AddNotificationLevelToUser: migrating =====================================
-- add_column(:users, :notification_level, :integer, {:null=>false, :default=>1})
   -> 0.0538s
==  AddNotificationLevelToUser: migrated (0.0541s) ============================

==  AddIndexToUsersAuthenticationToken: migrating =============================
-- add_index(:users, :authentication_token, {:unique=>true})
   -> 0.0812s
==  AddIndexToUsersAuthenticationToken: migrated (0.0813s) ====================

==  AddLastActivityColumnIntoProject: migrating ===============================
-- add_column(:projects, :last_activity_at, :datetime)
   -> 0.0662s
-- add_index(:projects, :last_activity_at)
   -> 0.0576s
rake aborted!
An error has occurred, all later migrations canceled
Mysql2::Error: Table 'gitlabhq_production.events' doesn't exist: SHOW FULL FIELDS FROM `events`/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/mysql2_adapter.rb:211:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:259:in `execute_and_free'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:426:in `columns'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:228:in `yield'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:228:in `columns'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:237:in `columns_hash'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/locking/optimistic.rb:131:in `locking_enabled?'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation.rb:170:in `exec_queries'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation.rb:160:in `block in to_a'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/explain.rb:41:in `logging_query_plan'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation.rb:159:in `to_a'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation.rb:189:in `exec_queries'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation.rb:160:in `block in to_a'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/explain.rb:41:in `logging_query_plan'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation.rb:159:in `to_a'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:380:in `find_first'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:122:in `first'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/singular_association.rb:42:in `find_target'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association.rb:145:in `load_target'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/association.rb:55:in `reload'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/singular_association.rb:9:in `reader'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:44:in `block in define_readers'
/home/git/gitlab/app/models/project.rb:182:in `last_activity'
/home/git/gitlab/db/migrate/20130403003950_add_last_activity_column_into_project.rb:7:in `block in up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `block (2 levels) in find_each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `block in find_each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:72:in `find_in_batches'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:20:in `find_each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/querying.rb:8:in `find_each'
/home/git/gitlab/db/migrate/20130403003950_add_last_activity_column_into_project.rb:6:in `up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `block (2 levels) in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `block in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:389:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:528:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in `call'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:777:in `ddl_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:719:in `block in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:570:in `up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:551:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
4

1 回答 1

1

您要升级的版本是什么?由于您需要在升级过程中采取每一步:5.3 -> 5.4 -> 6.0 -> 6.1

于 2013-10-22T06:23:14.113 回答