Skip to content

Wrong migration order when migrating from 6.x to latest

Created by: ZloeSabo

Im using upgrade guide to upgrade from 6.0 to latest one.

Things went wrong when migrations tried to apply 20140416074002_add_index_on_iid.rb which is removing duplicate issues.

Mysql2::Error: Table 'gitlabhq_production.label_links' doesn't exist: SHOW FULL FIELDS FROM `label_links`/home/soynov/Project/gitlab-development-kit/gitlab/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `query'

As I see this problem is because of invalid schema usage: migration uses latest schema for metadata. Current Issue schema includes Issuable concern that specifies label_link relation which should be deleted with corresponded issue. So migration code tries to look up for label_link table.

But there is no such table at that time as it is being created later in 20140729140420_create_label_links.rb

Merge request reports