# See http://doc.gitlab.com/ce/development/migration_style_guide.html# for more information on how to write migrations for GitLab.classMergeIssuableReopenedIntoOpenedState<ActiveRecord::MigrationincludeGitlab::Database::MigrationHelpersDOWNTIME=falsedisable_ddl_transaction!classIssue<ActiveRecord::Baseself.table_name='issues'includeEachBatchendclassMergeRequest<ActiveRecord::Baseself.table_name='merge_requests'includeEachBatchenddefup[Issue,MergeRequest].eachdo|model|say"Changing #{model.table_name}.state from 'reopened' to 'opened'"model.where(state: 'reopened').each_batchdo|batch|batch.update_all(state: 'opened')endendendend