From 76a6f5556a66f898c4090c658e7066b6062bc353 Mon Sep 17 00:00:00 2001
From: Jan Provaznik <jprovaznik@gitlab.com>
Date: Thu, 22 Nov 2018 14:33:50 +0000
Subject: [PATCH] [EE] Add rails version to all migrations

---
 config/application.rb                            |  3 +++
 db/migrate/20140313092127_init_schema.rb         |  2 +-
 db/migrate/20140407135544_fix_namespaces.rb      |  2 +-
 ...e_state_to_allow_empty_merge_request_diffs.rb |  2 +-
 db/migrate/20140416074002_add_index_on_iid.rb    |  2 +-
 ...20140416185734_index_on_current_sign_in_at.rb |  2 +-
 .../20140428105831_add_notes_index_updated_at.rb |  2 +-
 db/migrate/20140502115131_add_repo_size_to_db.rb |  2 +-
 db/migrate/20140502125220_migrate_repo_size.rb   |  2 +-
 ...140611135229_add_position_to_merge_request.rb |  2 +-
 .../20140625115202_create_users_star_projects.rb |  2 +-
 db/migrate/20140729134820_create_labels.rb       |  2 +-
 db/migrate/20140729140420_create_label_links.rb  |  2 +-
 .../20140729145339_migrate_project_tags.rb       |  2 +-
 .../20140729152420_migrate_taggable_labels.rb    |  2 +-
 db/migrate/20140730111702_add_index_to_labels.rb |  2 +-
 .../20140903115954_migrate_to_new_shell.rb       |  2 +-
 ...0140907220153_serialize_service_properties.rb |  2 +-
 db/migrate/20140914113604_add_members_table.rb   |  2 +-
 ...0140914145549_migrate_to_new_members_model.rb |  2 +-
 .../20140914173417_remove_old_member_tables.rb   |  2 +-
 ...141006143943_move_slack_service_to_webhook.rb |  2 +-
 ...1007100818_add_visibility_level_to_snippet.rb |  2 +-
 db/migrate/20141118150935_add_audit_event.rb     |  2 +-
 .../20141121133009_add_timestamps_to_members.rb  |  2 +-
 db/migrate/20141121161704_add_identity_table.rb  |  2 +-
 ...d_merge_request_rebase_enabled_to_projects.rb |  2 +-
 ...41205134006_add_locked_at_to_merge_request.rb |  2 +-
 .../20141216155758_create_doorkeeper_tables.rb   |  2 +-
 .../20141217125223_add_owner_to_application.rb   |  2 +-
 ...223135007_add_import_data_to_project_table.rb |  2 +-
 ..._developers_can_push_to_protected_branches.rb |  2 +-
 ...20150108073740_create_application_settings.rb |  2 +-
 ...add_home_page_url_for_application_settings.rb |  2 +-
 ...0116234545_add_gitlab_access_token_to_user.rb |  2 +-
 ...3100_add_default_branch_protection_setting.rb |  2 +-
 ...0150205211843_add_timestamps_to_identities.rb |  2 +-
 .../20150206181414_add_index_to_created_at.rb    |  2 +-
 ...50206222854_add_notification_email_to_user.rb |  2 +-
 db/migrate/20150209222013_add_missing_index.rb   |  2 +-
 .../20150211172122_add_template_to_service.rb    |  2 +-
 ...11174341_allow_null_in_services_project_id.rb |  2 +-
 ...er_sharing_enabled_to_application_settings.rb |  2 +-
 ...0150213114800_add_hide_no_password_to_user.rb |  2 +-
 ...042_add_password_automatically_set_to_user.rb |  2 +-
 ..._bitbucket_access_token_and_secret_to_user.rb |  2 +-
 .../20150219004514_add_events_to_services.rb     |  2 +-
 ...0150223022001_set_missing_last_activity_at.rb |  2 +-
 ...20150225065047_add_note_events_to_services.rb |  2 +-
 ..._visibility_levels_to_application_settings.rb |  2 +-
 .../20150306023106_fix_namespace_duplication.rb  |  2 +-
 ...150306023112_add_unique_index_to_namespace.rb |  2 +-
 ..._add_version_check_to_application_settings.rb |  2 +-
 .../20150313012111_create_subscriptions_table.rb |  2 +-
 .../20150320234437_add_location_to_user.rb       |  2 +-
 ...24155957_set_incorrect_assignee_id_to_null.rb |  2 +-
 db/migrate/20150327122227_add_public_to_key.rb   |  2 +-
 .../20150327150017_add_import_data_to_project.rb |  2 +-
 ...50327223628_add_devise_two_factor_to_users.rb |  2 +-
 ...ax_attachment_size_to_application_settings.rb |  2 +-
 ..._add_devise_two_factor_backupable_to_users.rb |  2 +-
 .../20150406133311_add_invite_data_to_member.rb  |  2 +-
 db/migrate/20150411000035_fix_identities.rb      |  2 +-
 .../20150411180045_rename_buildbox_service.rb    |  2 +-
 .../20150413192223_add_public_email_to_users.rb  |  2 +-
 .../20150417121913_create_project_import_data.rb |  2 +-
 ...0417122318_remove_import_data_from_project.rb |  2 +-
 ...120000_remove_periods_at_ends_of_usernames.rb |  2 +-
 ...roject_visibililty_to_application_settings.rb |  2 +-
 ...n_for_tag_names.acts_as_taggable_on_engine.rb |  2 +-
 .../20150425164647_remove_duplicate_tags.rb      |  2 +-
 ..._unique_indices.acts_as_taggable_on_engine.rb |  2 +-
 ...r_cache_to_tags.acts_as_taggable_on_engine.rb |  2 +-
 ..._taggable_index.acts_as_taggable_on_engine.rb |  2 +-
 ...n_for_tag_names.acts_as_taggable_on_engine.rb |  2 +-
 ...default_snippet_visibility_to_app_settings.rb |  2 +-
 ...313_remove_abandoned_group_members_records.rb |  2 +-
 ...ted_signup_domains_to_application_settings.rb |  2 +-
 ...50509180749_convert_legacy_reference_notes.rb |  2 +-
 ...0150516060434_add_note_events_to_web_hooks.rb |  2 +-
 ...oauth_applications_to_application_settings.rb |  2 +-
 ...ter_sign_out_path_for_application_settings.rb |  2 +-
 ...sion_expire_delay_for_application_settings.rb |  2 +-
 .../20150610065936_add_dashboard_to_users.rb     |  2 +-
 ...0_add_default_otp_required_for_login_value.rb |  2 +-
 .../20150713160110_add_project_view_to_users.rb  |  2 +-
 ...0150717130904_add_commits_count_to_project.rb |  2 +-
 ...2406_add_updated_by_to_issuables_and_notes.rb |  2 +-
 .../20150806104937_create_abuse_reports.rb       |  2 +-
 ...20150812080800_add_settings_import_sources.rb |  2 +-
 ...50814065925_remove_oauth_tokens_from_users.rb |  2 +-
 ...20150817163600_deduplicate_user_identities.rb |  2 +-
 .../20150818213832_add_sent_notifications.rb     |  2 +-
 ...20150824002011_add_enable_ssl_verification.rb |  2 +-
 db/migrate/20150826001931_add_ci_tables.rb       |  2 +-
 ...7121444_add_fast_forward_option_to_project.rb |  2 +-
 .../20150902001023_add_template_to_label.rb      |  2 +-
 db/migrate/20150914215247_add_ci_tags.rb         |  2 +-
 ...5001905_enable_ssl_verification_by_default.rb |  2 +-
 ...0405_enable_ssl_verification_for_web_hooks.rb |  2 +-
 ...add_help_page_text_to_application_settings.rb |  2 +-
 ...16145038_add_index_for_committed_at_and_id.rb |  2 +-
 ...513_add_ci_enabled_to_application_settings.rb |  2 +-
 ...ove_invalid_milestones_from_merge_requests.rb |  2 +-
 ...50920010715_add_consumed_timestep_to_users.rb |  2 +-
 ...0161119_add_line_code_to_sent_notification.rb |  2 +-
 ...20150924125150_add_project_id_to_ci_commit.rb |  2 +-
 ...24125436_migrate_project_id_for_ci_commits.rb |  2 +-
 .../20150930001110_merge_request_error_field.rb  |  2 +-
 ...930095736_add_null_to_name_for_ci_projects.rb |  2 +-
 .../20150930110012_add_group_share_lock.rb       |  2 +-
 .../20151002112914_add_stage_idx_to_builds.rb    |  2 +-
 .../20151002121400_add_index_for_builds.rb       |  2 +-
 .../20151002122929_add_ref_and_tag_to_builds.rb  |  2 +-
 ...0151002122943_migrate_ref_and_tag_to_build.rb |  2 +-
 .../20151005075649_add_user_id_to_build.rb       |  2 +-
 ...20151005150751_add_layout_option_for_users.rb |  2 +-
 ...emove_ci_enabled_from_application_settings.rb |  2 +-
 ...511_namespaces_projects_path_lower_indexes.rb |  2 +-
 ...232_add_users_lower_username_email_indexes.rb |  2 +-
 ...8123042_add_type_and_description_to_builds.rb |  2 +-
 ...321_migrate_name_to_description_for_builds.rb |  2 +-
 ...43519_add_admin_notification_email_setting.rb |  2 +-
 .../20151012173029_set_jira_service_api_url.rb   |  2 +-
 ...0151013092124_add_artifacts_file_to_builds.rb |  2 +-
 ...131433_add_ci_projects_gl_project_id_index.rb |  2 +-
 ...6195451_add_ci_builds_and_projects_indexes.rb |  2 +-
 .../20151016195706_add_notes_line_code_index.rb  |  2 +-
 db/migrate/20151019111551_fix_build_tags.rb      |  2 +-
 .../20151019111703_fail_build_without_names.rb   |  2 +-
 ...20151020145526_add_services_template_index.rb |  2 +-
 db/migrate/20151020173516_ci_limits_to_mysql.rb  |  2 +-
 ...51020173906_add_ci_builds_index_for_status.rb |  2 +-
 .../20151023112551_fail_build_with_empty_name.rb |  2 +-
 db/migrate/20151023144219_remove_satellites.rb   |  2 +-
 .../20151026182941_add_project_path_index.rb     |  2 +-
 ...merge_when_build_succeeds_to_merge_request.rb |  2 +-
 db/migrate/20151103001141_add_public_to_group.rb |  2 +-
 .../20151103133339_add_shared_runners_setting.rb |  2 +-
 db/migrate/20151103134857_create_lfs_objects.rb  |  2 +-
 ...20151103134958_create_lfs_objects_projects.rb |  2 +-
 .../20151104105513_add_file_to_lfs_objects.rb    |  2 +-
 db/migrate/20151105094515_create_releases.rb     |  2 +-
 .../20151106000015_add_is_award_to_notes.rb      |  2 +-
 ...max_artifacts_size_to_application_settings.rb |  2 +-
 .../20151109134526_add_issues_state_index.rb     |  2 +-
 ...134916_add_projects_visibility_level_index.rb |  2 +-
 ...20151110125604_add_import_error_to_project.rb |  2 +-
 ...51114113410_add_index_for_lfs_oid_and_size.rb |  2 +-
 ...0151116144118_add_unique_for_lfs_oid_index.rb |  2 +-
 .../20151118162244_add_projects_public_index.rb  |  2 +-
 .../20151201203948_raise_hook_url_limit.rb       |  2 +-
 ...1203162133_add_hide_project_limit_to_users.rb |  2 +-
 ...0151203162134_add_build_events_to_services.rb |  2 +-
 .../20151209144329_migrate_ci_web_hooks.rb       |  2 +-
 db/migrate/20151209145909_migrate_ci_emails.rb   |  2 +-
 .../20151210030143_add_unlock_token_to_user.rb   |  2 +-
 ...registration_token_to_application_settings.rb |  2 +-
 .../20151210125232_migrate_ci_slack_service.rb   |  2 +-
 ...20151210125927_migrate_ci_hip_chat_service.rb |  2 +-
 db/migrate/20151210125928_add_ci_to_project.rb   |  2 +-
 .../20151210125929_add_project_id_to_ci.rb       |  2 +-
 .../20151210125930_migrate_ci_to_project.rb      |  2 +-
 .../20151210125931_add_index_to_ci_tables.rb     |  2 +-
 .../20151210125932_drop_null_for_ci_tables.rb    |  2 +-
 ...013_add_pages_size_to_application_settings.rb |  2 +-
 ...1218154042_add_tfa_to_application_settings.rb |  2 +-
 .../20151221234414_add_tfa_additional_fields.rb  |  2 +-
 db/migrate/20151224123230_rename_emojis.rb       |  2 +-
 ...0151228111122_remove_public_from_namespace.rb |  2 +-
 db/migrate/20151228150906_influxdb_settings.rb   |  2 +-
 ...5719_add_recaptcha_to_application_settings.rb |  2 +-
 .../20151229102248_influxdb_udp_port_setting.rb  |  2 +-
 ...229112614_influxdb_remote_database_setting.rb |  2 +-
 ...0132518_add_artifacts_metadata_to_ci_build.rb |  2 +-
 ...152326_add_akismet_to_application_settings.rb |  2 +-
 ..._remove_alert_type_from_broadcast_messages.rb |  2 +-
 .../20160106162223_add_index_milestones_title.rb |  2 +-
 ...20160106164438_remove_influxdb_credentials.rb |  2 +-
 db/migrate/20160109054846_create_spam_logs.rb    |  2 +-
 ...20160113111034_add_metrics_sample_interval.rb |  2 +-
 ...8155830_add_sentry_to_application_settings.rb |  2 +-
 ..._blocking_settings_to_application_settings.rb |  2 +-
 .../20160119111158_add_services_category.rb      |  2 +-
 .../20160119112418_add_services_default.rb       |  2 +-
 .../20160119145451_add_ldap_email_to_users.rb    |  2 +-
 ...add_base_commit_sha_to_merge_request_diffs.rb |  2 +-
 ...ail_author_in_body_to_application_settings.rb |  2 +-
 ...160122185421_add_pending_delete_to_project.rb |  2 +-
 ...locking_settings_from_application_settings.rb |  2 +-
 ...60128233227_change_lfs_objects_size_column.rb |  2 +-
 ...55_remove_dot_atom_path_ending_of_projects.rb |  2 +-
 ...512_add_merge_commit_sha_to_merge_requests.rb |  2 +-
 .../20160202091601_add_erasable_to_ci_build.rb   |  2 +-
 ...2_add_allow_guest_to_access_builds_project.rb |  2 +-
 ...44558_add_real_size_to_merge_request_diffs.rb |  2 +-
 .../20160209130428_add_index_to_snippet.rb       |  2 +-
 db/migrate/20160210105555_create_pages_domain.rb |  2 +-
 db/migrate/20160212123307_create_tasks.rb        |  2 +-
 .../20160217100506_add_description_to_label.rb   |  2 +-
 db/migrate/20160217174422_add_note_to_tasks.rb   |  2 +-
 .../20160220123949_rename_tasks_to_todos.rb      |  2 +-
 .../20160222153918_create_appearances_ce.rb      |  2 +-
 .../20160223192159_add_confidential_to_issues.rb |  2 +-
 .../20160225090018_add_delete_at_to_issues.rb    |  2 +-
 ...0225101956_add_delete_at_to_merge_requests.rb |  2 +-
 ...26114608_add_trigram_indexes_for_searching.rb |  2 +-
 ...0160227120001_add_event_field_for_web_hook.rb |  2 +-
 .../20160227120047_add_event_to_services.rb      |  2 +-
 ...0229193553_add_main_language_to_repository.rb |  2 +-
 ...60301124843_add_visibility_level_to_groups.rb |  2 +-
 .../20160301174731_add_fingerprint_index.rb      |  2 +-
 ..._import_credentials_to_project_import_data.rb |  2 +-
 ...2808_remove_wrong_import_url_from_projects.rb |  2 +-
 ...0305220806_remove_expires_at_from_snippets.rb |  2 +-
 ...307221555_disallow_blank_line_code_on_note.rb |  2 +-
 ...t_group_visibility_to_application_settings.rb |  2 +-
 db/migrate/20160309140734_fix_todos.rb           |  2 +-
 .../20160310124959_add_due_date_to_issues.rb     |  2 +-
 .../20160310185910_add_external_flag_to_users.rb |  2 +-
 .../20160314094147_add_priority_to_label.rb      |  2 +-
 ...20160314114439_add_requested_at_to_members.rb |  2 +-
 ...0160314143402_projects_add_pushes_since_gc.rb |  2 +-
 ...0160315135439_project_add_repository_check.rb |  2 +-
 .../20160316123110_ci_runners_token_index.rb     |  2 +-
 ...16192622_change_target_id_to_null_on_todos.rb |  2 +-
 .../20160316204731_add_commit_id_to_todos.rb     |  2 +-
 .../20160317092222_add_moved_to_to_issue.rb      |  2 +-
 ...04112_index_namespaces_on_visibility_level.rb |  2 +-
 ...0324020319_remove_todos_for_deleted_issues.rb |  2 +-
 ...0160328112808_create_notification_settings.rb |  2 +-
 ...328115649_migrate_new_notification_setting.rb |  2 +-
 ...60328121138_add_notification_setting_index.rb |  2 +-
 ...44452_add_index_on_pending_delete_projects.rb |  2 +-
 ...14_remove_todos_for_deleted_merge_requests.rb |  2 +-
 ..._sharing_enabled_from_application_settings.rb |  2 +-
 ...60407120251_add_images_enabled_for_project.rb |  2 +-
 ...0240_add_repository_checks_enabled_setting.rb |  2 +-
 .../20160412173416_add_fields_to_ci_commit.rb    |  2 +-
 db/migrate/20160412173417_update_ci_commit.rb    |  2 +-
 .../20160412173418_add_ci_commit_indexes.rb      |  2 +-
 .../20160413115152_add_token_to_web_hooks.rb     |  2 +-
 ...160415062917_create_personal_access_tokens.rb |  2 +-
 ...hared_runners_text_to_application_settings.rb |  2 +-
 db/migrate/20160416180807_add_award_emoji.rb     |  2 +-
 ...16182152_convert_award_note_to_emoji_award.rb |  2 +-
 .../20160419120017_add_metrics_packet_size.rb    |  2 +-
 ..._allow_merge_if_build_succeeds_to_projects.rb |  2 +-
 .../20160421130527_disable_repository_checks.rb  |  2 +-
 .../20160425045124_create_u2f_registrations.rb   |  2 +-
 ...th_sign_in_sources_to_application_settings.rb |  2 +-
 ...160504112519_add_run_untagged_to_ci_runner.rb |  2 +-
 ...08194200_remove_wall_enabled_from_projects.rb |  2 +-
 ..._add_head_commit_id_to_merge_request_diffs.rb |  2 +-
 db/migrate/20160508215820_add_type_to_notes.rb   |  2 +-
 ...20160508215920_add_positions_to_diff_notes.rb |  2 +-
 ...160508221410_set_type_on_legacy_diff_notes.rb |  2 +-
 .../20160509091049_add_locked_to_ci_runner.rb    |  2 +-
 ...check_access_token_to_application_settings.rb |  2 +-
 ...confirmation_email_to_application_settings.rb |  2 +-
 ...add_start_commit_id_to_merge_request_diffs.rb |  2 +-
 ...441_add_artifacts_expire_date_to_ci_builds.rb |  2 +-
 ...developers_can_merge_to_protected_branches.rb |  2 +-
 ...ote_type_and_position_to_sent_notification.rb |  2 +-
 ...5205328_remove_main_language_from_projects.rb |  2 +-
 ...notification_settings_for_deleted_projects.rb |  2 +-
 .../20160528043124_add_users_state_index.rb      |  2 +-
 ...token_expire_delay_to_application_settings.rb |  2 +-
 ...add_has_external_issue_tracker_to_projects.rb |  2 +-
 ...30_remove_duplicated_notification_settings.rb |  2 +-
 ...3182247_add_index_to_notification_settings.rb |  2 +-
 ...after_sign_up_text_to_application_settings.rb |  2 +-
 ...8195742_add_repository_storage_to_projects.rb |  2 +-
 ...r_default_external_to_application_settings.rb |  2 +-
 ..._notification_setting_not_null_constraints.rb |  2 +-
 ...cated_issues_tracker_columns_from_projects.rb |  2 +-
 ...610201627_migrate_users_notification_level.rb |  2 +-
 db/migrate/20160610204157_add_deployments.rb     |  2 +-
 db/migrate/20160610204158_add_environments.rb    |  2 +-
 .../20160610211845_add_environment_to_builds.rb  |  2 +-
 ...01627_remove_notification_level_from_users.rb |  2 +-
 ...repository_storage_to_application_settings.rb |  2 +-
 ...42710_add_index_on_requested_at_to_members.rb |  2 +-
 ...t_access_protocols_to_application_settings.rb |  2 +-
 ...60615191922_set_missing_stage_on_ci_builds.rb |  2 +-
 ...160616084004_change_project_of_environment.rb |  2 +-
 .../20160616102642_remove_duplicated_keys.rb     |  2 +-
 ...05_remove_keys_fingerprint_index_if_exists.rb |  2 +-
 ...03948_add_unique_index_to_keys_fingerprint.rb |  2 +-
 ...301627_add_events_to_notification_settings.rb |  2 +-
 ...20160620115026_add_index_on_runners_locked.rb |  2 +-
 ...29_add_rebase_commit_sha_to_merge_requests.rb |  2 +-
 ...0628085157_add_artifacts_size_to_ci_builds.rb |  2 +-
 ...rogress_merge_commit_sha_to_merge_requests.rb |  2 +-
 ...340_add_index_on_award_emoji_user_and_name.rb |  2 +-
 ...5054938_add_protected_branches_push_access.rb |  2 +-
 ...054952_add_protected_branches_merge_access.rb |  2 +-
 ...n_merge_to_protected_branches_merge_access.rb |  2 +-
 ...can_push_to_protected_branches_push_access.rb |  2 +-
 ...evelopers_can_push_from_protected_branches.rb |  2 +-
 ...velopers_can_merge_from_protected_branches.rb |  2 +-
 ...05163108_remove_requesters_that_are_owners.rb |  2 +-
 .../20160707104333_add_lock_to_issuables.rb      |  2 +-
 ...712171823_remove_award_emojis_with_no_user.rb |  2 +-
 ...00638_add_repository_read_only_to_projects.rb |  2 +-
 ...d_domain_blacklist_to_application_settings.rb |  2 +-
 ...618_add_usage_ping_to_application_settings.rb |  2 +-
 .../20160715132507_add_user_id_to_pipeline.rb    |  2 +-
 ...60715134306_add_index_for_pipeline_user_id.rb |  2 +-
 ...212_add_request_access_enabled_to_projects.rb |  2 +-
 ...04316_add_request_access_enabled_to_groups.rb |  2 +-
 ...ication_settings_restricted_signup_domains.rb |  2 +-
 ...0_add_when_and_yaml_variables_to_ci_builds.rb |  2 +-
 .../20160716115711_add_queued_at_to_ci_builds.rb |  2 +-
 ...18153603_add_has_external_wiki_to_projects.rb |  2 +-
 ...op_and_readd_has_external_wiki_in_projects.rb |  2 +-
 ...20160722221922_nullify_blank_type_on_notes.rb |  2 +-
 .../20160724205507_add_resolved_to_notes.rb      |  2 +-
 ...0725083350_add_external_url_to_enviroments.rb |  2 +-
 ...60725104020_merge_request_diff_remove_uniq.rb |  2 +-
 ...0160725104452_merge_request_diff_add_index.rb |  2 +-
 .../20160727163552_create_user_agent_details.rb  |  2 +-
 db/migrate/20160727191041_create_boards.rb       |  2 +-
 db/migrate/20160727193336_create_lists.rb        |  2 +-
 ...728081025_add_pipeline_events_to_web_hooks.rb |  2 +-
 ...0728103734_add_pipeline_events_to_services.rb |  2 +-
 ...729173930_remove_project_id_from_spam_logs.rb |  2 +-
 .../20160801163421_add_expires_at_to_member.rb   |  2 +-
 ...01163709_add_submitted_as_ham_to_spam_logs.rb |  2 +-
 ...328_remove_builds_enable_index_on_projects.rb |  2 +-
 ...3161903_add_unique_index_to_lists_label_id.rb |  2 +-
 ...160804142904_add_ci_config_file_to_project.rb |  2 +-
 ...0804150737_add_timestamps_to_members_again.rb |  2 +-
 ...0160805041956_add_deleted_at_to_namespaces.rb |  2 +-
 db/migrate/20160808085531_add_token_to_build.rb  |  2 +-
 .../20160808085602_add_index_for_build_token.rb  |  2 +-
 ...810102349_remove_ci_runner_trigram_indexes.rb |  2 +-
 .../20160810142633_remove_redundant_indexes.rb   |  2 +-
 .../20160811172945_add_can_push_to_keys.rb       |  2 +-
 ...61312_add_column_name_to_u2f_registrations.rb |  2 +-
 ...7133006_add_koding_to_application_settings.rb |  2 +-
 ...20160817154936_add_discussion_ids_to_notes.rb |  2 +-
 ...5718_add_expires_at_to_project_group_links.rb |  2 +-
 ...0819221631_add_index_to_note_discussion_id.rb |  2 +-
 ...ssion_id_because_it_was_calculated_wrongly.rb |  2 +-
 ...19232256_add_incoming_email_token_to_users.rb |  2 +-
 .../20160823081327_change_merge_error_to_text.rb |  2 +-
 ...dd_column_scopes_to_personal_access_tokens.rb |  2 +-
 ...20160823213309_add_lfs_enabled_to_projects.rb |  2 +-
 .../20160824103857_drop_unused_ci_tables.rb      |  2 +-
 .../20160824124900_add_table_issue_metrics.rb    |  2 +-
 ...0825052008_add_table_merge_request_metrics.rb |  2 +-
 ...7011312_ensure_lock_version_has_no_default.rb |  2 +-
 .../20160829114652_add_markdown_cache_columns.rb |  2 +-
 ...dd_confidential_issues_events_to_web_hooks.rb |  2 +-
 ...add_confidential_issues_events_to_services.rb |  2 +-
 ...0160830232601_change_lock_version_not_null.rb |  2 +-
 .../20160831214002_create_project_features.rb    |  2 +-
 .../20160831214543_migrate_project_features.rb   |  2 +-
 ...3750_remove_features_enabled_from_projects.rb |  2 +-
 ...set_confidential_issues_events_on_webhooks.rb |  2 +-
 ...160901213340_add_lfs_enabled_to_namespaces.rb |  2 +-
 ..._gitorious_field_from_application_settings.rb |  2 +-
 ...31111_add_environment_type_to_environments.rb |  2 +-
 ...0913162434_remove_projects_pushes_since_gc.rb |  2 +-
 ...0160913212128_change_artifacts_size_column.rb |  2 +-
 ...llow_merge_if_all_discussions_are_resolved.rb |  2 +-
 ...42921_create_merge_requests_closing_issues.rb |  2 +-
 db/migrate/20160919144305_add_type_to_labels.rb  |  2 +-
 .../20160919145149_add_group_id_to_labels.rb     |  2 +-
 .../20160920160832_add_index_to_labels_title.rb  |  2 +-
 .../20160926145521_add_organization_to_user.rb   |  2 +-
 .../20161006104309_add_state_to_environment.rb   |  2 +-
 .../20161007073613_create_user_activities.rb     |  2 +-
 ...61007133303_precalculate_trending_projects.rb |  2 +-
 ...161010142410_create_project_authorizations.rb |  2 +-
 ...repository_access_level_to_project_feature.rb |  2 +-
 .../20161014173530_create_label_priorities.rb    |  2 +-
 ...add_authorized_projects_populated_to_users.rb |  2 +-
 ...0161017095000_add_properties_to_deployment.rb |  2 +-
 .../20161017125927_add_unique_index_to_labels.rb |  2 +-
 .../20161018024215_migrate_labels_priority.rb    |  2 +-
 ...20161018024550_remove_priority_from_labels.rb |  2 +-
 ...20161018124658_make_project_owners_masters.rb |  2 +-
 ...190736_migrate_sidekiq_queues_from_default.rb |  2 +-
 ...3545_generate_project_feature_for_projects.rb |  2 +-
 ...161020075734_default_request_access_groups.rb |  2 +-
 ...1020075830_default_request_access_projects.rb |  2 +-
 ...3_add_pipeline_id_to_merge_request_metrics.rb |  2 +-
 ...minimum_key_length_to_application_settings.rb |  2 +-
 ...07_add_lock_version_to_build_and_pipelines.rb |  2 +-
 ...042317_migrate_mailroom_queue_from_default.rb |  2 +-
 db/migrate/20161025231710_migrate_jira_to_gem.rb |  2 +-
 ...6_add_housekeeping_to_application_settings.rb |  2 +-
 ...1031171301_add_project_id_to_subscriptions.rb |  2 +-
 ...031174110_migrate_subscriptions_project_id.rb |  2 +-
 ...31181638_add_unique_index_to_subscriptions.rb |  2 +-
 ...103171205_rename_repository_storage_column.rb |  2 +-
 ...sidekiq_throttling_to_application_settings.rb |  2 +-
 ...5620_add_project_import_data_project_index.rb |  2 +-
 ...0161113184239_create_user_chat_names_table.rb |  2 +-
 ...0161114024742_add_coverage_regex_to_builds.rb |  2 +-
 ...0161115173905_add_start_date_to_milestones.rb |  2 +-
 .../20161117114805_remove_undeleted_groups.rb    |  2 +-
 ...161118183841_add_commit_events_to_services.rb |  2 +-
 .../20161124111390_add_parent_id_to_namespace.rb |  2 +-
 .../20161124111395_add_index_to_parent_id.rb     |  2 +-
 db/migrate/20161124111402_add_routes_table.rb    |  2 +-
 ...4141322_migrate_process_commit_worker_jobs.rb |  2 +-
 ...ply_to_discussion_id_to_sent_notifications.rb |  2 +-
 .../20161128142110_remove_unnecessary_indexes.rb |  2 +-
 ...tml_emails_enabled_to_application_settings.rb |  2 +-
 db/migrate/20161130095245_fill_routes_table.rb   |  2 +-
 .../20161130101252_fill_projects_routes_table.rb |  2 +-
 ..._add_plant_uml_url_to_application_settings.rb |  2 +-
 .../20161201155511_create_project_statistics.rb  |  2 +-
 .../20161201160452_migrate_project_statistics.rb |  2 +-
 ...161202152031_remove_duplicates_from_routes.rb |  2 +-
 db/migrate/20161202152035_add_index_to_routes.rb |  2 +-
 ..._plant_uml_enabled_to_application_settings.rb |  2 +-
 ...3749_remove_uniq_path_index_from_namespace.rb |  2 +-
 ...20161206153751_add_path_index_to_namespace.rb |  2 +-
 ...3753_remove_uniq_name_index_from_namespace.rb |  2 +-
 ...20161206153754_add_name_index_to_namespace.rb |  2 +-
 ...07231620_fixup_environment_name_uniqueness.rb |  2 +-
 ...31621_create_environment_name_unique_index.rb |  2 +-
 .../20161207231626_add_environment_slug.rb       |  2 +-
 ...3400_add_unique_index_for_environment_slug.rb |  2 +-
 ...16_create_doorkeeper_openid_connect_tables.rb |  2 +-
 ...61212142807_add_lower_path_index_to_routes.rb |  2 +-
 ...lack_service_to_slack_notification_service.rb |  2 +-
 ...1220141214_remove_dot_git_from_group_names.rb |  2 +-
 .../20161221152132_add_last_used_at_to_key.rb    |  2 +-
 ...0161223034433_add_estimate_to_issuables_ce.rb |  2 +-
 db/migrate/20161223034646_create_timelogs_ce.rb  |  2 +-
 ...161226122833_remove_dot_git_from_usernames.rb |  2 +-
 ...slack_and_mattermost_notification_services.rb |  2 +-
 ...pires_at_to_date_in_personal_access_tokens.rb |  2 +-
 ...dd_impersonation_to_personal_access_tokens.rb |  2 +-
 db/migrate/20170120131253_create_chat_teams.rb   |  2 +-
 ...to_ci_builds_for_status_runner_id_and_type.rb |  2 +-
 ...0655_add_index_to_ci_runners_for_is_shared.rb |  2 +-
 ...0170124174637_add_foreign_keys_to_timelogs.rb |  2 +-
 ...93147_add_two_factor_columns_to_namespaces.rb |  2 +-
 ...0124193205_add_two_factor_columns_to_users.rb |  2 +-
 ...l_max_session_time_to_application_settings.rb |  2 +-
 ...127032550_remove_backlog_lists_from_boards.rb |  2 +-
 ...204620_add_index_to_project_authorizations.rb |  2 +-
 db/migrate/20170130221926_create_uploads.rb      |  2 +-
 ...0131221752_add_relative_position_to_issues.rb |  2 +-
 db/migrate/20170204172458_add_name_to_route.rb   |  2 +-
 ...3_add_index_to_labels_for_type_and_project.rb |  2 +-
 ...071414_add_recaptcha_verified_to_spam_logs.rb |  2 +-
 .../20170206115204_add_column_ghost_to_users.rb  |  2 +-
 ..._add_index_to_labels_for_title_and_project.rb |  2 +-
 ...index_to_ci_trigger_requests_for_commit_id.rb |  2 +-
 ...70210103609_add_index_to_user_agent_detail.rb |  2 +-
 ...d_unique_ips_limit_to_application_settings.rb |  2 +-
 ...tifacts_expiration_to_application_settings.rb |  2 +-
 ...1_add_index_for_latest_successful_pipeline.rb |  2 +-
 ...41440_drop_index_for_builds_project_status.rb |  2 +-
 ...217132157_rename_merge_when_build_succeeds.rb |  2 +-
 ..._rename_only_allow_merge_if_build_succeeds.rb |  2 +-
 .../20170217151948_add_owner_id_to_triggers.rb   |  2 +-
 ...20170217151949_add_description_to_triggers.rb |  2 +-
 db/migrate/20170222111732_create_gpg_keys.rb     |  2 +-
 db/migrate/20170222143317_drop_ci_projects.rb    |  2 +-
 ...170222143500_remove_old_project_id_columns.rb |  2 +-
 ...2143603_rename_gl_project_id_to_project_id.rb |  2 +-
 .../20170301101006_add_ci_runner_namespaces.rb   |  2 +-
 ...ting_merge_request_link_enabled_to_project.rb |  2 +-
 ...01195939_rename_ci_commits_to_ci_pipelines.rb |  2 +-
 ...205639_remove_unused_ci_tables_and_columns.rb |  2 +-
 ...d_auto_cancel_pending_pipelines_to_project.rb |  2 +-
 .../20170305203726_add_owner_id_foreign_key.rb   |  2 +-
 ...170307125949_add_last_activity_on_to_users.rb |  2 +-
 .../20170309173138_create_protected_tags.rb      |  2 +-
 ...114329_add_auto_canceled_by_id_to_pipeline.rb |  2 +-
 ...uto_canceled_by_id_foreign_key_to_pipeline.rb |  2 +-
 .../20170313213916_add_index_to_user_ghost.rb    |  2 +-
 ...20170314082049_create_system_note_metadata.rb |  2 +-
 ...vert_add_notified_of_own_activity_to_users.rb |  2 +-
 .../20170315194013_add_closed_at_to_issues.rb    |  2 +-
 ...30_readd_notified_of_own_activity_to_users.rb |  2 +-
 .../20170316163845_move_uploads_to_system_dir.rb |  2 +-
 .../20170317203554_index_routes_path_for_like.rb |  2 +-
 db/migrate/20170320173259_migrate_assignees.rb   |  2 +-
 ...20170322013926_create_container_repository.rb |  2 +-
 ...091750_add_created_at_index_to_deployments.rb |  2 +-
 ...328010804_add_uuid_to_application_settings.rb |  2 +-
 db/migrate/20170329095325_add_ref_to_triggers.rb |  2 +-
 ...20170329095907_create_ci_trigger_schedules.rb |  2 +-
 ...nterval_multiplier_to_application_settings.rb |  2 +-
 ...0141723_disable_invalid_service_templates2.rb |  2 +-
 ..._remove_index_for_users_current_sign_in_at.rb |  2 +-
 .../20170404163427_add_trigger_id_foreign_key.rb |  2 +-
 .../20170405080720_add_import_jid_to_projects.rb |  2 +-
 ...14958_add_auto_canceled_by_id_to_ci_builds.rb |  2 +-
 ...to_canceled_by_id_foreign_key_to_ci_builds.rb |  2 +-
 ...70407114956_add_ref_to_ci_trigger_schedule.rb |  2 +-
 ...07122426_add_active_to_ci_trigger_schedule.rb |  2 +-
 ...9_add_foreigh_key_trigger_requests_trigger.rb |  2 +-
 ...140450_add_index_to_next_run_at_and_active.rb |  2 +-
 ...133135_add_version_field_to_markdown_cache.rb |  2 +-
 ...0413035209_add_preferred_language_to_users.rb |  2 +-
 ...103908_delete_orphan_notification_settings.rb |  2 +-
 ...19001229_add_index_to_system_note_metadata.rb |  2 +-
 .../20170421102337_remove_nil_type_services.rb   |  2 +-
 ...23064036_add_index_on_ci_builds_updated_at.rb |  2 +-
 ...70424095707_add_index_on_ci_builds_user_id.rb |  2 +-
 ...20170424142900_add_index_to_web_hooks_type.rb |  2 +-
 ...0425112128_create_pipeline_schedules_table.rb |  2 +-
 ...28_remove_foreigh_key_ci_trigger_schedules.rb |  2 +-
 ...4731_add_pipeline_schedule_id_to_pipelines.rb |  2 +-
 ..._fill_missing_uuid_on_application_settings.rb |  2 +-
 ...81740_add_index_on_ci_runners_contacted_at.rb |  2 +-
 .../20170427103502_create_web_hook_logs.rb       |  2 +-
 .../20170427215854_create_redirect_routes.rb     |  2 +-
 ...064307_add_column_delete_error_to_projects.rb |  2 +-
 ...uto_cancel_pending_pipelines_on_by_default.rb |  2 +-
 ...ate_index_ci_pipelines_auto_canceled_by_id.rb |  2 +-
 ...create_index_ci_builds_auto_canceled_by_id.rb |  2 +-
 ...add_last_repository_updated_at_to_projects.rb |  2 +-
 ..._to_last_repository_updated_at_on_projects.rb |  2 +-
 .../20170503004426_add_retried_to_ci_build.rb    |  2 +-
 ..._edited_at_and_last_edited_by_id_to_issues.rb |  2 +-
 ...at_and_last_edited_by_id_to_merge_requests.rb |  2 +-
 ..._add_repository_update_events_to_web_hooks.rb |  2 +-
 ...20170503114228_add_description_to_snippets.rb |  2 +-
 ...03140201_reschedule_project_authorizations.rb |  2 +-
 ...ested_groups_into_regular_groups_for_mysql.rb |  2 +-
 ...0170503184421_add_index_to_redirect_routes.rb |  2 +-
 ...185032_index_redirect_routes_path_for_like.rb |  2 +-
 ..._clientside_sentry_to_application_settings.rb |  2 +-
 ...103_add_index_project_group_links_group_id.rb |  2 +-
 ...add_index_to_pipeline_pipeline_schedule_id.rb |  2 +-
 ...1344_add_foreign_key_to_pipeline_schedules.rb |  2 +-
 ...reign_key_pipeline_schedules_and_pipelines.rb |  2 +-
 ...316_add_head_pipeline_id_to_merge_requests.rb |  2 +-
 ...50_add_not_null_contraints_to_ci_variables.rb |  2 +-
 ...0508190732_add_foreign_key_to_ci_variables.rb |  2 +-
 ...ename_web_hooks_build_events_to_job_events.rb |  2 +-
 ...rename_services_build_events_to_job_events.rb |  2 +-
 ...6153305_migrate_assignee_to_separate_table.rb |  2 +-
 ...70516183131_add_indices_to_issue_assignees.rb |  2 +-
 ...dd_prometheus_settings_to_metrics_settings.rb |  2 +-
 ...0170521184006_add_change_position_to_notes.rb |  2 +-
 .../20170523091700_add_rss_token_to_users.rb     |  2 +-
 ...e_conversational_development_index_metrics.rb |  2 +-
 .../20170524125940_add_source_to_ci_pipeline.rb  |  2 +-
 ...170524161101_add_protected_to_ci_variables.rb |  2 +-
 ...0170525130346_create_group_variables_table.rb |  2 +-
 ...5130758_add_foreign_key_to_group_variables.rb |  2 +-
 .../20170525132202_create_pipeline_stages.rb     |  2 +-
 .../20170525174156_create_feature_tables.rb      |  2 +-
 .../20170526185602_add_stage_id_to_ci_builds.rb  |  2 +-
 ...roject_foreign_keys_with_cascading_deletes.rb |  2 +-
 ...rized_keys_enabled_to_application_settings.rb |  2 +-
 ..._rename_users_ldap_email_to_external_email.rb |  2 +-
 ...0601163708_add_artifacts_store_to_ci_build.rb |  2 +-
 ...commercial_content_to_application_settings.rb |  2 +-
 ...p_page_support_url_to_application_settings.rb |  2 +-
 ...20170603200744_add_email_provider_to_users.rb |  2 +-
 ...606154216_add_notification_setting_columns.rb |  2 +-
 ...are_events_table_for_push_events_migration.rb |  2 +-
 ...08152748_create_push_event_payloads_tables.rb |  2 +-
 ...0608171156_create_merge_request_diff_files.rb |  2 +-
 .../20170613154149_create_gpg_signatures.rb      |  2 +-
 ...16133147_create_merge_request_diff_commits.rb |  2 +-
 ..._add_index_for_head_pipeline_merge_request.rb |  2 +-
 ...4728_create_ci_pipeline_schedule_variables.rb |  2 +-
 ...eign_key_to_ci_pipeline_schedule_variables.rb |  2 +-
 ...29_correct_protected_branches_foreign_keys.rb |  2 +-
 ...12_add_foreign_key_for_merge_request_diffs.rb |  2 +-
 ...70622135451_rename_duplicated_variable_key.rb |  2 +-
 ...5628_add_environment_scope_to_ci_variables.rb |  2 +-
 ...5728_add_unique_constraint_to_ci_variables.rb |  2 +-
 ...622162730_add_ref_fetched_to_merge_request.rb |  2 +-
 ...80805_remove_ci_variables_project_id_index.rb |  2 +-
 ...enabled_to_password_authentication_enabled.rb |  2 +-
 ...3102400_add_stage_id_foreign_key_to_builds.rb |  2 +-
 ...r_allowed_group_id_to_application_settings.rb |  2 +-
 .../20170707183807_add_group_id_to_milestones.rb |  2 +-
 ...70707184243_add_group_milestone_id_indexes.rb |  2 +-
 ...remove_wrong_versions_from_schema_versions.rb |  2 +-
 ...0083355_clean_stage_id_reference_migration.rb |  2 +-
 .../20170711145320_add_status_to_ci_stages.rb    |  2 +-
 ...13104829_add_foreign_key_to_merge_requests.rb |  2 +-
 .../20170717074009_move_system_upload_folder.rb  |  2 +-
 ...2_add_trusted_column_to_oauth_applications.rb |  2 +-
 ...170720111708_add_lock_version_to_ci_stages.rb |  2 +-
 ...170720122741_create_user_custom_attributes.rb |  2 +-
 ...0170720130522_create_ci_pipeline_variables.rb |  2 +-
 ...9_add_foreign_key_to_ci_pipeline_variables.rb |  2 +-
 ...02_add_lower_path_index_to_redirect_routes.rb |  2 +-
 ...659_add_binary_to_merge_request_diff_files.rb |  2 +-
 ...27123534_add_index_on_events_project_id_id.rb |  2 +-
 ...20170731175128_add_percentages_to_conv_dev.rb |  2 +-
 ...0731183033_add_merge_jid_to_merge_requests.rb |  2 +-
 ...170802013652_add_storage_fields_to_project.rb |  2 +-
 ...organise_issues_indexes_for_faster_sorting.rb |  2 +-
 ...70807071105_add_hashed_storage_to_settings.rb |  2 +-
 ...0170809133343_add_broadcast_messages_index.rb |  2 +-
 ...add_broadcast_message_not_null_constraints.rb |  2 +-
 .../20170809142252_cleanup_appearances_schema.rb |  2 +-
 ...ect_export_enabled_to_application_settings.rb |  2 +-
 ...15221154_add_discussion_locked_to_issuable.rb |  2 +-
 ...70816133938_add_access_level_to_ci_runners.rb |  2 +-
 .../20170816133940_add_protected_to_ci_builds.rb |  2 +-
 ...170816143940_add_protected_to_ci_pipelines.rb |  2 +-
 ...816153940_add_index_on_ci_builds_protected.rb |  2 +-
 .../20170816234252_add_theme_id_to_users.rb      |  2 +-
 ..._add_verification_status_to_gpg_signatures.rb |  2 +-
 ...100558_correct_protected_tags_foreign_keys.rb |  2 +-
 ...108_create_user_synced_attributes_metadata.rb |  2 +-
 ...uto_devops_enabled_to_application_settings.rb |  2 +-
 ...58_allow_appearances_description_html_null.rb |  2 +-
 ...170825015534_add_file_store_to_lfs_objects.rb |  2 +-
 ...0170825104051_migrate_issues_to_ghost_user.rb |  2 +-
 ...25154015_resolve_outdated_diff_discussions.rb |  2 +-
 ...add_index_on_merge_request_diff_commit_sha.rb |  2 +-
 ...20170828093725_create_project_auto_dev_ops.rb |  2 +-
 ...0828135939_migrate_user_external_mail_data.rb |  2 +-
 ...0830125940_add_failure_reason_to_ci_builds.rb |  2 +-
 ...30119_steal_remaining_event_migration_jobs.rb |  2 +-
 ...20170830131015_swap_event_migration_tables.rb |  2 +-
 ...70831092813_add_config_source_to_pipelines.rb |  2 +-
 ...0901071411_add_foreign_key_to_issue_author.rb |  2 +-
 .../20170904092148_add_email_confirmation.rb     |  2 +-
 ...170905112933_add_resolved_by_push_to_notes.rb |  2 +-
 ...20170906133745_add_runners_token_to_groups.rb |  2 +-
 ...0170909090114_add_email_confirmation_index.rb |  2 +-
 .../20170909150936_add_spent_at_to_timelogs.rb   |  2 +-
 ...0912113435_clean_stages_statuses_migration.rb |  2 +-
 ...913131410_environments_project_id_not_null.rb |  2 +-
 ...914135630_add_index_for_recent_push_events.rb |  2 +-
 .../20170918072948_create_job_artifacts.rb       |  2 +-
 ...0170918072949_add_file_store_job_artifacts.rb |  2 +-
 ...918111708_create_project_custom_attributes.rb |  2 +-
 ...70918140927_create_group_custom_attributes.rb |  2 +-
 ...70918222253_reorganize_deployments_indexes.rb |  2 +-
 ..._add_deployments_index_for_last_deployment.rb |  2 +-
 ...919211300_remove_temporary_ci_builds_index.rb |  2 +-
 ...15009_add_project_repository_storage_index.rb |  2 +-
 db/migrate/20170924094327_create_gcp_clusters.rb |  2 +-
 .../20170925184228_add_favicon_to_appearances.rb |  2 +-
 ...921_add_ci_builds_index_for_jobscontroller.rb |  2 +-
 ...2209_add_partial_index_for_labels_template.rb |  2 +-
 .../20170927161718_create_gpg_key_subkeys.rb     |  2 +-
 ...e_index_on_merge_requests_merge_commit_sha.rb |  2 +-
 .../20170928124105_create_fork_networks.rb       |  2 +-
 ...20170928133643_create_fork_network_members.rb |  2 +-
 ...0929080234_add_failure_reason_to_pipelines.rb |  2 +-
 .../20170929131201_populate_fork_networks.rb     |  2 +-
 ...21444_make_sure_fast_forward_option_exists.rb |  2 +-
 ...71006090001_create_ci_build_trace_sections.rb |  2 +-
 ...ild_foreign_key_to_ci_build_trace_sections.rb |  2 +-
 ...090100_create_ci_build_trace_section_names.rb |  2 +-
 ...ame_foreign_key_to_ci_build_trace_sections.rb |  2 +-
 ...global_rate_limits_to_application_settings.rb |  2 +-
 ...breaker_properties_to_application_settings.rb |  2 +-
 ...hentication_token_to_personal_access_token.rb |  2 +-
 ...13094327_create_new_clusters_architectures.rb |  2 +-
 ...itbreaker_settings_to_application_settings.rb |  2 +-
 .../20171019141859_fix_dev_timezone_schema.rb    |  2 +-
 ...st_merge_request_diff_id_to_merge_requests.rb |  2 +-
 ...00710_create_clusters_kubernetes_helm_apps.rb |  2 +-
 ...timeout_properties_to_application_settings.rb |  2 +-
 ...1103000000_set_uploads_path_size_for_mysql.rb |  2 +-
 ...00_create_clusters_kubernetes_ingress_apps.rb |  2 +-
 ...0171106132212_issues_confidential_not_null.rb |  2 +-
 ...to_password_authentication_enabled_for_web.rb |  2 +-
 ...on_enabled_for_git_to_application_settings.rb |  2 +-
 ...1106135924_issues_milestone_id_foreign_key.rb |  2 +-
 ...106150657_issues_updated_by_id_foreign_key.rb |  2 +-
 ...71106151218_issues_moved_to_id_foreign_key.rb |  2 +-
 ...urn_issues_due_date_index_to_partial_index.rb |  2 +-
 ...106171453_add_timezone_to_issues_closed_at.rb |  2 +-
 ...50259_merge_requests_author_id_foreign_key.rb |  2 +-
 ...005_merge_requests_assignee_id_foreign_key.rb |  2 +-
 ...4_merge_requests_updated_by_id_foreign_key.rb |  2 +-
 ...0_merge_requests_merge_user_id_foreign_key.rb |  2 +-
 ...rge_requests_source_project_id_foreign_key.rb |  2 +-
 ...27_merge_requests_milestone_id_foreign_key.rb |  2 +-
 ...ests_latest_merge_request_diff_id_take_two.rb |  2 +-
 ...16135628_add_environment_scope_to_clusters.rb |  2 +-
 ...an_up_from_merge_request_diffs_and_commits.rb |  2 +-
 ...ipelines_index_on_project_id_ref_status_id.rb |  2 +-
 ..._add_new_project_guidelines_to_appearances.rb |  2 +-
 ...ker_check_interval_to_application_settings.rb |  2 +-
 ...add_default_values_to_merge_request_states.rb |  2 +-
 ...48_populate_missing_merge_request_statuses.rb |  2 +-
 ...32536_make_merge_request_statuses_not_null.rb |  2 +-
 ...s_related_columns_to_merge_request_metrics.rb |  2 +-
 ...1204204233_add_permanent_to_redirect_route.rb |  2 +-
 ...1519_add_permanent_index_to_redirect_route.rb |  2 +-
 ...171207185153_add_merge_request_state_index.rb |  2 +-
 ...45425_add_can_push_to_deploy_keys_projects.rb |  2 +-
 ...33_create_clusters_applications_prometheus.rb |  2 +-
 ...20171214144320_add_store_column_to_uploads.rb |  2 +-
 ...opulate_can_push_from_deploy_keys_projects.rb |  2 +-
 .../20171216111734_clean_up_for_members.rb       |  2 +-
 ...20171216112339_add_foreign_key_for_members.rb |  2 +-
 ...0191323_add_index_on_namespaces_lower_name.rb |  2 +-
 ..._add_confidential_note_events_to_web_hooks.rb |  2 +-
 ...1222183504_add_jobs_cache_index_to_project.rb |  2 +-
 ..._project_limit_not_null_and_remove_default.rb |  2 +-
 ...add_rebase_commit_sha_to_merge_requests_ce.rb |  2 +-
 .../20180101160629_create_prometheus_metrics.rb  |  2 +-
 ...0_change_project_id_for_prometheus_metrics.rb |  2 +-
 ...102220145_add_pages_https_only_to_projects.rb |  2 +-
 ...8_add_confidential_note_events_to_services.rb |  2 +-
 ...44_add_commits_count_to_merge_request_diff.rb |  2 +-
 ..._change_default_value_for_pages_https_only.rb |  2 +-
 ...80113220114_rework_redirect_routes_indexes.rb |  2 +-
 ...80115201419_add_index_updated_at_to_issues.rb |  2 +-
 .../20180116193854_create_lfs_file_locks.rb      |  2 +-
 ...180119135717_add_uploader_index_to_uploads.rb |  2 +-
 .../20180119160751_optimize_ci_job_artifacts.rb  |  2 +-
 ...auto_devops_domain_to_application_settings.rb |  2 +-
 .../20180125214301_create_user_callouts.rb       |  2 +-
 ...20180129193323_add_uploads_builder_context.rb |  2 +-
 ...constraint_to_trending_projects_project_id.rb |  2 +-
 .../20180201110056_add_foreign_keys_to_todos.rb  |  2 +-
 ...1145907_migrate_remaining_issues_closed_at.rb |  2 +-
 ...06200543_reset_events_primary_key_sequence.rb |  2 +-
 ...edule_populate_untracked_uploads_if_needed.rb |  2 +-
 .../20180209165249_add_closed_by_to_issues.rb    |  2 +-
 ...ternal_ip_to_clusters_applications_ingress.rb |  2 +-
 ...ial_index_to_projects_for_index_only_scans.rb |  2 +-
 db/migrate/20180214093516_create_badges.rb       |  2 +-
 ...55405_create_clusters_applications_runners.rb |  2 +-
 .../20180215181245_users_name_lower_index.rb     |  2 +-
 ...180216120000_add_pages_domain_verification.rb |  2 +-
 ...6120010_add_pages_domain_verified_at_index.rb |  2 +-
 ...0_allow_domain_verification_to_be_disabled.rb |  2 +-
 ...80216120030_add_pages_domain_enabled_until.rb |  2 +-
 ...20040_add_pages_domain_enabled_until_index.rb |  2 +-
 ...50_pages_domains_verification_grace_period.rb |  2 +-
 ...19153455_add_maximum_timeout_to_ci_runners.rb |  2 +-
 ...allow_maintainer_to_push_to_merge_requests.rb |  2 +-
 .../20180222043024_add_ip_address_to_runner.rb   |  2 +-
 ...0443_create_user_interacted_projects_table.rb |  2 +-
 ...hooks_and_services_to_application_settings.rb |  2 +-
 ...226050030_add_checksum_to_ci_job_artifacts.rb |  2 +-
 .../20180227182112_add_group_id_to_boards_ce.rb  |  2 +-
 ...add_include_private_contributions_to_users.rb |  2 +-
 ...0301010859_create_ci_builds_metadata_table.rb |  2 +-
 ...sure_foreign_keys_on_clusters_applications.rb |  2 +-
 .../20180305095250_create_internal_ids_table.rb  |  2 +-
 .../20180305144721_add_privileged_to_runner.rb   |  2 +-
 ...missing_indexes_acts_as_taggable_on_engine.rb |  2 +-
 ...n_name_id_index_on_ci_build_trace_sections.rb |  2 +-
 ...user_internal_regex_to_application_setting.rb |  2 +-
 ...edule_commits_count_for_merge_request_diff.rb |  2 +-
 ...0180309160427_add_partial_indexes_on_todos.rb |  2 +-
 .../20180319190020_create_deploy_tokens.rb       |  2 +-
 ...2229_add_indexes_for_user_activity_queries.rb |  2 +-
 ..._to_merge_request_to_notification_settings.rb |  2 +-
 ...0180326202229_create_ci_build_trace_chunks.rb |  2 +-
 ...80327101207_remove_index_from_events_table.rb |  2 +-
 ...048_add_issue_due_to_notification_settings.rb |  2 +-
 ...180403035759_create_project_ci_cd_settings.rb |  2 +-
 ...0180405142733_create_project_deploy_tokens.rb |  2 +-
 ...s_ci_build_trace_chunks_raw_data_for_mysql.rb |  2 +-
 ...43354_rename_users_rss_token_to_feed_token.rb |  2 +-
 ...reate_missing_namespace_for_internal_users.rb |  2 +-
 ...further_scope_columns_to_internal_id_table.rb |  2 +-
 ...add_index_constraints_to_internal_id_table.rb |  2 +-
 ..._add_tmp_stage_priority_index_to_ci_builds.rb |  2 +-
 .../20180417101940_add_index_to_ci_stage.rb      |  2 +-
 ...7_add_index_to_ci_job_artifacts_file_store.rb |  2 +-
 ...80420010016_add_pipeline_build_foreign_key.rb |  2 +-
 ...180420010616_cleanup_build_stage_migration.rb |  2 +-
 ..._add_pages_access_level_to_project_feature.rb |  2 +-
 ..._add_enforce_terms_to_application_settings.rb |  2 +-
 ...424134533_create_application_setting_terms.rb |  2 +-
 ...424160449_add_pipeline_iid_to_ci_pipelines.rb |  2 +-
 .../20180425075446_create_term_agreements.rb     |  2 +-
 ...ssure_commits_count_for_merge_request_diff.rb |  2 +-
 ...5249_add_index_constraints_to_pipeline_iid.rb |  2 +-
 .../20180426102016_add_accepted_term_to_users.rb |  2 +-
 ...180430101916_add_runner_type_to_ci_runners.rb |  2 +-
 .../20180502122856_create_project_mirror_data.rb |  2 +-
 .../20180503131624_create_remote_mirrors.rb      |  2 +-
 ...te_mirror_available_overridden_to_projects.rb |  2 +-
 ...0427_add_index_to_namespaces_runners_token.rb |  2 +-
 ...ure_missing_columns_to_project_mirror_data.rb |  2 +-
 ...3175054_add_indexes_to_project_mirror_data.rb |  2 +-
 ...0180503193542_add_indexes_to_remote_mirror.rb |  2 +-
 ...d_mirror_available_to_application_settings.rb |  2 +-
 ...00320_enable_prometheus_metrics_by_default.rb |  2 +-
 .../20180504195842_project_name_lower_index.rb   |  2 +-
 ...21_make_remote_mirrors_disabled_by_default.rb |  2 +-
 ...straint_to_project_mirror_data_foreign_key.rb |  2 +-
 ...nt_to_project_mirror_data_project_id_index.rb |  2 +-
 .../20180508135515_set_runner_type_not_null.rb   |  2 +-
 ...090724_add_index_on_ci_runners_runner_type.rb |  2 +-
 ...31058_create_clusters_applications_jupyter.rb |  2 +-
 ...0180515005612_add_squash_to_merge_requests.rb |  2 +-
 .../20180515121227_create_notes_diff_files.rb    |  2 +-
 ...null_constraints_to_project_authorizations.rb |  2 +-
 ...me_merge_requests_allow_maintainer_to_push.rb |  2 +-
 ...requests_target_id_iid_state_partial_index.rb |  2 +-
 ...0180529093006_ensure_remote_mirror_columns.rb |  2 +-
 ...0180530135500_add_index_to_stages_position.rb |  2 +-
 .../20180531185349_add_repository_languages.rb   |  2 +-
 ...ange_default_value_for_dsa_key_restriction.rb |  2 +-
 ...add_deploy_strategy_to_project_auto_devops.rb |  2 +-
 ...add_push_events_branch_filter_to_web_hooks.rb |  2 +-
 db/migrate/20180608091413_add_group_to_todos.rb  |  2 +-
 ..._rename_merge_requests_allow_collaboration.rb |  2 +-
 ...6_add_columns_for_helm_tiller_certificates.rb |  2 +-
 ...0613081317_create_ci_builds_runner_session.rb |  2 +-
 ...0180625113853_create_import_export_uploads.rb |  2 +-
 ...54_add_index_on_deployable_for_deployments.rb |  2 +-
 ...20180628124813_alter_web_hook_logs_indexes.rb |  2 +-
 .../20180629153018_create_site_statistics.rb     |  2 +-
 .../20180702124358_remove_orphaned_routes.rb     |  2 +-
 .../20180702134423_generate_missing_routes.rb    |  2 +-
 ...third_party_offers_to_application_settings.rb |  2 +-
 ...160945_add_file_format_to_ci_job_artifacts.rb |  2 +-
 ...gn_key_from_notification_settings_to_users.rb |  2 +-
 ...180711103851_drop_duplicate_protected_tags.rb |  2 +-
 .../20180711103922_add_protected_tags_index.rb   |  2 +-
 .../20180713092803_create_user_statuses.rb       |  2 +-
 .../20180717125853_remove_restricted_todos.rb    |  2 +-
 ...atistics_visibility_to_application_setting.rb |  2 +-
 ...ive_max_input_size_to_application_settings.rb |  2 +-
 ...0180722103201_add_private_profile_to_users.rb |  2 +-
 ...de_preview_enabled_to_application_settings.rb |  2 +-
 ...0180726172057_create_resource_label_events.rb |  2 +-
 ...remove_redundant_status_index_on_ci_builds.rb |  2 +-
 ...dd_ssh_key_message_to_application_settings.rb |  2 +-
 ...hange_default_of_auto_devops_instance_wide.rb |  2 +-
 ...ble_auto_devops_instance_wide_for_everyone.rb |  2 +-
 .../20180814153625_add_commit_email_to_users.rb  |  2 +-
 ...ation_type_to_cluster_platforms_kubernetes.rb |  2 +-
 ...0409_add_file_location_to_ci_job_artifacts.rb |  2 +-
 ..._partial_index_to_ci_builds_artifacts_file.rb |  2 +-
 .../20180815175440_add_index_on_list_type.rb     |  2 +-
 ...1164904_fix_prometheus_metric_query_limits.rb |  2 +-
 ...831164905_add_common_to_prometheus_metrics.rb |  2 +-
 ...add_index_on_common_for_prometheus_metrics.rb |  2 +-
 ...164908_add_identifier_to_prometheus_metric.rb |  2 +-
 ..._index_for_identifier_to_prometheus_metric.rb |  2 +-
 .../20180831164910_import_common_metrics.rb      |  2 +-
 ...ect_config_source_status_index_to_pipeline.rb |  2 +-
 ..._add_resource_label_event_reference_fields.rb |  2 +-
 ..._user_ping_consent_to_application_settings.rb |  2 +-
 ...6_add_legacy_abac_to_cluster_providers_gcp.rb |  2 +-
 ...836_add_attr_encrypted_columns_to_web_hook.rb |  2 +-
 ...add_token_digest_to_personal_access_tokens.rb |  2 +-
 ..._to_token_digest_on_personal_access_tokens.rb |  2 +-
 .../20180912111628_add_knative_application.rb    |  2 +-
 ...1959_add_index_pipelines_project_id_source.rb |  2 +-
 ...ff_max_patch_bytes_to_application_settings.rb |  2 +-
 ...180924190739_add_scheduled_at_to_ci_builds.rb |  2 +-
 ...24201039_add_partial_index_to_scheduled_at.rb |  2 +-
 .../20180925200829_create_user_preferences.rb    |  2 +-
 ...x_to_project_deploy_tokens_deploy_token_id.rb |  2 +-
 ...002172433_remove_restricted_todos_with_cte.rb |  2 +-
 ...110927_add_index_to_lfs_objects_file_store.rb |  2 +-
 .../20181005125926_add_index_to_uploads_store.rb |  2 +-
 ...0428_create_clusters_kubernetes_namespaces.rb |  2 +-
 ...0235606_create_board_project_recent_visits.rb |  2 +-
 .../20181014203236_create_cluster_groups.rb      |  2 +-
 ...81015155839_add_finished_at_to_deployments.rb |  2 +-
 .../20181016141739_add_status_to_deployments.rb  |  2 +-
 ...016152238_create_board_group_recent_visits.rb |  2 +-
 ...0181017001059_add_cluster_type_to_clusters.rb |  2 +-
 db/migrate/20181019032400_add_shards_table.rb    |  2 +-
 .../20181019032408_add_repositories_table.rb     |  2 +-
 ...dd_projects_pool_repository_id_foreign_key.rb |  2 +-
 ...2135539_add_index_on_status_to_deployments.rb |  2 +-
 ...ve_builds_duration_to_application_settings.rb |  2 +-
 ...al_index_for_legacy_successful_deployments.rb |  2 +-
 ...mit_email_hostname_to_application_settings.rb |  2 +-
 ...igrate_snippets_access_level_default_value.rb |  2 +-
 ...54446_add_missing_indexes_for_foreign_keys.rb |  2 +-
 .../20181031190558_drop_fk_gcp_clusters_table.rb |  2 +-
 .../20181031190559_drop_gcp_clusters_table.rb    |  2 +-
 ...0181101144347_add_index_for_stuck_mr_query.rb |  2 +-
 .../20181106135939_add_index_to_deployments.rb   |  2 +-
 ...9_drop_default_value_on_status_deployments.rb |  2 +-
 db/migrate/gpg_keys_limits_to_mysql.rb           |  2 +-
 ...s_ci_build_trace_chunks_raw_data_for_mysql.rb |  2 +-
 db/migrate/limits_to_mysql.rb                    |  2 +-
 db/migrate/markdown_cache_limits_to_mysql.rb     |  2 +-
 .../merge_request_diff_file_limits_to_mysql.rb   |  2 +-
 db/migrate/prometheus_metrics_limits_to_mysql.rb |  2 +-
 db/optional_migrations/composite_primary_keys.rb |  2 +-
 ..._access_tokens_default_back_to_empty_array.rb |  2 +-
 ...51_remove_inactive_jira_service_properties.rb |  2 +-
 ...ix_project_records_with_invalid_visibility.rb |  2 +-
 .../20161128170531_drop_user_activities_table.rb |  2 +-
 .../20161221140236_remove_unneeded_services.rb   |  2 +-
 ...161221153951_rename_reserved_project_names.rb |  2 +-
 ...0104150317_requeue_pending_delete_projects.rb |  2 +-
 .../20170106142508_fill_authorized_projects.rb   |  2 +-
 ...24_remove_project_authorizations_id_column.rb |  2 +-
 ..._reset_users_authorized_projects_populated.rb |  2 +-
 ...400_remove_inactive_default_email_services.rb |  2 +-
 ...007_remove_trackable_columns_from_timelogs.rb |  2 +-
 ...06101030_validate_foreign_keys_on_timelogs.rb |  2 +-
 ...date_foreign_keys_on_oauth_openid_requests.rb |  2 +-
 ...11073944_disable_invalid_service_templates.rb |  2 +-
 ...111112_delete_deprecated_gitlab_ci_service.rb |  2 +-
 .../20170215200045_remove_theme_id_from_users.rb |  2 +-
 ...40_migrate_build_events_to_pipeline_events.rb |  2 +-
 ...170306170512_migrate_legacy_manual_actions.rb |  2 +-
 ...09171644_reset_relative_position_for_issue.rb |  2 +-
 ...3133418_rename_more_reserved_project_names.rb |  2 +-
 ...170317162059_update_upload_paths_to_system.rb |  2 +-
 ..._user_activities_to_users_last_activity_on.rb |  2 +-
 ...170532_remove_notes_original_discussion_id.rb |  2 +-
 .../20170406111121_clean_upload_symlinks.rb      |  2 +-
 .../20170406142253_migrate_user_project_view.rb  |  2 +-
 ...0170408033905_remove_old_cache_directories.rb |  2 +-
 ...170412174900_rename_reserved_dynamic_paths.rb |  2 +-
 ...te_trigger_schedules_to_pipeline_schedules.rb |  2 +-
 ...0425130047_drop_ci_trigger_schedules_table.rb |  2 +-
 ...able_auto_cancel_pending_pipelines_for_all.rb |  2 +-
 ...anup_namespaceless_pending_delete_projects.rb |  2 +-
 ...20170503004427_update_retried_for_ci_build.rb |  2 +-
 ...remove_users_authorized_projects_populated.rb |  2 +-
 ...7_add_head_pipeline_for_each_merge_request.rb |  2 +-
 ...add_foreign_key_on_pipeline_schedule_owner.rb |  2 +-
 ...ename_web_hooks_build_events_to_job_events.rb |  2 +-
 ...rename_services_build_events_to_job_events.rb |  2 +-
 .../20170516165238_cleanup_trigger_for_issues.rb |  2 +-
 ...5_add_constraints_to_issue_assignees_table.rb |  2 +-
 ...200835_rename_users_with_renamed_namespace.rb |  2 +-
 .../20170518231126_fix_wrongly_renamed_routes.rb |  2 +-
 ...170523073948_remove_assignee_id_from_issue.rb |  2 +-
 .../20170523083112_migrate_old_artifacts.rb      |  2 +-
 ...0525140254_rename_all_reserved_paths_again.rb |  2 +-
 .../20170526185842_migrate_pipeline_stages.rb    |  2 +-
 ...0526185858_create_index_in_pipeline_stages.rb |  2 +-
 ...26185901_remove_stage_id_index_from_builds.rb |  2 +-
 ...170526185921_migrate_build_stage_reference.rb |  2 +-
 ...190000_migrate_build_stage_reference_again.rb |  2 +-
 ...0531203055_cleanup_users_ldap_email_rename.rb |  2 +-
 ...170606202615_move_appearance_to_system_dir.rb |  2 +-
 ...rt_custom_notification_settings_to_columns.rb |  2 +-
 ...70609183112_remove_position_from_issuables.rb |  2 +-
 ...0170612071012_move_personal_snippets_files.rb |  2 +-
 .../20170613111224_clean_appearance_symlinks.rb  |  2 +-
 ...0170621102400_add_stage_id_index_to_builds.rb |  2 +-
 .../20170627101016_schedule_event_migrations.rb  |  2 +-
 ...8_migrate_stage_id_reference_in_background.rb |  2 +-
 ...application_settings_signin_enabled_rename.rb |  2 +-
 ...158_schedule_merge_request_diff_migrations.rb |  2 +-
 .../20170711145558_migrate_stages_statuses.rb    |  2 +-
 ..._cleanup_move_system_upload_folder_symlink.rb |  2 +-
 ...queue_migrate_system_uploads_to_new_folder.rb |  2 +-
 ..._merge_issuable_reopened_into_opened_state.rb |  2 +-
 ...4_remove_events_from_notification_settings.rb |  2 +-
 ...90603_calculate_conv_dev_index_percentages.rb |  2 +-
 ...emove_locked_at_column_from_merge_requests.rb |  2 +-
 ...personal_snippet_files_into_correct_folder.rb |  2 +-
 .../20170815060945_remove_duplicate_mr_events.rb |  2 +-
 ...existing_namespace_pending_delete_projects.rb |  2 +-
 ...0822101017_migrate_pipeline_sidekiq_queues.rb |  2 +-
 ...ost_deploy_migrate_user_external_mail_data.rb |  2 +-
 ...28170513_remove_user_email_provider_column.rb |  2 +-
 ...28170516_remove_user_external_mail_columns.rb |  2 +-
 .../20170830084744_destroy_gpg_signatures.rb     |  2 +-
 ...0830150306_drop_events_for_migration_table.rb |  2 +-
 ...remove_valid_signature_from_gpg_signatures.rb |  2 +-
 ...7170235_delete_conflicting_redirect_routes.rb |  2 +-
 ...80600_fix_projects_without_project_feature.rb |  2 +-
 .../20170921101004_normalize_ldap_extern_uids.rb |  2 +-
 ...ule_merge_request_diff_migrations_take_two.rb |  2 +-
 ...8_update_legacy_diff_notes_type_for_import.rb |  2 +-
 ...0170927112319_update_notes_type_for_import.rb |  2 +-
 ...edule_create_gpg_key_subkeys_from_gpg_keys.rb |  2 +-
 ...012150314_remove_user_authentication_token.rb |  2 +-
 ...gcp_clusters_to_new_clusters_architectures.rb |  2 +-
 ...st_latest_merge_request_diff_id_migrations.rb |  2 +-
 ...435_remove_ref_fetched_from_merge_requests.rb |  2 +-
 .../20171103140253_track_untracked_uploads.rb    |  2 +-
 ...ngs_password_authentication_enabled_rename.rb |  2 +-
 .../20171106154015_remove_issues_branch_name.rb  |  2 +-
 ...1_cleanup_add_timezone_to_issues_closed_at.rb |  2 +-
 .../20171114104051_remove_empty_fork_networks.rb |  2 +-
 ...merge_request_diff_st_commits_and_st_diffs.rb |  2 +-
 ...71123101020_update_circuitbreaker_defaults.rb |  2 +-
 ...123101046_remove_old_circuitbreaker_config.rb |  2 +-
 ...erge_request_diffs_merge_request_id_and_id.rb |  2 +-
 ..._merge_request_diffs_merge_request_diff_id.rb |  2 +-
 ...etes_service_to_new_clusters_architectures.rb |  2 +-
 ...124150326_reschedule_fork_network_creation.rb |  2 +-
 ...ate_merge_request_metrics_with_events_data.rb |  2 +-
 ...11_reschedule_fork_network_creation_caller.rb |  2 +-
 ...150300_remove_project_labels_group_id_copy.rb |  2 +-
 ...20171207150343_remove_soft_removed_objects.rb |  2 +-
 .../20171207150344_remove_deleted_at_columns.rb  |  2 +-
 ...ithub_importer_advance_stage_sidekiq_queue.rb |  2 +-
 ...opulate_can_push_from_deploy_keys_projects.rb |  2 +-
 .../20171215121259_remove_can_push_from_keys.rb  |  2 +-
 ...21201_normalize_extern_uid_from_identities.rb |  2 +-
 ...0220_schedule_issues_closed_at_type_change.rb |  2 +-
 ...e_set_confidential_note_events_on_webhooks.rb |  2 +-
 ...119121225_remove_redundant_pipeline_stages.rb |  2 +-
 ...e_set_confidential_note_events_on_services.rb |  2 +-
 ...80202111106_remove_project_labels_group_id.rb |  2 +-
 ...0836_change_author_id_to_not_null_in_todos.rb |  2 +-
 ...01828_add_tmp_partial_null_index_to_builds.rb |  2 +-
 ...80212101928_schedule_build_stage_migration.rb |  2 +-
 ..._remove_tmp_partial_null_index_from_builds.rb |  2 +-
 ...121020_fill_pages_domain_verification_code.rb |  2 +-
 ...121030_enqueue_verify_pages_domain_workers.rb |  2 +-
 ...0_remove_empty_extern_uid_auth0_identities.rb |  2 +-
 ...24427_build_user_interacted_projects_table.rb |  6 +++---
 ...84653_change_project_namespace_id_not_null.rb |  2 +-
 ...0050_remove_permanent_from_redirect_routes.rb |  2 +-
 ...igrate_create_trace_artifact_sidekiq_queue.rb |  2 +-
 ...06164012_add_path_index_to_redirect_routes.rb |  2 +-
 ...d_pipeline_for_merge_request_sidekiq_queue.rb |  2 +-
 ...5101928_reschedule_builds_stages_migration.rb |  2 +-
 ...80408143355_cleanup_users_rss_token_rename.rb |  2 +-
 ...09_populate_missing_project_ci_cd_settings.rb |  2 +-
 ...0420080616_schedule_stages_index_migration.rb |  2 +-
 .../20180424151928_fill_file_store.rb            |  2 +-
 ...ll_runner_type_for_ci_runners_post_migrate.rb |  2 +-
 ..._data_from_projects_to_project_mirror_data.rb |  2 +-
 ...07083701_set_minimal_project_build_timeout.rb |  2 +-
 ..._constraint_to_project_features_project_id.rb |  2 +-
 ..._constraint_to_project_features_project_id.rb |  2 +-
 .../20180514161336_remove_gemnasium_service.rb   |  2 +-
 ...mr_metrics_populating_background_migration.rb |  2 +-
 ...e_requests_allow_maintainer_to_push_rename.rb |  2 +-
 ...29152628_schedule_to_archive_legacy_traces.rb |  2 +-
 ...igrate_object_storage_upload_sidekiq_queue.rb |  2 +-
 ...04123514_cleanup_stages_position_migration.rb |  2 +-
 ..._merge_requests_allow_collaboration_rename.rb |  2 +-
 ...19121030_enqueue_delete_diff_files_workers.rb |  2 +-
 ...x_to_projects_for_last_repository_check_at.rb |  2 +-
 ...0647_enqueue_fix_cross_project_label_links.rb |  2 +-
 .../20180704145007_update_project_indexes.rb     |  2 +-
 .../20180706223200_populate_site_statistics.rb   |  2 +-
 ...17_delete_inconsistent_internal_id_records.rb |  2 +-
 ...0809195358_migrate_null_wiki_access_levels.rb |  2 +-
 ..._migrate_legacy_artifacts_to_job_artifacts.rb |  2 +-
 ...0180816193530_rename_login_root_namespaces.rb |  2 +-
 ...20180826111825_recalculate_site_statistics.rb |  2 +-
 ...20180906051323_remove_orphaned_label_links.rb |  2 +-
 ...consume_remaining_diff_files_deletion_jobs.rb |  2 +-
 ...237_schedule_digest_personal_access_tokens.rb |  2 +-
 .../20180914162043_encrypt_web_hooks_columns.rb  |  2 +-
 ...dekiq_throttling_from_application_settings.rb |  2 +-
 ...16014356_populate_external_pipeline_source.rb |  2 +-
 ...41_remove_wikis_count_from_site_statistics.rb |  2 +-
 .../20181008145341_steal_encrypt_columns.rb      |  2 +-
 ...81008145359_remove_web_hooks_token_and_url.rb |  2 +-
 .../20181008200441_remove_circuit_breaker.rb     |  2 +-
 ...24_remove_koding_from_application_settings.rb |  2 +-
 .../20181014121030_enqueue_redact_links.rb       |  2 +-
 ...ueue_populate_cluster_kubernetes_namespace.rb |  2 +-
 ...5124_fill_empty_finished_at_in_deployments.rb |  2 +-
 .../20181105201455_steal_fill_store_upload.rb    |  2 +-
 ...181107054254_remove_restricted_todos_again.rb |  2 +-
 .../20170206203234_create_project_registry.rb    |  2 +-
 .../20170223033541_create_file_registry.rb       |  2 +-
 ...dd_index_to_project_id_on_project_registry.rb |  2 +-
 ...20170526214010_convert_file_bytes_to_int64.rb |  2 +-
 .../20170605154253_create_event_log_state.rb     |  2 +-
 ...55045_add_needs_resync_to_project_registry.rb |  2 +-
 ...dd_last_wiki_synced_at_to_project_registry.rb |  2 +-
 ...170627195211_add_index_to_project_registry.rb |  2 +-
 ...22_remove_duplicates_from_project_registry.rb |  2 +-
 ...ue_index_to_project_id_on_project_registry.rb |  2 +-
 ...05045404_remove_file_uploads_from_registry.rb |  2 +-
 .../20171009162208_add_file_registry_success.rb  |  2 +-
 ...1009162209_add_file_registry_success_index.rb |  2 +-
 ...05200_add_retry_count_fields_to_registries.rb |  2 +-
 ..._add_last_sync_failure_to_project_registry.rb |  2 +-
 ...epository_verification_to_project_registry.rb |  2 +-
 ...oject_registy_verification_failure_columns.rb |  2 +-
 ..._index_to_project_registy_checksum_columns.rb |  2 +-
 ...ge_repository_verification_checksum_to_sha.rb |  2 +-
 ...rate_ci_job_artifacts_to_separate_registry.rb |  2 +-
 ...05_add_missing_on_primary_to_file_registry.rb |  2 +-
 ...ex_to_project_registy_checksum_sha_columns.rb |  2 +-
 ...ssing_on_primary_to_job_artifact_registry..rb |  2 +-
 ...tial_index_project_repository_verification.rb |  2 +-
 ...ex_to_artifact_id_on_job_artifact_registry.rb |  2 +-
 ...ecksum_mismatch_fields_to_project_registry.rb |  2 +-
 ...ecksum_mismatch_fields_on_project_registry.rb |  2 +-
 ...d_repository_check_to_geo_project_registry.rb |  2 +-
 ...23634_set_resync_flag_for_retried_projects.rb |  2 +-
 ...esync_was_scheduled_at_to_project_registry.rb |  2 +-
 ...add_missing_on_primary_to_project_registry.rb |  2 +-
 ...ry_verification_fields_to_project_registry.rb |  2 +-
 ...0048_add_synced_repositories_partial_index.rb |  2 +-
 ..._add_failed_synchronizations_partial_index.rb |  2 +-
 ...add_pending_synchronizations_partial_index.rb |  2 +-
 ...n_failed_columns_from_geo_project_registry.rb |  2 +-
 ...ation_at_columns_from_geo_project_registry.rb |  2 +-
 ...ication_checksum_from_geo_project_registry.rb |  2 +-
 ...06_delete_job_artifacts_from_file_registry.rb |  2 +-
 ee/db/migrate/20140319135450_init_ee_schema.rb   |  2 +-
 .../migrate/20140414093351_create_appearances.rb |  2 +-
 .../20140508105809_add_mr_template_to_project.rb |  2 +-
 ..._username_password_api_version_to_services.rb |  2 +-
 ...1083829_add_unsubscribed_at_field_to_users.rb |  2 +-
 ...7_add_jira_issue_transition_id_to_services.rb |  2 +-
 .../20140813090117_add_ldap_groups_table.rb      |  2 +-
 ...33925_rename_ldap_group_to_ldap_group_link.rb |  2 +-
 ...20140907223153_remove_columns_for_services.rb |  2 +-
 ...010132608_add_provider_to_ldap_group_links.rb |  2 +-
 ...7173526_add_author_email_regex_to_git_hook.rb |  2 +-
 ...141030133853_add_member_check_to_git_hooks.rb |  2 +-
 ...103160516_add_file_name_regex_to_git_hooks.rb |  2 +-
 .../20141212124604_add_group_membership_lock.rb  |  2 +-
 ...1213212220_add_header_logos_to_appearances.rb |  2 +-
 ...230100055_remove_old_fields_from_namespace.rb |  2 +-
 ...50125163158_add_rebase_setting_to_projects.rb |  2 +-
 ...25214822_help_text_to_application_settings.rb |  2 +-
 .../20150312000132_add_group_id_to_web_hooks.rb  |  2 +-
 .../20150324223425_add_is_sample_to_git_hooks.rb |  2 +-
 ee/db/migrate/20150501095306_create_licenses.rb  |  2 +-
 .../20150507194350_create_historical_data.rb     |  2 +-
 ...50605131047_add_max_file_size_to_git_hooks.rb |  2 +-
 ee/db/migrate/20150609113337_create_approves.rb  |  2 +-
 .../20150609125332_add_project_merge_approves.rb |  2 +-
 .../20150707222220_add_approvers_table.rb        |  2 +-
 ...50709134649_add_reset_approvers_to_project.rb |  2 +-
 .../20150717155058_rename_reset_approvers.rb     |  2 +-
 .../20150731200022_remove_invalid_approvers.rb   |  2 +-
 .../20150827144737_migrate_rebase_feature.rb     |  2 +-
 ...50929160851_add_issues_template_to_project.rb |  2 +-
 .../migrate/20151007110107_update_group_links.rb |  2 +-
 .../20151110125416_add_mirror_to_project.rb      |  2 +-
 ...113115819_canonicalize_kerberos_identities.rb |  2 +-
 .../migrate/20151208110020_add_note_to_users.rb  |  2 +-
 .../20151209222208_add_weight_to_issue.rb        |  2 +-
 .../20151215005729_rename_jenkins_service.rb     |  2 +-
 ...nge_max_file_size_to_not_null_on_git_hooks.rb |  2 +-
 ee/db/migrate/20160112174440_create_geo_nodes.rb |  2 +-
 ...0055_add_mirror_trigger_builds_to_projects.rb |  2 +-
 .../20160129075828_create_index_statuses.rb      |  2 +-
 ...0204190809_update_jenkins_service_category.rb |  2 +-
 ...0160221013512_add_geo_node_key_to_geo_node.rb |  2 +-
 ...258_add_doorkeeper_application_to_geo_node.rb |  2 +-
 ...2141317_rename_header_field_on_appearrance.rb |  2 +-
 ...802_add_secondary_extern_uid_to_identities.rb |  2 +-
 .../20160316124047_git_hooks_project_id_index.rb |  2 +-
 ...0160317191509_add_last_sync_time_to_groups.rb |  2 +-
 .../20160321161032_create_remote_mirrors_ee.rb   |  2 +-
 ...20160414064845_add_system_hook_to_geo_node.rb |  2 +-
 ...make_remote_mirrors_disabled_by_default_ee.rb |  2 +-
 .../20160601102211_create_path_locks_table.rb    |  2 +-
 ...60611101122_add_es_to_application_settings.rb |  2 +-
 ...15092001_disable_mirror_without_import_url.rb |  2 +-
 ...d_approvals_before_merge_to_merge_requests.rb |  2 +-
 ...60705111606_rename_git_hooks_to_push_rules.rb |  2 +-
 ...160718210912_add_ldap_sync_state_to_groups.rb |  2 +-
 ...0939_add_ldap_sync_state_indices_to_groups.rb |  2 +-
 ...ve_last_ldap_sync_status_index_from_groups.rb |  2 +-
 ...9_remove_last_ldap_sync_status_from_groups.rb |  2 +-
 ...ser_id_to_protected_branches_access_levels.rb |  2 +-
 ...w_nulls_for_protected_branch_access_levels.rb |  2 +-
 ...0160810153405_remove_geo_node_key_id_index.rb |  2 +-
 ..._columns_to_protected_branch_access_levels.rb |  2 +-
 ...ository_size_limit_to_application_settings.rb |  2 +-
 ...e_mirror_when_empty_import_url_in_projects.rb |  2 +-
 ...160906143504_add_ldap_attributes_to_member.rb |  2 +-
 ...2608_add_repository_size_limit_to_projects.rb |  2 +-
 ...37_add_repository_size_limit_to_namespaces.rb |  2 +-
 ...15201649_add_prevent_secrets_to_push_rules.rb |  2 +-
 .../20160916101334_add_approver_groups.rb        |  2 +-
 .../migrate/20161005144359_add_name_to_boards.rb |  2 +-
 ...735_migrate_ee_sidekiq_queues_from_default.rb |  2 +-
 .../20161030005533_add_estimate_to_issuables.rb  |  2 +-
 ee/db/migrate/20161030020610_create_timelogs.rb  |  2 +-
 ...1230123835_add_squash_to_merge_requests_ee.rb |  2 +-
 ...ed_runners_minutes_to_application_settings.rb |  2 +-
 ..._shared_runners_minutes_limit_to_namespace.rb |  2 +-
 ...06172236_create_table_namespace_statistics.rb |  2 +-
 ...ared_runners_seconds_to_project_statistics.rb |  2 +-
 ...on_settings_repository_size_limit_to_bytes.rb |  2 +-
 ...rt_projects_repository_size_limit_to_bytes.rb |  2 +-
 ..._namespaces_repository_size_limit_to_bytes.rb |  2 +-
 ...20170120123345_add_column_auditor_to_users.rb |  2 +-
 ...c_schedule_to_projects_and_remote_projects.rb |  2 +-
 .../20170202114129_add_milestone_id_to_boards.rb |  2 +-
 .../20170207150212_add_indexes_to_mirrors.rb     |  2 +-
 ...add_index_to_mirrors_last_update_at_fields.rb |  2 +-
 ...m_mirror_sync_time_to_application_settings.rb |  2 +-
 .../20170215151539_add_aws_elasticsearch.rb      |  2 +-
 ...5151540_migrate_old_elasticsearch_settings.rb |  2 +-
 ...15151541_remove_old_elasticsearch_settings.rb |  2 +-
 .../20170216000450_add_enabled_to_geo_nodes.rb   |  2 +-
 ...0170224075132_add_access_keys_to_geo_nodes.rb |  2 +-
 ...180725_add_index_to_milestone_id_on_boards.rb |  2 +-
 ..._geo_status_timout_to_application_settings.rb |  2 +-
 ...perimental_indexer_to_application_settings.rb |  2 +-
 .../20170404223037_add_service_desk_settings.rb  |  2 +-
 ...5104_notes_metadata_remove_approvals_value.rb |  2 +-
 ...remove_service_desk_mail_key_from_projects.rb |  2 +-
 ...44_add_index_to_approvals_merge_request_id.rb |  2 +-
 ...update_started_at_column_to_remote_mirrors.rb |  2 +-
 ...170505133904_update_geo_nodes_system_hooks.rb |  2 +-
 ...170509153720_create_project_mirror_data_ee.rb |  2 +-
 .../20170512131952_add_plan_to_namespace.rb      |  2 +-
 ...eck_namespace_plan_to_application_settings.rb |  2 +-
 .../20170513005817_add_push_rule_branch_name.rb  |  2 +-
 ...add_mirror_settings_to_application_setting.rb |  2 +-
 .../20170517162048_create_issue_links_table.rb   |  2 +-
 ...94603_create_geo_repository_updated_events.rb |  2 +-
 .../20170522201800_create_geo_event_log.rb       |  2 +-
 ...0525174157_create_pipeline_source_pipeline.rb |  2 +-
 ...58_add_ci_pipeline_source_pipeline_indexes.rb |  2 +-
 ...dd_ci_pipeline_source_pipeline_foreign_key.rb |  2 +-
 ...602003304_add_clone_url_prefix_to_geo_node.rb |  2 +-
 ...ing_approvers_per_merge_request_to_project.rb |  2 +-
 ...53336_create_geo_repository_deleted_events.rb |  2 +-
 ..._geo_repository_deleted_events_foreign_key.rb |  2 +-
 ...70620063751_remove_geo_primary_system_hook.rb |  2 +-
 .../20170620143011_add_slack_integrationtable.rb |  2 +-
 ...6_add_ee_foreign_keys_pointing_to_projects.rb |  2 +-
 ...170622131529_add_foreign_key_for_approvals.rb |  2 +-
 ...95236_create_geo_repository_renamed_events.rb |  2 +-
 ..._geo_repository_renamed_events_foreign_key.rb |  2 +-
 ...25171421_add_slack_to_application_settings.rb |  2 +-
 ...20170626202753_update_authorized_keys_file.rb |  2 +-
 ...uthorized_keys_enabled_application_setting.rb |  2 +-
 ...21518_make_service_desk_enabled_by_default.rb |  2 +-
 ...0717213940_create_geo_node_namespace_links.rb |  2 +-
 .../20170718185922_add_group_id_to_boards.rb     |  2 +-
 .../20170718190627_add_group_boards_indexes.rb   |  2 +-
 ...r_delay_to_minutes_in_application_settings.rb |  2 +-
 ...s_to_admins_option_to_application_settings.rb |  2 +-
 ...0801200418_geo_repositories_changed_events.rb |  2 +-
 ...eo_repositories_changed_events_foreign_key.rb |  2 +-
 ...8005254_add_email_opted_in_fields_to_users.rb |  2 +-
 ee/db/migrate/20170808155717_create_plans.rb     |  2 +-
 .../20170808155912_add_plan_id_to_namespaces.rb  |  2 +-
 ...70811203342_fix_email_opted_in_at_on_users.rb |  2 +-
 ...sary_timestamp_columns_in_geo_event_tables.rb |  2 +-
 ...33132_create_geo_repository_created_events.rb |  2 +-
 ..._geo_event_log_repository_created_event_id.rb |  2 +-
 ...02320_add_missing_indexes_to_geo_event_log.rb |  2 +-
 ...ository_created_events_fk_on_geo_event_log.rb |  2 +-
 ...rrect_protected_access_levels_foreign_keys.rb |  2 +-
 ...813_drop_cn_constraint_to_ldap_group_links.rb |  2 +-
 ...70911134018_add_filter_to_ldap_group_links.rb |  2 +-
 ..._add_reject_unsigned_commits_to_push_rules.rb |  2 +-
 ...20091408_add_index_for_pushrules_is_sample.rb |  2 +-
 .../20170926200545_add_weight_to_boards.rb       |  2 +-
 .../20170926203418_create_board_labels.rb        |  2 +-
 ...20170928081016_add_pipeline_quotas_to_plan.rb |  2 +-
 .../20171002105019_create_missing_free_plan.rb   |  2 +-
 ...8_add_commit_committer_check_to_push_rules.rb |  2 +-
 .../20171010095526_create_board_assignees.rb     |  2 +-
 ...1010140746_geo_configurable_max_capacities.rb |  2 +-
 ee/db/migrate/20171012070521_create_epics.rb     |  2 +-
 ...20171013192542_add_geo_node_clone_protocol.rb |  2 +-
 ...e_mirror_available_to_application_settings.rb |  2 +-
 ...mirror_available_overridden_to_projects_ee.rb |  2 +-
 .../20171031055422_create_geo_node_statuses.rb   |  2 +-
 ...a_next_execution_timestamp_and_retry_count.rb |  2 +-
 .../20171107130813_create_epic_issues_table.rb   |  2 +-
 ..._create_geo_hashed_storage_migrated_events.rb |  2 +-
 ...hashed_storage_migrated_events_foreign_key.rb |  2 +-
 ...only_mirror_protected_branches_to_projects.rb |  2 +-
 ..._only_protected_branches_to_remote_mirrors.rb |  2 +-
 ...43816_create_geo_lfs_object_deleted_events.rb |  2 +-
 ..._geo_lfs_object_deleted_events_foreign_key.rb |  2 +-
 ...achments_migration_to_geo_migration_events.rb |  2 +-
 ...0171124164248_store_geo_nodes_url_directly.rb |  2 +-
 .../20171124164249_index_geo_nodes_url.rb        |  2 +-
 ...emote_mirror_available_to_mirror_available.rb |  2 +-
 ...ll_mirror_available_overridden_to_projects.rb |  2 +-
 ...130151759_create_geo_upload_deleted_events.rb |  2 +-
 ..._add_geo_upload_deleted_events_foreign_key.rb |  2 +-
 ...1204112945_add_geo_replication_slot_status.rb |  2 +-
 ...7105719_add_wiki_info_to_geo_node_statuses.rb |  2 +-
 ...horization_settings_to_appliction_settings.rb |  2 +-
 ...20171214115254_add_position_to_epic_issues.rb |  2 +-
 ...n_service_classification_label_to_projects.rb |  2 +-
 ...22151344_add_regexp_uses_re2_to_push_rules.rb |  2 +-
 ...4731_create_geo_job_artifact_deleted_event.rb |  2 +-
 ...eo_job_artifact_deleted_events_foreign_key.rb |  2 +-
 ...d_job_artifact_counts_to_geo_node_statuses.rb |  2 +-
 ...09150457_add_remote_name_to_remote_mirrors.rb |  2 +-
 .../20180115013218_create_saml_providers.rb      |  2 +-
 ...94742_add_default_project_creation_setting.rb |  2 +-
 ...13902_add_project_creation_level_to_groups.rb |  2 +-
 ...20180126165535_geo_selective_sync_by_shard.rb |  2 +-
 .../20180131104538_add_date_indexes_to_epics.rb  |  2 +-
 ...1101405_change_geo_node_status_column_size.rb |  2 +-
 ...re_version_and_revision_in_geo_node_status.rb |  2 +-
 ...206184810_create_project_repository_states.rb |  2 +-
 .../20180209115333_create_chatops_tables.rb      |  2 +-
 ...or_overwrites_diverged_branches_to_project.rb |  2 +-
 ...225180932_add_geo_node_verification_status.rb |  2 +-
 ...551_add_external_webhook_token_to_projects.rb |  2 +-
 ...ing_for_projects_with_invalid_mirror_users.rb |  2 +-
 ...project_repository_states_checksum_columns.rb |  2 +-
 ...on_service_timeout_to_application_settings.rb |  2 +-
 ...er_and_footer_banners_to_appearances_table.rb |  2 +-
 ...ect_repository_states_verification_columns.rb |  2 +-
 ...auth_mutual_tls_fields_to_project_settings.rb |  2 +-
 ...0317020334_add_saml_provider_to_identities.rb |  2 +-
 .../20180320142552_create_prometheus_alerts.rb   |  2 +-
 ...e_protected_branch_unprotect_access_levels.rb |  2 +-
 ...ing_on_primary_counts_to_geo_node_statuses.rb |  2 +-
 ...il_additional_text_to_application_settings.rb |  2 +-
 ...op_null_constraint_geo_events_storage_path.rb |  2 +-
 ...9_add_checksum_fields_to_geo_node_statuses.rb |  2 +-
 ...x_for_tracking_mirrored_ci_cd_repositories.rb |  2 +-
 ...180419171038_create_vulnerability_feedback.rb |  2 +-
 ...negative_matching_commit_message_push_rule.rb |  2 +-
 ...add_missing_columns_to_project_mirror_data.rb |  2 +-
 ...rovider_index_and_constraint_to_identities.rb |  2 +-
 ...4922_add_indexes_to_project_mirror_data_ee.rb |  2 +-
 ...20211048_add_discovery_token_to_namespaces.rb |  2 +-
 ...date_started_at_to_applications_prometheus.rb |  2 +-
 .../20180531031410_add_index_for_active_users.rb |  2 +-
 ...udonymizer_enabled_to_application_settings.rb |  2 +-
 ee/db/migrate/20180607154422_add_user_to_list.rb |  2 +-
 .../20180607154516_add_user_index_to_list.rb     |  2 +-
 .../20180607154645_add_user_fk_to_list.rb        |  2 +-
 ...36_add_geo_nodes_verification_max_capacity.rb |  2 +-
 ...152524_add_project_to_application_settings.rb |  2 +-
 .../20180621100024_create_software_licenses.rb   |  2 +-
 ...621100025_create_software_license_policies.rb |  2 +-
 ...0623053658_add_trial_ends_on_to_namespaces.rb |  2 +-
 ...180626171125_add_feature_flags_to_projects.rb |  2 +-
 ..._schedule_weight_system_note_comma_cleanup.rb |  2 +-
 ..._retry_fields_to_project_repository_states.rb |  2 +-
 ...templates_group_id_to_application_settings.rb |  2 +-
 ...709183353_add_protected_environments_table.rb |  2 +-
 ...cted_environment_deploy_access_level_table.rb |  2 +-
 .../20180711014025_add_date_columns_to_epics.rb  |  2 +-
 ...0180711014026_update_date_columns_on_epics.rb |  2 +-
 ...up_from_weight_system_note_comma_migration.rb |  2 +-
 ...719161844_add_storage_configuration_digest.rb |  2 +-
 ...20180720082636_add_name_index_to_ci_builds.rb |  2 +-
 .../20180720120716_create_packages_packages.rb   |  2 +-
 ...180720120726_create_packages_package_files.rb |  2 +-
 ...80720121404_create_packages_maven_metadata.rb |  2 +-
 ...3517_add_new_epic_to_notification_settings.rb |  2 +-
 ...20180723081631_add_roadmap_layout_to_users.rb |  2 +-
 ...nowplow_attributes_to_application_settings.rb |  2 +-
 .../20180724161450_add_milestone_to_lists.rb     |  2 +-
 ...fication_retry_counts_to_geo_node_statuses.rb |  2 +-
 ...20_add_projects_count_to_geo_node_statuses.rb |  2 +-
 ...747_add_index_to_environment_name_for_like.rb |  2 +-
 ...0823132905_add_packages_enabled_to_project.rb |  2 +-
 ...0180831134049_allow_many_prometheus_alerts.rb |  2 +-
 ...merge_requests_author_approval_to_projects.rb |  2 +-
 .../20180910104020_add_closed_columns_to_epic.rb |  2 +-
 .../migrate/20180910105100_add_state_to_epic.rb  |  2 +-
 .../migrate/20180917145556_create_draft_notes.rb |  2 +-
 ...180917171038_create_vulnerability_scanners.rb |  2 +-
 ...917171533_create_vulnerability_occurrences.rb |  2 +-
 ...917171534_create_vulnerability_identifiers.rb |  2 +-
 ...reate_vulnerability_occurrence_identifiers.rb |  2 +-
 ...917213751_create_geo_reset_checksum_events.rb |  2 +-
 ..._add_geo_reset_checksum_events_foreign_key.rb |  2 +-
 .../20180920043317_add_foreign_key_to_epics.rb   |  2 +-
 ...20180924070647_add_label_event_epic_column.rb |  2 +-
 ...838_add_namespace_file_template_project_id.rb |  2 +-
 ...80926140319_create_prometheus_alert_events.rb |  2 +-
 ...s_and_vulnerability_occurrence_identifiers.rb |  2 +-
 ...72126_create_geo_cache_invalidation_events.rb |  2 +-
 ..._geo_cache_invalidation_events_foreign_key.rb |  2 +-
 ...81004131020_change_vuln_occurrence_columns.rb |  2 +-
 ...181004131025_add_vuln_occurrence_pipelines.rb |  2 +-
 ...151642_create_users_ops_dashboard_projects.rb |  2 +-
 ...017131623_add_missing_geo_even_log_indexes.rb |  2 +-
 ...31445_add_index_to_namespace_trial_ends_on.rb |  2 +-
 .../20181025000427_add_tracing_settings.rb       |  2 +-
 ...20181028092114_create_smartcard_identities.rb |  2 +-
 ...28092115_add_index_to_smartcard_identities.rb |  2 +-
 ...03_add_missing_indexes_for_foreign_keys_ee.rb |  2 +-
 ...emove_sync_time_column_from_remote_mirrors.rb |  2 +-
 ...mirror_sync_time_from_application_settings.rb |  2 +-
 .../20170530111134_ensure_project_mirror_data.rb |  2 +-
 ...20170808163512_remove_plan_from_namespaces.rb |  2 +-
 ...11082658_remove_system_hook_from_geo_nodes.rb |  2 +-
 .../20171103152048_geo_drain_redis_queues.rb     |  2 +-
 ...24165823_remove_geo_nodes_url_part_columns.rb |  2 +-
 .../20171124182517_remove_geo_ssh_repo_sync.rb   |  2 +-
 ...229_cleanup_remote_mirror_available_rename.rb |  2 +-
 ..._at_columns_from_project_repository_states.rb |  2 +-
 ...led_columns_from_project_repository_states.rb |  2 +-
 ...p_repository_storage_events_for_geo_events.rb |  2 +-
 ...ributes_data_from_projects_to_import_state.rb |  2 +-
 ..._project_mirror_data_created_at_updated_at.rb |  2 +-
 ...project_repository_states_checksum_columns.rb |  2 +-
 ...ository_storage_last_repository_updated_at.rb |  2 +-
 ...8193715_schedule_prune_orphaned_geo_events.rb |  2 +-
 ...13171825_update_epic_dates_from_milestones.rb |  2 +-
 ..._repositories_count_from_geo_node_statuses.rb |  2 +-
 ...95058_schedule_repository_checksum_cleanup.rb |  2 +-
 ...181014131030_enqueue_redact_links_in_epics.rb |  2 +-
 .../migration/create_table_migration.rb          |  2 +-
 .../active_record/migration/migration.rb         |  2 +-
 .../rails/post_deployment_migration/migration.rb |  2 +-
 lib/rails4_migration_version.rb                  | 16 ++++++++++++++++
 1405 files changed, 1424 insertions(+), 1405 deletions(-)
 create mode 100644 lib/rails4_migration_version.rb

diff --git a/config/application.rb b/config/application.rb
index 1ad647bbb5cf7..e67ae371afeb5 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -28,6 +28,9 @@ class Application < Rails::Application
     # setting disabled
     require_dependency Rails.root.join('lib/mysql_zero_date')
 
+    # This can be removed when we drop support for rails 4
+    require_dependency Rails.root.join('lib/rails4_migration_version')
+
     # Settings in config/environments/* take precedence over those specified here.
     # Application configuration should go into files in config/initializers
     # -- all .rb files in that directory are automatically loaded.
diff --git a/db/migrate/20140313092127_init_schema.rb b/db/migrate/20140313092127_init_schema.rb
index 29fb386ad764e..4188599b4b468 100644
--- a/db/migrate/20140313092127_init_schema.rb
+++ b/db/migrate/20140313092127_init_schema.rb
@@ -1,4 +1,4 @@
-class InitSchema < ActiveRecord::Migration
+class InitSchema < ActiveRecord::Migration[4.2]
   DOWNTIME = true
 
   # rubocop:disable Metrics/AbcSize
diff --git a/db/migrate/20140407135544_fix_namespaces.rb b/db/migrate/20140407135544_fix_namespaces.rb
index 3d2ca5c13c4e6..b16d65c4b5118 100644
--- a/db/migrate/20140407135544_fix_namespaces.rb
+++ b/db/migrate/20140407135544_fix_namespaces.rb
@@ -1,4 +1,4 @@
-class FixNamespaces < ActiveRecord::Migration
+class FixNamespaces < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb b/db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
index fb9c7a6636e8f..148b46f88308b 100644
--- a/db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
+++ b/db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class ChangeStateToAllowEmptyMergeRequestDiffs < ActiveRecord::Migration
+class ChangeStateToAllowEmptyMergeRequestDiffs < ActiveRecord::Migration[4.2]
   def up
     change_column :merge_request_diffs, :state, :string, null: true,
                   default: nil
diff --git a/db/migrate/20140416074002_add_index_on_iid.rb b/db/migrate/20140416074002_add_index_on_iid.rb
index 6cdaa5a3c08e3..c7f707ca123f0 100644
--- a/db/migrate/20140416074002_add_index_on_iid.rb
+++ b/db/migrate/20140416074002_add_index_on_iid.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexOnIid < ActiveRecord::Migration
+class AddIndexOnIid < ActiveRecord::Migration[4.2]
   def change
     RemoveDuplicateIid.clean(Issue)
     RemoveDuplicateIid.clean(MergeRequest, 'target_project_id')
diff --git a/db/migrate/20140416185734_index_on_current_sign_in_at.rb b/db/migrate/20140416185734_index_on_current_sign_in_at.rb
index 8c620b545bd5c..7dabcb937b308 100644
--- a/db/migrate/20140416185734_index_on_current_sign_in_at.rb
+++ b/db/migrate/20140416185734_index_on_current_sign_in_at.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class IndexOnCurrentSignInAt < ActiveRecord::Migration
+class IndexOnCurrentSignInAt < ActiveRecord::Migration[4.2]
   def change
     add_index :users, :current_sign_in_at
   end
diff --git a/db/migrate/20140428105831_add_notes_index_updated_at.rb b/db/migrate/20140428105831_add_notes_index_updated_at.rb
index 0589101af9385..25bdf477e24f4 100644
--- a/db/migrate/20140428105831_add_notes_index_updated_at.rb
+++ b/db/migrate/20140428105831_add_notes_index_updated_at.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddNotesIndexUpdatedAt < ActiveRecord::Migration
+class AddNotesIndexUpdatedAt < ActiveRecord::Migration[4.2]
   def change
     add_index :notes, :updated_at
   end
diff --git a/db/migrate/20140502115131_add_repo_size_to_db.rb b/db/migrate/20140502115131_add_repo_size_to_db.rb
index 090b30a4f2693..4cb7a01bbf2e7 100644
--- a/db/migrate/20140502115131_add_repo_size_to_db.rb
+++ b/db/migrate/20140502115131_add_repo_size_to_db.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddRepoSizeToDb < ActiveRecord::Migration
+class AddRepoSizeToDb < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :repository_size, :float, default: 0
   end
diff --git a/db/migrate/20140502125220_migrate_repo_size.rb b/db/migrate/20140502125220_migrate_repo_size.rb
index ca1b054600c64..a69b02cddc460 100644
--- a/db/migrate/20140502125220_migrate_repo_size.rb
+++ b/db/migrate/20140502125220_migrate_repo_size.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateRepoSize < ActiveRecord::Migration
+class MigrateRepoSize < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20140611135229_add_position_to_merge_request.rb b/db/migrate/20140611135229_add_position_to_merge_request.rb
index 3a7d2f7c359be..6ec644eeccecd 100644
--- a/db/migrate/20140611135229_add_position_to_merge_request.rb
+++ b/db/migrate/20140611135229_add_position_to_merge_request.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPositionToMergeRequest < ActiveRecord::Migration
+class AddPositionToMergeRequest < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_requests, :position, :integer, default: 0
   end
diff --git a/db/migrate/20140625115202_create_users_star_projects.rb b/db/migrate/20140625115202_create_users_star_projects.rb
index d4f3fe5ac6226..2237927fc787f 100644
--- a/db/migrate/20140625115202_create_users_star_projects.rb
+++ b/db/migrate/20140625115202_create_users_star_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateUsersStarProjects < ActiveRecord::Migration
+class CreateUsersStarProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20140729134820_create_labels.rb b/db/migrate/20140729134820_create_labels.rb
index 66d20e741a6e3..1060610b660df 100644
--- a/db/migrate/20140729134820_create_labels.rb
+++ b/db/migrate/20140729134820_create_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateLabels < ActiveRecord::Migration
+class CreateLabels < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20140729140420_create_label_links.rb b/db/migrate/20140729140420_create_label_links.rb
index dacd9f2e4b6a9..b8596a44a2188 100644
--- a/db/migrate/20140729140420_create_label_links.rb
+++ b/db/migrate/20140729140420_create_label_links.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateLabelLinks < ActiveRecord::Migration
+class CreateLabelLinks < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20140729145339_migrate_project_tags.rb b/db/migrate/20140729145339_migrate_project_tags.rb
index 5760e4bfeaa85..711a2d262aa0b 100644
--- a/db/migrate/20140729145339_migrate_project_tags.rb
+++ b/db/migrate/20140729145339_migrate_project_tags.rb
@@ -1,4 +1,4 @@
-class MigrateProjectTags < ActiveRecord::Migration
+class MigrateProjectTags < ActiveRecord::Migration[4.2]
   def up
     ActsAsTaggableOn::Tagging.where(taggable_type: 'Project', context: 'labels').update_all(context: 'tags')
   end
diff --git a/db/migrate/20140729152420_migrate_taggable_labels.rb b/db/migrate/20140729152420_migrate_taggable_labels.rb
index 04cdc6beaddca..a8bf8022dfcc1 100644
--- a/db/migrate/20140729152420_migrate_taggable_labels.rb
+++ b/db/migrate/20140729152420_migrate_taggable_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateTaggableLabels < ActiveRecord::Migration
+class MigrateTaggableLabels < ActiveRecord::Migration[4.2]
   def up
     taggings = ActsAsTaggableOn::Tagging.where(taggable_type: ['Issue', 'MergeRequest'], context: 'labels')
     taggings.find_each(batch_size: 500) do |tagging|
diff --git a/db/migrate/20140730111702_add_index_to_labels.rb b/db/migrate/20140730111702_add_index_to_labels.rb
index cc7ac1fc449cf..21f9dfd5d47bd 100644
--- a/db/migrate/20140730111702_add_index_to_labels.rb
+++ b/db/migrate/20140730111702_add_index_to_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexToLabels < ActiveRecord::Migration
+class AddIndexToLabels < ActiveRecord::Migration[4.2]
   def change
     add_index "labels", :project_id
     add_index "label_links", :label_id
diff --git a/db/migrate/20140903115954_migrate_to_new_shell.rb b/db/migrate/20140903115954_migrate_to_new_shell.rb
index 04acf24284b77..cc0cce483b166 100644
--- a/db/migrate/20140903115954_migrate_to_new_shell.rb
+++ b/db/migrate/20140903115954_migrate_to_new_shell.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateToNewShell < ActiveRecord::Migration
+class MigrateToNewShell < ActiveRecord::Migration[4.2]
   def change
     return if Rails.env.test?
 
diff --git a/db/migrate/20140907220153_serialize_service_properties.rb b/db/migrate/20140907220153_serialize_service_properties.rb
index c2d67fad0abe2..bf94c64654b3e 100644
--- a/db/migrate/20140907220153_serialize_service_properties.rb
+++ b/db/migrate/20140907220153_serialize_service_properties.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class SerializeServiceProperties < ActiveRecord::Migration
+class SerializeServiceProperties < ActiveRecord::Migration[4.2]
   def change
     unless column_exists?(:services, :properties)
       add_column :services, :properties, :text
diff --git a/db/migrate/20140914113604_add_members_table.rb b/db/migrate/20140914113604_add_members_table.rb
index 0f76bb0ef7960..312ea1b94df6c 100644
--- a/db/migrate/20140914113604_add_members_table.rb
+++ b/db/migrate/20140914113604_add_members_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMembersTable < ActiveRecord::Migration
+class AddMembersTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20140914145549_migrate_to_new_members_model.rb b/db/migrate/20140914145549_migrate_to_new_members_model.rb
index b4c98f016d0e2..22d8b3d651b39 100644
--- a/db/migrate/20140914145549_migrate_to_new_members_model.rb
+++ b/db/migrate/20140914145549_migrate_to_new_members_model.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateToNewMembersModel < ActiveRecord::Migration
+class MigrateToNewMembersModel < ActiveRecord::Migration[4.2]
   def up
     execute "INSERT INTO members ( user_id, source_id, source_type, access_level, notification_level, type ) SELECT user_id, group_id, 'Namespace', group_access, notification_level, 'GroupMember' FROM users_groups"
     execute "INSERT INTO members ( user_id, source_id, source_type, access_level, notification_level, type ) SELECT user_id, project_id, 'Project', project_access, notification_level, 'ProjectMember' FROM users_projects"
diff --git a/db/migrate/20140914173417_remove_old_member_tables.rb b/db/migrate/20140914173417_remove_old_member_tables.rb
index d2ab326ef1fb9..edd69caa4705c 100644
--- a/db/migrate/20140914173417_remove_old_member_tables.rb
+++ b/db/migrate/20140914173417_remove_old_member_tables.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveOldMemberTables < ActiveRecord::Migration
+class RemoveOldMemberTables < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20141006143943_move_slack_service_to_webhook.rb b/db/migrate/20141006143943_move_slack_service_to_webhook.rb
index 561184615cc6c..1c9a1a74a4eb9 100644
--- a/db/migrate/20141006143943_move_slack_service_to_webhook.rb
+++ b/db/migrate/20141006143943_move_slack_service_to_webhook.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MoveSlackServiceToWebhook < ActiveRecord::Migration
+class MoveSlackServiceToWebhook < ActiveRecord::Migration[4.2]
 
   DOWNTIME = true
   DOWNTIME_REASON = 'Move old fields "token" and "subdomain" to one single field "webhook"'
diff --git a/db/migrate/20141007100818_add_visibility_level_to_snippet.rb b/db/migrate/20141007100818_add_visibility_level_to_snippet.rb
index 0c14f75c15487..9501aed8931e1 100644
--- a/db/migrate/20141007100818_add_visibility_level_to_snippet.rb
+++ b/db/migrate/20141007100818_add_visibility_level_to_snippet.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddVisibilityLevelToSnippet < ActiveRecord::Migration
+class AddVisibilityLevelToSnippet < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/db/migrate/20141118150935_add_audit_event.rb b/db/migrate/20141118150935_add_audit_event.rb
index 52d70b4a0ac69..1e7dba568c943 100644
--- a/db/migrate/20141118150935_add_audit_event.rb
+++ b/db/migrate/20141118150935_add_audit_event.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddAuditEvent < ActiveRecord::Migration
+class AddAuditEvent < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20141121133009_add_timestamps_to_members.rb b/db/migrate/20141121133009_add_timestamps_to_members.rb
index ef6d4dedf32c9..cb575fc9ed7c9 100644
--- a/db/migrate/20141121133009_add_timestamps_to_members.rb
+++ b/db/migrate/20141121133009_add_timestamps_to_members.rb
@@ -3,7 +3,7 @@
 # became a problem after commit c8e78d972a5a628870eefca0f2ccea0199c55bda which
 # was added in GitLab 7.5. With this migration we ensure that all rows in
 # 'members' have at least some created_at and updated_at timestamp.
-class AddTimestampsToMembers < ActiveRecord::Migration
+class AddTimestampsToMembers < ActiveRecord::Migration[4.2]
   def up
     execute "UPDATE members SET created_at = NOW() WHERE created_at is NULL"
     execute "UPDATE members SET updated_at = NOW() WHERE updated_at is NULL"
diff --git a/db/migrate/20141121161704_add_identity_table.rb b/db/migrate/20141121161704_add_identity_table.rb
index 5a399f0d32522..92f7a568077ef 100644
--- a/db/migrate/20141121161704_add_identity_table.rb
+++ b/db/migrate/20141121161704_add_identity_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIdentityTable < ActiveRecord::Migration
+class AddIdentityTable < ActiveRecord::Migration[4.2]
   def up
     create_table :identities do |t|
       t.string :extern_uid
diff --git a/db/migrate/20141126120926_add_merge_request_rebase_enabled_to_projects.rb b/db/migrate/20141126120926_add_merge_request_rebase_enabled_to_projects.rb
index 3dafdf0fde40e..b9d8a5cb4359d 100644
--- a/db/migrate/20141126120926_add_merge_request_rebase_enabled_to_projects.rb
+++ b/db/migrate/20141126120926_add_merge_request_rebase_enabled_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMergeRequestRebaseEnabledToProjects < ActiveRecord::Migration
+class AddMergeRequestRebaseEnabledToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20141205134006_add_locked_at_to_merge_request.rb b/db/migrate/20141205134006_add_locked_at_to_merge_request.rb
index 5aa91c7587afa..6fdfb3eb974e4 100644
--- a/db/migrate/20141205134006_add_locked_at_to_merge_request.rb
+++ b/db/migrate/20141205134006_add_locked_at_to_merge_request.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddLockedAtToMergeRequest < ActiveRecord::Migration
+class AddLockedAtToMergeRequest < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_requests, :locked_at, :datetime
   end
diff --git a/db/migrate/20141216155758_create_doorkeeper_tables.rb b/db/migrate/20141216155758_create_doorkeeper_tables.rb
index 17e45a77291ff..7bd0a15e7f519 100644
--- a/db/migrate/20141216155758_create_doorkeeper_tables.rb
+++ b/db/migrate/20141216155758_create_doorkeeper_tables.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateDoorkeeperTables < ActiveRecord::Migration
+class CreateDoorkeeperTables < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20141217125223_add_owner_to_application.rb b/db/migrate/20141217125223_add_owner_to_application.rb
index e5a669ab4d8b6..482a53f3ad542 100644
--- a/db/migrate/20141217125223_add_owner_to_application.rb
+++ b/db/migrate/20141217125223_add_owner_to_application.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddOwnerToApplication < ActiveRecord::Migration
+class AddOwnerToApplication < ActiveRecord::Migration[4.2]
   def change
     add_column :oauth_applications, :owner_id, :integer, null: true
     add_column :oauth_applications, :owner_type, :string, null: true
diff --git a/db/migrate/20141223135007_add_import_data_to_project_table.rb b/db/migrate/20141223135007_add_import_data_to_project_table.rb
index 5db78f94cc978..516f58d645e79 100644
--- a/db/migrate/20141223135007_add_import_data_to_project_table.rb
+++ b/db/migrate/20141223135007_add_import_data_to_project_table.rb
@@ -1,4 +1,4 @@
-class AddImportDataToProjectTable < ActiveRecord::Migration
+class AddImportDataToProjectTable < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :import_type, :string
     add_column :projects, :import_source, :string
diff --git a/db/migrate/20141226080412_add_developers_can_push_to_protected_branches.rb b/db/migrate/20141226080412_add_developers_can_push_to_protected_branches.rb
index a18b2f4974dd3..43b7de8522829 100644
--- a/db/migrate/20141226080412_add_developers_can_push_to_protected_branches.rb
+++ b/db/migrate/20141226080412_add_developers_can_push_to_protected_branches.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddDevelopersCanPushToProtectedBranches < ActiveRecord::Migration
+class AddDevelopersCanPushToProtectedBranches < ActiveRecord::Migration[4.2]
   def change
     add_column :protected_branches, :developers_can_push, :boolean, default: false, null: false
   end
diff --git a/db/migrate/20150108073740_create_application_settings.rb b/db/migrate/20150108073740_create_application_settings.rb
index 0e4c66ca8c02a..be139fee63a39 100644
--- a/db/migrate/20150108073740_create_application_settings.rb
+++ b/db/migrate/20150108073740_create_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateApplicationSettings < ActiveRecord::Migration
+class CreateApplicationSettings < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb b/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb
index aa179ce3a4d29..e630e2cc87875 100644
--- a/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb
+++ b/db/migrate/20150116234544_add_home_page_url_for_application_settings.rb
@@ -1,4 +1,4 @@
-class AddHomePageUrlForApplicationSettings < ActiveRecord::Migration
+class AddHomePageUrlForApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :home_page_url, :string
   end
diff --git a/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb b/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb
index c28ba3197ac80..673628e106b9c 100644
--- a/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb
+++ b/db/migrate/20150116234545_add_gitlab_access_token_to_user.rb
@@ -1,4 +1,4 @@
-class AddGitlabAccessTokenToUser < ActiveRecord::Migration
+class AddGitlabAccessTokenToUser < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :gitlab_access_token, :string
   end
diff --git a/db/migrate/20150125163100_add_default_branch_protection_setting.rb b/db/migrate/20150125163100_add_default_branch_protection_setting.rb
index 7ca3116d35440..f6bfa422124fb 100644
--- a/db/migrate/20150125163100_add_default_branch_protection_setting.rb
+++ b/db/migrate/20150125163100_add_default_branch_protection_setting.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddDefaultBranchProtectionSetting < ActiveRecord::Migration
+class AddDefaultBranchProtectionSetting < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :default_branch_protection, :integer, :default => 2
   end
diff --git a/db/migrate/20150205211843_add_timestamps_to_identities.rb b/db/migrate/20150205211843_add_timestamps_to_identities.rb
index a78e28eb4ebce..c535a7ec78136 100644
--- a/db/migrate/20150205211843_add_timestamps_to_identities.rb
+++ b/db/migrate/20150205211843_add_timestamps_to_identities.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddTimestampsToIdentities < ActiveRecord::Migration
+class AddTimestampsToIdentities < ActiveRecord::Migration[4.2]
   def change
     add_timestamps(:identities)
   end
diff --git a/db/migrate/20150206181414_add_index_to_created_at.rb b/db/migrate/20150206181414_add_index_to_created_at.rb
index a161fad79dca6..501acd6a7205a 100644
--- a/db/migrate/20150206181414_add_index_to_created_at.rb
+++ b/db/migrate/20150206181414_add_index_to_created_at.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexToCreatedAt < ActiveRecord::Migration
+class AddIndexToCreatedAt < ActiveRecord::Migration[4.2]
   def change
     add_index "users", [:created_at, :id]
     add_index "members", [:created_at, :id]
diff --git a/db/migrate/20150206222854_add_notification_email_to_user.rb b/db/migrate/20150206222854_add_notification_email_to_user.rb
index ab80f7e582f30..7b0c251db4f26 100644
--- a/db/migrate/20150206222854_add_notification_email_to_user.rb
+++ b/db/migrate/20150206222854_add_notification_email_to_user.rb
@@ -1,4 +1,4 @@
-class AddNotificationEmailToUser < ActiveRecord::Migration
+class AddNotificationEmailToUser < ActiveRecord::Migration[4.2]
   def up
     add_column :users, :notification_email, :string
 
diff --git a/db/migrate/20150209222013_add_missing_index.rb b/db/migrate/20150209222013_add_missing_index.rb
index 18e3ac2cbbb76..99544ab3928a7 100644
--- a/db/migrate/20150209222013_add_missing_index.rb
+++ b/db/migrate/20150209222013_add_missing_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMissingIndex < ActiveRecord::Migration
+class AddMissingIndex < ActiveRecord::Migration[4.2]
   def change
     add_index "services", [:created_at, :id]
   end
diff --git a/db/migrate/20150211172122_add_template_to_service.rb b/db/migrate/20150211172122_add_template_to_service.rb
index a3e96b25c567d..dd192a0fe7635 100644
--- a/db/migrate/20150211172122_add_template_to_service.rb
+++ b/db/migrate/20150211172122_add_template_to_service.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddTemplateToService < ActiveRecord::Migration
+class AddTemplateToService < ActiveRecord::Migration[4.2]
   def change
     add_column :services, :template, :boolean, default: false
   end
diff --git a/db/migrate/20150211174341_allow_null_in_services_project_id.rb b/db/migrate/20150211174341_allow_null_in_services_project_id.rb
index 68f0281279159..4c90bf9c41973 100644
--- a/db/migrate/20150211174341_allow_null_in_services_project_id.rb
+++ b/db/migrate/20150211174341_allow_null_in_services_project_id.rb
@@ -1,4 +1,4 @@
-class AllowNullInServicesProjectId < ActiveRecord::Migration
+class AllowNullInServicesProjectId < ActiveRecord::Migration[4.2]
   def change
     change_column :services, :project_id, :integer, null: true
   end
diff --git a/db/migrate/20150213104043_add_twitter_sharing_enabled_to_application_settings.rb b/db/migrate/20150213104043_add_twitter_sharing_enabled_to_application_settings.rb
index 334020376e40c..7d7b9242cd6e2 100644
--- a/db/migrate/20150213104043_add_twitter_sharing_enabled_to_application_settings.rb
+++ b/db/migrate/20150213104043_add_twitter_sharing_enabled_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddTwitterSharingEnabledToApplicationSettings < ActiveRecord::Migration
+class AddTwitterSharingEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :twitter_sharing_enabled, :boolean, default: true
   end
diff --git a/db/migrate/20150213114800_add_hide_no_password_to_user.rb b/db/migrate/20150213114800_add_hide_no_password_to_user.rb
index a2af3510b9c1c..348c0d22aba49 100644
--- a/db/migrate/20150213114800_add_hide_no_password_to_user.rb
+++ b/db/migrate/20150213114800_add_hide_no_password_to_user.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddHideNoPasswordToUser < ActiveRecord::Migration
+class AddHideNoPasswordToUser < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :hide_no_password, :boolean, default: false
   end
diff --git a/db/migrate/20150213121042_add_password_automatically_set_to_user.rb b/db/migrate/20150213121042_add_password_automatically_set_to_user.rb
index 4e84a13f0d2ac..d0eb753b887be 100644
--- a/db/migrate/20150213121042_add_password_automatically_set_to_user.rb
+++ b/db/migrate/20150213121042_add_password_automatically_set_to_user.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPasswordAutomaticallySetToUser < ActiveRecord::Migration
+class AddPasswordAutomaticallySetToUser < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :password_automatically_set, :boolean, default: false
   end
diff --git a/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb b/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
index 23ac1b399ec40..639644174ca44 100644
--- a/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
+++ b/db/migrate/20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
@@ -1,4 +1,4 @@
-class AddBitbucketAccessTokenAndSecretToUser < ActiveRecord::Migration
+class AddBitbucketAccessTokenAndSecretToUser < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :bitbucket_access_token, :string
     add_column :users, :bitbucket_access_token_secret, :string
diff --git a/db/migrate/20150219004514_add_events_to_services.rb b/db/migrate/20150219004514_add_events_to_services.rb
index 560382c3fa1e0..7072056adcb3d 100644
--- a/db/migrate/20150219004514_add_events_to_services.rb
+++ b/db/migrate/20150219004514_add_events_to_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddEventsToServices < ActiveRecord::Migration
+class AddEventsToServices < ActiveRecord::Migration[4.2]
   def change
     add_column :services, :push_events, :boolean, :default => true
     add_column :services, :issues_events, :boolean, :default => true
diff --git a/db/migrate/20150223022001_set_missing_last_activity_at.rb b/db/migrate/20150223022001_set_missing_last_activity_at.rb
index 3f6d4d83474f6..c77ffbd4ebdd9 100644
--- a/db/migrate/20150223022001_set_missing_last_activity_at.rb
+++ b/db/migrate/20150223022001_set_missing_last_activity_at.rb
@@ -1,4 +1,4 @@
-class SetMissingLastActivityAt < ActiveRecord::Migration
+class SetMissingLastActivityAt < ActiveRecord::Migration[4.2]
   def up
     execute "UPDATE projects SET last_activity_at = updated_at WHERE last_activity_at IS NULL"
   end
diff --git a/db/migrate/20150225065047_add_note_events_to_services.rb b/db/migrate/20150225065047_add_note_events_to_services.rb
index 7843cabc43b47..32c538e8681d0 100644
--- a/db/migrate/20150225065047_add_note_events_to_services.rb
+++ b/db/migrate/20150225065047_add_note_events_to_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddNoteEventsToServices < ActiveRecord::Migration
+class AddNoteEventsToServices < ActiveRecord::Migration[4.2]
   def change
     add_column :services, :note_events, :boolean, default: true, null: false
   end
diff --git a/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb b/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb
index 494c3033bfff7..3091790f199dc 100644
--- a/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb
+++ b/db/migrate/20150301014758_add_restricted_visibility_levels_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRestrictedVisibilityLevelsToApplicationSettings < ActiveRecord::Migration
+class AddRestrictedVisibilityLevelsToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :restricted_visibility_levels, :text
   end
diff --git a/db/migrate/20150306023106_fix_namespace_duplication.rb b/db/migrate/20150306023106_fix_namespace_duplication.rb
index ea53a9d71f23e..49be152a75c11 100644
--- a/db/migrate/20150306023106_fix_namespace_duplication.rb
+++ b/db/migrate/20150306023106_fix_namespace_duplication.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class FixNamespaceDuplication < ActiveRecord::Migration
+class FixNamespaceDuplication < ActiveRecord::Migration[4.2]
   def up
     #fixes path duplication
     select_all('SELECT MAX(id) max, COUNT(id) cnt, path FROM namespaces GROUP BY path HAVING COUNT(id) > 1').each do |nms|
diff --git a/db/migrate/20150306023112_add_unique_index_to_namespace.rb b/db/migrate/20150306023112_add_unique_index_to_namespace.rb
index f293a9b643fbe..11472324cbf3e 100644
--- a/db/migrate/20150306023112_add_unique_index_to_namespace.rb
+++ b/db/migrate/20150306023112_add_unique_index_to_namespace.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddUniqueIndexToNamespace < ActiveRecord::Migration
+class AddUniqueIndexToNamespace < ActiveRecord::Migration[4.2]
   def change
     remove_index :namespaces, column: :name if index_exists?(:namespaces, :name)
     remove_index :namespaces, column: :path if index_exists?(:namespaces, :path)
diff --git a/db/migrate/20150310194358_add_version_check_to_application_settings.rb b/db/migrate/20150310194358_add_version_check_to_application_settings.rb
index 5d3dae6e7d80b..cc1b19f302ed6 100644
--- a/db/migrate/20150310194358_add_version_check_to_application_settings.rb
+++ b/db/migrate/20150310194358_add_version_check_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddVersionCheckToApplicationSettings < ActiveRecord::Migration
+class AddVersionCheckToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :version_check_enabled, :boolean, default: true
   end
diff --git a/db/migrate/20150313012111_create_subscriptions_table.rb b/db/migrate/20150313012111_create_subscriptions_table.rb
index a9a8435330df2..37011504b49d0 100644
--- a/db/migrate/20150313012111_create_subscriptions_table.rb
+++ b/db/migrate/20150313012111_create_subscriptions_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateSubscriptionsTable < ActiveRecord::Migration
+class CreateSubscriptionsTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20150320234437_add_location_to_user.rb b/db/migrate/20150320234437_add_location_to_user.rb
index 32731d37d7558..cf273ff916ea0 100644
--- a/db/migrate/20150320234437_add_location_to_user.rb
+++ b/db/migrate/20150320234437_add_location_to_user.rb
@@ -1,4 +1,4 @@
-class AddLocationToUser < ActiveRecord::Migration
+class AddLocationToUser < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :location, :string
   end
diff --git a/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb b/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
index 42dc8173e46ee..a895d5f24f5e3 100644
--- a/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
+++ b/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
@@ -1,4 +1,4 @@
-class SetIncorrectAssigneeIdToNull < ActiveRecord::Migration
+class SetIncorrectAssigneeIdToNull < ActiveRecord::Migration[4.2]
   def up
     execute "UPDATE issues SET assignee_id = NULL WHERE assignee_id = -1"
     execute "UPDATE merge_requests SET assignee_id = NULL WHERE assignee_id = -1"
diff --git a/db/migrate/20150327122227_add_public_to_key.rb b/db/migrate/20150327122227_add_public_to_key.rb
index 33c20d65e0343..58d8c16476f70 100644
--- a/db/migrate/20150327122227_add_public_to_key.rb
+++ b/db/migrate/20150327122227_add_public_to_key.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPublicToKey < ActiveRecord::Migration
+class AddPublicToKey < ActiveRecord::Migration[4.2]
   def change
     add_column :keys, :public, :boolean, default: false, null: false
   end
diff --git a/db/migrate/20150327150017_add_import_data_to_project.rb b/db/migrate/20150327150017_add_import_data_to_project.rb
index 12c00339eec41..5d393364ee666 100644
--- a/db/migrate/20150327150017_add_import_data_to_project.rb
+++ b/db/migrate/20150327150017_add_import_data_to_project.rb
@@ -1,4 +1,4 @@
-class AddImportDataToProject < ActiveRecord::Migration
+class AddImportDataToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :import_data, :text
   end
diff --git a/db/migrate/20150327223628_add_devise_two_factor_to_users.rb b/db/migrate/20150327223628_add_devise_two_factor_to_users.rb
index 11b026ee8f347..22202796547c0 100644
--- a/db/migrate/20150327223628_add_devise_two_factor_to_users.rb
+++ b/db/migrate/20150327223628_add_devise_two_factor_to_users.rb
@@ -1,4 +1,4 @@
-class AddDeviseTwoFactorToUsers < ActiveRecord::Migration
+class AddDeviseTwoFactorToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :encrypted_otp_secret, :string
     add_column :users, :encrypted_otp_secret_iv, :string
diff --git a/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb b/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb
index 1d161674a9a90..4ce60a257cb52 100644
--- a/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb
+++ b/db/migrate/20150328132231_add_max_attachment_size_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddMaxAttachmentSizeToApplicationSettings < ActiveRecord::Migration
+class AddMaxAttachmentSizeToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :max_attachment_size, :integer, default: 10, null: false
   end
diff --git a/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb b/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb
index 913958db7c589..792b98c91f062 100644
--- a/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb
+++ b/db/migrate/20150331183602_add_devise_two_factor_backupable_to_users.rb
@@ -1,4 +1,4 @@
-class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration
+class AddDeviseTwoFactorBackupableToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :otp_backup_codes, :text
   end
diff --git a/db/migrate/20150406133311_add_invite_data_to_member.rb b/db/migrate/20150406133311_add_invite_data_to_member.rb
index 63d0f184f32dd..eee991185aba8 100644
--- a/db/migrate/20150406133311_add_invite_data_to_member.rb
+++ b/db/migrate/20150406133311_add_invite_data_to_member.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddInviteDataToMember < ActiveRecord::Migration
+class AddInviteDataToMember < ActiveRecord::Migration[4.2]
   def up
     add_column :members, :created_by_id, :integer
     add_column :members, :invite_email, :string
diff --git a/db/migrate/20150411000035_fix_identities.rb b/db/migrate/20150411000035_fix_identities.rb
index d9051f9fffdc0..a449fc51eccff 100644
--- a/db/migrate/20150411000035_fix_identities.rb
+++ b/db/migrate/20150411000035_fix_identities.rb
@@ -1,4 +1,4 @@
-class FixIdentities < ActiveRecord::Migration
+class FixIdentities < ActiveRecord::Migration[4.2]
   def up
     # Up until now, legacy 'ldap' references in the database were charitably
     # interpreted to point to the first LDAP server specified in the GitLab
diff --git a/db/migrate/20150411180045_rename_buildbox_service.rb b/db/migrate/20150411180045_rename_buildbox_service.rb
index 5a0b5d07e50f9..ac4ccdfb723c0 100644
--- a/db/migrate/20150411180045_rename_buildbox_service.rb
+++ b/db/migrate/20150411180045_rename_buildbox_service.rb
@@ -1,4 +1,4 @@
-class RenameBuildboxService < ActiveRecord::Migration
+class RenameBuildboxService < ActiveRecord::Migration[4.2]
   def up
     execute "UPDATE services SET type = 'BuildkiteService' WHERE type = 'BuildboxService';"
   end
diff --git a/db/migrate/20150413192223_add_public_email_to_users.rb b/db/migrate/20150413192223_add_public_email_to_users.rb
index 0fed5eaf4616a..991f0c668c333 100644
--- a/db/migrate/20150413192223_add_public_email_to_users.rb
+++ b/db/migrate/20150413192223_add_public_email_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPublicEmailToUsers < ActiveRecord::Migration
+class AddPublicEmailToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :public_email, :string, default: "", null: false
   end
diff --git a/db/migrate/20150417121913_create_project_import_data.rb b/db/migrate/20150417121913_create_project_import_data.rb
index c78f5fde85e05..383f64fd2c6a4 100644
--- a/db/migrate/20150417121913_create_project_import_data.rb
+++ b/db/migrate/20150417121913_create_project_import_data.rb
@@ -1,4 +1,4 @@
-class CreateProjectImportData < ActiveRecord::Migration
+class CreateProjectImportData < ActiveRecord::Migration[4.2]
   def change
     create_table :project_import_data do |t|
       t.references :project
diff --git a/db/migrate/20150417122318_remove_import_data_from_project.rb b/db/migrate/20150417122318_remove_import_data_from_project.rb
index 5a008218fa5f3..c9a225a9d17b8 100644
--- a/db/migrate/20150417122318_remove_import_data_from_project.rb
+++ b/db/migrate/20150417122318_remove_import_data_from_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveImportDataFromProject < ActiveRecord::Migration
+class RemoveImportDataFromProject < ActiveRecord::Migration[4.2]
   def up
     remove_column :projects, :import_data
   end
diff --git a/db/migrate/20150421120000_remove_periods_at_ends_of_usernames.rb b/db/migrate/20150421120000_remove_periods_at_ends_of_usernames.rb
index 3445e9ce59e20..d2e7656c9d491 100644
--- a/db/migrate/20150421120000_remove_periods_at_ends_of_usernames.rb
+++ b/db/migrate/20150421120000_remove_periods_at_ends_of_usernames.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemovePeriodsAtEndsOfUsernames < ActiveRecord::Migration
+class RemovePeriodsAtEndsOfUsernames < ActiveRecord::Migration[4.2]
   include Gitlab::ShellAdapter
 
   class Namespace < ActiveRecord::Base
diff --git a/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb b/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb
index 50a9b2439e093..e0f35da422a2b 100644
--- a/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb
+++ b/db/migrate/20150423033240_add_default_project_visibililty_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration
+class AddDefaultProjectVisibililtyToApplicationSettings < ActiveRecord::Migration[4.2]
   def up
     add_column :application_settings, :default_project_visibility, :integer
     visibility = Settings.gitlab.default_projects_features['visibility_level']
diff --git a/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
index 281c88d2a7d40..5b2e692eb17b9 100644
--- a/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
@@ -1,7 +1,7 @@
 # This migration is a duplicate of 20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
 # It shold be applied before the index additions to ensure that `name` is case sensitive.
 
-class GitlabChangeCollationForTagNames < ActiveRecord::Migration
+class GitlabChangeCollationForTagNames < ActiveRecord::Migration[4.2]
   def up
     if ActsAsTaggableOn::Utils.using_mysql?
       execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
diff --git a/db/migrate/20150425164647_remove_duplicate_tags.rb b/db/migrate/20150425164647_remove_duplicate_tags.rb
index e77623bf5078f..5165eb65695f1 100644
--- a/db/migrate/20150425164647_remove_duplicate_tags.rb
+++ b/db/migrate/20150425164647_remove_duplicate_tags.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveDuplicateTags < ActiveRecord::Migration
+class RemoveDuplicateTags < ActiveRecord::Migration[4.2]
   def up
     select_all("SELECT name, COUNT(id) as cnt FROM tags GROUP BY name HAVING COUNT(id) > 1").each do |tag|
       tag_name = quote_string(tag["name"])
diff --git a/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb
index cbff98cdbc449..d1951f640bb1b 100644
--- a/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb
@@ -1,6 +1,6 @@
 # rubocop:disable all
 # This migration comes from acts_as_taggable_on_engine (originally 2)
-class AddMissingUniqueIndices < ActiveRecord::Migration
+class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]
   def self.up
     add_index :tags, :name, unique: true
 
diff --git a/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
index 1568d2dd4ceae..b9af394f09b8e 100644
--- a/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
@@ -1,6 +1,6 @@
 # rubocop:disable all
 # This migration comes from acts_as_taggable_on_engine (originally 3)
-class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
+class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]
   def self.up
     add_column :tags, :taggings_count, :integer, default: 0
 
diff --git a/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
index 71f2d7f43309d..f28737615d779 100644
--- a/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
@@ -1,5 +1,5 @@
 # This migration comes from acts_as_taggable_on_engine (originally 4)
-class AddMissingTaggableIndex < ActiveRecord::Migration
+class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]
   def self.up
     add_index :taggings, [:taggable_id, :taggable_type, :context]
   end
diff --git a/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
index bfb06bc7cda48..4c144a8693f9a 100644
--- a/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
@@ -1,7 +1,7 @@
 # This migration comes from acts_as_taggable_on_engine (originally 5)
 # This migration is added to circumvent issue #623 and have special characters
 # work properly
-class ChangeCollationForTagNames < ActiveRecord::Migration
+class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]
   def up
     if ActsAsTaggableOn::Utils.using_mysql?
       execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
diff --git a/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb b/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
index 8f1b0cc8935aa..a3a86d2676758 100644
--- a/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
+++ b/db/migrate/20150425173433_add_default_snippet_visibility_to_app_settings.rb
@@ -1,4 +1,4 @@
-class AddDefaultSnippetVisibilityToAppSettings < ActiveRecord::Migration
+class AddDefaultSnippetVisibilityToAppSettings < ActiveRecord::Migration[4.2]
   def up
     add_column :application_settings, :default_snippet_visibility, :integer
     visibility = Settings.gitlab.default_projects_features['visibility_level']
diff --git a/db/migrate/20150429002313_remove_abandoned_group_members_records.rb b/db/migrate/20150429002313_remove_abandoned_group_members_records.rb
index 244637e1c4a12..370b807dd50e8 100644
--- a/db/migrate/20150429002313_remove_abandoned_group_members_records.rb
+++ b/db/migrate/20150429002313_remove_abandoned_group_members_records.rb
@@ -1,4 +1,4 @@
-class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration
+class RemoveAbandonedGroupMembersRecords < ActiveRecord::Migration[4.2]
   def up
     execute("DELETE FROM members WHERE type = 'GroupMember' AND source_id NOT IN(\
         SELECT id FROM namespaces WHERE type='Group')")
diff --git a/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb b/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb
index 184e26536109e..df777263ecbfc 100644
--- a/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb
+++ b/db/migrate/20150502064022_add_restricted_signup_domains_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRestrictedSignupDomainsToApplicationSettings < ActiveRecord::Migration
+class AddRestrictedSignupDomainsToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :restricted_signup_domains, :text
   end
diff --git a/db/migrate/20150509180749_convert_legacy_reference_notes.rb b/db/migrate/20150509180749_convert_legacy_reference_notes.rb
index b02605489be33..a44a908c2f50c 100644
--- a/db/migrate/20150509180749_convert_legacy_reference_notes.rb
+++ b/db/migrate/20150509180749_convert_legacy_reference_notes.rb
@@ -5,7 +5,7 @@
 # becomes
 #
 #   mentioned in 54f7727c850972f0401c1312a7c4a6a380de5666
-class ConvertLegacyReferenceNotes < ActiveRecord::Migration
+class ConvertLegacyReferenceNotes < ActiveRecord::Migration[4.2]
   def up
     execute %q{UPDATE notes SET note = trim(both '_' from note) WHERE system = true AND note LIKE '\_%\_'}
   end
diff --git a/db/migrate/20150516060434_add_note_events_to_web_hooks.rb b/db/migrate/20150516060434_add_note_events_to_web_hooks.rb
index bf72e5e2e3adc..ddf26240b8b2f 100644
--- a/db/migrate/20150516060434_add_note_events_to_web_hooks.rb
+++ b/db/migrate/20150516060434_add_note_events_to_web_hooks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddNoteEventsToWebHooks < ActiveRecord::Migration
+class AddNoteEventsToWebHooks < ActiveRecord::Migration[4.2]
   def up
     add_column :web_hooks, :note_events, :boolean, default: false, null: false
   end
diff --git a/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb b/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb
index 6a78294f0b298..507e905acd699 100644
--- a/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb
+++ b/db/migrate/20150529111607_add_user_oauth_applications_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddUserOauthApplicationsToApplicationSettings < ActiveRecord::Migration
+class AddUserOauthApplicationsToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :user_oauth_applications, :bool, default: true
   end
diff --git a/db/migrate/20150529150354_add_after_sign_out_path_for_application_settings.rb b/db/migrate/20150529150354_add_after_sign_out_path_for_application_settings.rb
index 833c36de52d5e..f43f20def5b69 100644
--- a/db/migrate/20150529150354_add_after_sign_out_path_for_application_settings.rb
+++ b/db/migrate/20150529150354_add_after_sign_out_path_for_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddAfterSignOutPathForApplicationSettings < ActiveRecord::Migration
+class AddAfterSignOutPathForApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :after_sign_out_path, :string
   end
diff --git a/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb b/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb
index 61ff0af41f4c9..93959a9010f56 100644
--- a/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb
+++ b/db/migrate/20150609141121_add_session_expire_delay_for_application_settings.rb
@@ -1,4 +1,4 @@
-class AddSessionExpireDelayForApplicationSettings < ActiveRecord::Migration
+class AddSessionExpireDelayForApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     unless column_exists?(:application_settings, :session_expire_delay)
       add_column :application_settings, :session_expire_delay, :integer, default: 10080, null: false
diff --git a/db/migrate/20150610065936_add_dashboard_to_users.rb b/db/migrate/20150610065936_add_dashboard_to_users.rb
index df38472f89332..a0bf5f31f0009 100644
--- a/db/migrate/20150610065936_add_dashboard_to_users.rb
+++ b/db/migrate/20150610065936_add_dashboard_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddDashboardToUsers < ActiveRecord::Migration
+class AddDashboardToUsers < ActiveRecord::Migration[4.2]
   def up
     add_column :users, :dashboard, :integer, default: 0
   end
diff --git a/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb b/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb
index 8eed8678b2f0a..4a085ff06f30a 100644
--- a/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb
+++ b/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb
@@ -1,4 +1,4 @@
-class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration
+class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration[4.2]
   def up
     execute %q{UPDATE users SET otp_required_for_login = FALSE WHERE otp_required_for_login IS NULL}
 
diff --git a/db/migrate/20150713160110_add_project_view_to_users.rb b/db/migrate/20150713160110_add_project_view_to_users.rb
index 0de5a93035c36..fea63576187e5 100644
--- a/db/migrate/20150713160110_add_project_view_to_users.rb
+++ b/db/migrate/20150713160110_add_project_view_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddProjectViewToUsers < ActiveRecord::Migration
+class AddProjectViewToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :project_view, :integer, default: 0
   end
diff --git a/db/migrate/20150717130904_add_commits_count_to_project.rb b/db/migrate/20150717130904_add_commits_count_to_project.rb
index 5799e068c693c..df6c88f29613e 100644
--- a/db/migrate/20150717130904_add_commits_count_to_project.rb
+++ b/db/migrate/20150717130904_add_commits_count_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCommitsCountToProject < ActiveRecord::Migration
+class AddCommitsCountToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :commit_count, :integer, default: 0
   end
diff --git a/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb b/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb
index 78d45c7f96b8d..fab126c3d0462 100644
--- a/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb
+++ b/db/migrate/20150730122406_add_updated_by_to_issuables_and_notes.rb
@@ -1,4 +1,4 @@
-class AddUpdatedByToIssuablesAndNotes < ActiveRecord::Migration
+class AddUpdatedByToIssuablesAndNotes < ActiveRecord::Migration[4.2]
   def change
     add_column :notes, :updated_by_id, :integer
     add_column :issues, :updated_by_id, :integer
diff --git a/db/migrate/20150806104937_create_abuse_reports.rb b/db/migrate/20150806104937_create_abuse_reports.rb
index 52aed9e1d1d79..be4fe8d1cfdcc 100644
--- a/db/migrate/20150806104937_create_abuse_reports.rb
+++ b/db/migrate/20150806104937_create_abuse_reports.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateAbuseReports < ActiveRecord::Migration
+class CreateAbuseReports < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20150812080800_add_settings_import_sources.rb b/db/migrate/20150812080800_add_settings_import_sources.rb
index 07f417fa3e310..59db31c868abb 100644
--- a/db/migrate/20150812080800_add_settings_import_sources.rb
+++ b/db/migrate/20150812080800_add_settings_import_sources.rb
@@ -1,7 +1,7 @@
 # rubocop:disable all
 require 'yaml'
 
-class AddSettingsImportSources < ActiveRecord::Migration
+class AddSettingsImportSources < ActiveRecord::Migration[4.2]
   def change
     unless column_exists?(:application_settings, :import_sources)
       add_column :application_settings, :import_sources, :text
diff --git a/db/migrate/20150814065925_remove_oauth_tokens_from_users.rb b/db/migrate/20150814065925_remove_oauth_tokens_from_users.rb
index 7eaa7eda31130..f0080ee0b464d 100644
--- a/db/migrate/20150814065925_remove_oauth_tokens_from_users.rb
+++ b/db/migrate/20150814065925_remove_oauth_tokens_from_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveOauthTokensFromUsers < ActiveRecord::Migration
+class RemoveOauthTokensFromUsers < ActiveRecord::Migration[4.2]
   def change
     remove_column :users, :github_access_token, :string
     remove_column :users, :gitlab_access_token, :string
diff --git a/db/migrate/20150817163600_deduplicate_user_identities.rb b/db/migrate/20150817163600_deduplicate_user_identities.rb
index b0cfad7d20f29..973a87e07eafd 100644
--- a/db/migrate/20150817163600_deduplicate_user_identities.rb
+++ b/db/migrate/20150817163600_deduplicate_user_identities.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class DeduplicateUserIdentities < ActiveRecord::Migration
+class DeduplicateUserIdentities < ActiveRecord::Migration[4.2]
   def change
     execute 'DROP TABLE IF EXISTS tt_migration_DeduplicateUserIdentities;'
     execute 'CREATE TABLE tt_migration_DeduplicateUserIdentities AS SELECT id,provider,user_id FROM identities;'
diff --git a/db/migrate/20150818213832_add_sent_notifications.rb b/db/migrate/20150818213832_add_sent_notifications.rb
index 43e8d6a1a82e2..45e95a843e1c9 100644
--- a/db/migrate/20150818213832_add_sent_notifications.rb
+++ b/db/migrate/20150818213832_add_sent_notifications.rb
@@ -1,4 +1,4 @@
-class AddSentNotifications < ActiveRecord::Migration
+class AddSentNotifications < ActiveRecord::Migration[4.2]
   def change
     create_table :sent_notifications do |t|
       t.references :project
diff --git a/db/migrate/20150824002011_add_enable_ssl_verification.rb b/db/migrate/20150824002011_add_enable_ssl_verification.rb
index 6e992f0883429..2d877914f3967 100644
--- a/db/migrate/20150824002011_add_enable_ssl_verification.rb
+++ b/db/migrate/20150824002011_add_enable_ssl_verification.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddEnableSslVerification < ActiveRecord::Migration
+class AddEnableSslVerification < ActiveRecord::Migration[4.2]
   def change
     add_column :web_hooks, :enable_ssl_verification, :boolean, default: false
   end
diff --git a/db/migrate/20150826001931_add_ci_tables.rb b/db/migrate/20150826001931_add_ci_tables.rb
index d1f8506d1fe18..aa2af44a15b98 100644
--- a/db/migrate/20150826001931_add_ci_tables.rb
+++ b/db/migrate/20150826001931_add_ci_tables.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiTables < ActiveRecord::Migration
+class AddCiTables < ActiveRecord::Migration[4.2]
   def change
     create_table "ci_application_settings", force: true do |t|
       t.boolean  "all_broken_builds"
diff --git a/db/migrate/20150827121444_add_fast_forward_option_to_project.rb b/db/migrate/20150827121444_add_fast_forward_option_to_project.rb
index 35df121519e22..bf7db2fb12b67 100644
--- a/db/migrate/20150827121444_add_fast_forward_option_to_project.rb
+++ b/db/migrate/20150827121444_add_fast_forward_option_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddFastForwardOptionToProject < ActiveRecord::Migration
+class AddFastForwardOptionToProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20150902001023_add_template_to_label.rb b/db/migrate/20150902001023_add_template_to_label.rb
index 0f6ae8d6cc3ea..10769f29baae3 100644
--- a/db/migrate/20150902001023_add_template_to_label.rb
+++ b/db/migrate/20150902001023_add_template_to_label.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddTemplateToLabel < ActiveRecord::Migration
+class AddTemplateToLabel < ActiveRecord::Migration[4.2]
   def change
     add_column :labels, :template, :boolean, default: false
   end
diff --git a/db/migrate/20150914215247_add_ci_tags.rb b/db/migrate/20150914215247_add_ci_tags.rb
index b647bc9c8a2f8..9afa45405401c 100644
--- a/db/migrate/20150914215247_add_ci_tags.rb
+++ b/db/migrate/20150914215247_add_ci_tags.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiTags < ActiveRecord::Migration
+class AddCiTags < ActiveRecord::Migration[4.2]
   def change
     create_table "ci_taggings", force: true do |t|
       t.integer  "tag_id"
diff --git a/db/migrate/20150915001905_enable_ssl_verification_by_default.rb b/db/migrate/20150915001905_enable_ssl_verification_by_default.rb
index 6e924262a13ea..ddd071797533f 100644
--- a/db/migrate/20150915001905_enable_ssl_verification_by_default.rb
+++ b/db/migrate/20150915001905_enable_ssl_verification_by_default.rb
@@ -1,4 +1,4 @@
-class EnableSslVerificationByDefault < ActiveRecord::Migration
+class EnableSslVerificationByDefault < ActiveRecord::Migration[4.2]
   def change
     change_column :web_hooks, :enable_ssl_verification, :boolean, default: true
   end
diff --git a/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb b/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb
index 90ce6c2db3da1..49081c9d7495a 100644
--- a/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb
+++ b/db/migrate/20150916000405_enable_ssl_verification_for_web_hooks.rb
@@ -1,4 +1,4 @@
-class EnableSslVerificationForWebHooks < ActiveRecord::Migration
+class EnableSslVerificationForWebHooks < ActiveRecord::Migration[4.2]
   def up
     execute("UPDATE web_hooks SET enable_ssl_verification = true")
   end
diff --git a/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
index 37a27f11935c3..52867632880bd 100644
--- a/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
+++ b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration
+class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :help_page_text, :text
   end
diff --git a/db/migrate/20150916145038_add_index_for_committed_at_and_id.rb b/db/migrate/20150916145038_add_index_for_committed_at_and_id.rb
index a18ed93cf37b0..bf78aacd9f4c8 100644
--- a/db/migrate/20150916145038_add_index_for_committed_at_and_id.rb
+++ b/db/migrate/20150916145038_add_index_for_committed_at_and_id.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexForCommittedAtAndId < ActiveRecord::Migration
+class AddIndexForCommittedAtAndId < ActiveRecord::Migration[4.2]
   def change
     add_index :ci_commits, [:project_id, :committed_at, :id]
   end
diff --git a/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb b/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb
index 6cf668a170e76..153c1a798c33f 100644
--- a/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb
+++ b/db/migrate/20150918084513_add_ci_enabled_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddCiEnabledToApplicationSettings < ActiveRecord::Migration
+class AddCiEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :ci_enabled, :boolean, null: false, default: true
   end
diff --git a/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb b/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb
index 0aad6fe5e6e3a..52651e1632404 100644
--- a/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb
+++ b/db/migrate/20150918161719_remove_invalid_milestones_from_merge_requests.rb
@@ -1,4 +1,4 @@
-class RemoveInvalidMilestonesFromMergeRequests < ActiveRecord::Migration
+class RemoveInvalidMilestonesFromMergeRequests < ActiveRecord::Migration[4.2]
   def up
     execute("UPDATE merge_requests SET milestone_id = NULL where milestone_id NOT IN (SELECT id FROM milestones)")
   end
diff --git a/db/migrate/20150920010715_add_consumed_timestep_to_users.rb b/db/migrate/20150920010715_add_consumed_timestep_to_users.rb
index c8438b3f6aabd..c69944b1e9492 100644
--- a/db/migrate/20150920010715_add_consumed_timestep_to_users.rb
+++ b/db/migrate/20150920010715_add_consumed_timestep_to_users.rb
@@ -1,4 +1,4 @@
-class AddConsumedTimestepToUsers < ActiveRecord::Migration
+class AddConsumedTimestepToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :consumed_timestep, :integer
   end
diff --git a/db/migrate/20150920161119_add_line_code_to_sent_notification.rb b/db/migrate/20150920161119_add_line_code_to_sent_notification.rb
index d9af4e71751f8..671476f0b07f6 100644
--- a/db/migrate/20150920161119_add_line_code_to_sent_notification.rb
+++ b/db/migrate/20150920161119_add_line_code_to_sent_notification.rb
@@ -1,4 +1,4 @@
-class AddLineCodeToSentNotification < ActiveRecord::Migration
+class AddLineCodeToSentNotification < ActiveRecord::Migration[4.2]
   def change
     add_column :sent_notifications, :line_code, :string
   end
diff --git a/db/migrate/20150924125150_add_project_id_to_ci_commit.rb b/db/migrate/20150924125150_add_project_id_to_ci_commit.rb
index 1a761fe0f863f..c9f16b0f3f9c9 100644
--- a/db/migrate/20150924125150_add_project_id_to_ci_commit.rb
+++ b/db/migrate/20150924125150_add_project_id_to_ci_commit.rb
@@ -1,4 +1,4 @@
-class AddProjectIdToCiCommit < ActiveRecord::Migration
+class AddProjectIdToCiCommit < ActiveRecord::Migration[4.2]
   def up
     add_column :ci_commits, :gl_project_id, :integer
   end
diff --git a/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb b/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb
index 2be57b6062eba..ff31e70874ff7 100644
--- a/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb
+++ b/db/migrate/20150924125436_migrate_project_id_for_ci_commits.rb
@@ -1,4 +1,4 @@
-class MigrateProjectIdForCiCommits < ActiveRecord::Migration
+class MigrateProjectIdForCiCommits < ActiveRecord::Migration[4.2]
   def up
     subquery = 'SELECT gitlab_id FROM ci_projects WHERE ci_projects.id = ci_commits.project_id'
     execute("UPDATE ci_commits SET gl_project_id=(#{subquery}) WHERE gl_project_id IS NULL")
diff --git a/db/migrate/20150930001110_merge_request_error_field.rb b/db/migrate/20150930001110_merge_request_error_field.rb
index c2ee498ef3ffe..30f012b0a92b9 100644
--- a/db/migrate/20150930001110_merge_request_error_field.rb
+++ b/db/migrate/20150930001110_merge_request_error_field.rb
@@ -1,4 +1,4 @@
-class MergeRequestErrorField < ActiveRecord::Migration
+class MergeRequestErrorField < ActiveRecord::Migration[4.2]
   def up
     add_column :merge_requests, :merge_error, :string
   end
diff --git a/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb b/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb
index 8d47dac6441e8..181f9f059ac3e 100644
--- a/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb
+++ b/db/migrate/20150930095736_add_null_to_name_for_ci_projects.rb
@@ -1,4 +1,4 @@
-class AddNullToNameForCiProjects < ActiveRecord::Migration
+class AddNullToNameForCiProjects < ActiveRecord::Migration[4.2]
   def up
     change_column_null :ci_projects, :name, true
   end
diff --git a/db/migrate/20150930110012_add_group_share_lock.rb b/db/migrate/20150930110012_add_group_share_lock.rb
index 96938bf9ab64b..627557654571e 100644
--- a/db/migrate/20150930110012_add_group_share_lock.rb
+++ b/db/migrate/20150930110012_add_group_share_lock.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddGroupShareLock < ActiveRecord::Migration
+class AddGroupShareLock < ActiveRecord::Migration[4.2]
   def change
     add_column :namespaces, :share_with_group_lock, :boolean, default: false
   end
diff --git a/db/migrate/20151002112914_add_stage_idx_to_builds.rb b/db/migrate/20151002112914_add_stage_idx_to_builds.rb
index 68a745ffef49d..f73df9dc284aa 100644
--- a/db/migrate/20151002112914_add_stage_idx_to_builds.rb
+++ b/db/migrate/20151002112914_add_stage_idx_to_builds.rb
@@ -1,4 +1,4 @@
-class AddStageIdxToBuilds < ActiveRecord::Migration
+class AddStageIdxToBuilds < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :stage_idx, :integer
   end
diff --git a/db/migrate/20151002121400_add_index_for_builds.rb b/db/migrate/20151002121400_add_index_for_builds.rb
index bd945c54540a9..5e6f80a1d3df3 100644
--- a/db/migrate/20151002121400_add_index_for_builds.rb
+++ b/db/migrate/20151002121400_add_index_for_builds.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexForBuilds < ActiveRecord::Migration
+class AddIndexForBuilds < ActiveRecord::Migration[4.2]
   def up
     add_index :ci_builds, [:commit_id, :stage_idx, :created_at]
   end
diff --git a/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb b/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb
index e3d2ac1cea5cc..ea41921b6ee54 100644
--- a/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb
+++ b/db/migrate/20151002122929_add_ref_and_tag_to_builds.rb
@@ -1,4 +1,4 @@
-class AddRefAndTagToBuilds < ActiveRecord::Migration
+class AddRefAndTagToBuilds < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :tag, :boolean
     add_column :ci_builds, :ref, :string
diff --git a/db/migrate/20151002122943_migrate_ref_and_tag_to_build.rb b/db/migrate/20151002122943_migrate_ref_and_tag_to_build.rb
index 52217ce5af2c0..b4038e6fa8337 100644
--- a/db/migrate/20151002122943_migrate_ref_and_tag_to_build.rb
+++ b/db/migrate/20151002122943_migrate_ref_and_tag_to_build.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateRefAndTagToBuild < ActiveRecord::Migration
+class MigrateRefAndTagToBuild < ActiveRecord::Migration[4.2]
   def change
     execute('UPDATE ci_builds SET ref=(SELECT ref FROM ci_commits WHERE ci_commits.id = ci_builds.commit_id) WHERE ref IS NULL')
     execute('UPDATE ci_builds SET tag=(SELECT tag FROM ci_commits WHERE ci_commits.id = ci_builds.commit_id) WHERE tag IS NULL')
diff --git a/db/migrate/20151005075649_add_user_id_to_build.rb b/db/migrate/20151005075649_add_user_id_to_build.rb
index 0f4b92b8b79f3..45372bf7cba02 100644
--- a/db/migrate/20151005075649_add_user_id_to_build.rb
+++ b/db/migrate/20151005075649_add_user_id_to_build.rb
@@ -1,4 +1,4 @@
-class AddUserIdToBuild < ActiveRecord::Migration
+class AddUserIdToBuild < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :user_id, :integer
   end
diff --git a/db/migrate/20151005150751_add_layout_option_for_users.rb b/db/migrate/20151005150751_add_layout_option_for_users.rb
index 7e68606969f29..66cba21320aec 100644
--- a/db/migrate/20151005150751_add_layout_option_for_users.rb
+++ b/db/migrate/20151005150751_add_layout_option_for_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddLayoutOptionForUsers < ActiveRecord::Migration
+class AddLayoutOptionForUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :layout, :integer, default: 0
   end
diff --git a/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb b/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb
index 07dba598749d5..a8e6e54062a10 100644
--- a/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb
+++ b/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveCiEnabledFromApplicationSettings < ActiveRecord::Migration
+class RemoveCiEnabledFromApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     remove_column :application_settings, :ci_enabled, :boolean, null: false, default: true
   end
diff --git a/db/migrate/20151007120511_namespaces_projects_path_lower_indexes.rb b/db/migrate/20151007120511_namespaces_projects_path_lower_indexes.rb
index 38208e598041a..d6c21bf86393b 100644
--- a/db/migrate/20151007120511_namespaces_projects_path_lower_indexes.rb
+++ b/db/migrate/20151007120511_namespaces_projects_path_lower_indexes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class NamespacesProjectsPathLowerIndexes < ActiveRecord::Migration
+class NamespacesProjectsPathLowerIndexes < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def up
diff --git a/db/migrate/20151008110232_add_users_lower_username_email_indexes.rb b/db/migrate/20151008110232_add_users_lower_username_email_indexes.rb
index 6080d2a0fcfa9..2ba1a6146e2da 100644
--- a/db/migrate/20151008110232_add_users_lower_username_email_indexes.rb
+++ b/db/migrate/20151008110232_add_users_lower_username_email_indexes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddUsersLowerUsernameEmailIndexes < ActiveRecord::Migration
+class AddUsersLowerUsernameEmailIndexes < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def up
diff --git a/db/migrate/20151008123042_add_type_and_description_to_builds.rb b/db/migrate/20151008123042_add_type_and_description_to_builds.rb
index a19eb6c6c49bb..309655cf1955a 100644
--- a/db/migrate/20151008123042_add_type_and_description_to_builds.rb
+++ b/db/migrate/20151008123042_add_type_and_description_to_builds.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddTypeAndDescriptionToBuilds < ActiveRecord::Migration
+class AddTypeAndDescriptionToBuilds < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :type, :string
     add_column :ci_builds, :target_url, :string
diff --git a/db/migrate/20151008130321_migrate_name_to_description_for_builds.rb b/db/migrate/20151008130321_migrate_name_to_description_for_builds.rb
index 306fa7092ea7f..f4445277a6f6a 100644
--- a/db/migrate/20151008130321_migrate_name_to_description_for_builds.rb
+++ b/db/migrate/20151008130321_migrate_name_to_description_for_builds.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateNameToDescriptionForBuilds < ActiveRecord::Migration
+class MigrateNameToDescriptionForBuilds < ActiveRecord::Migration[4.2]
   def change
     execute("UPDATE ci_builds SET type='Ci::Build' WHERE type IS NULL")
   end
diff --git a/db/migrate/20151008143519_add_admin_notification_email_setting.rb b/db/migrate/20151008143519_add_admin_notification_email_setting.rb
index 0bb581efe2c56..60e0986e5a89f 100644
--- a/db/migrate/20151008143519_add_admin_notification_email_setting.rb
+++ b/db/migrate/20151008143519_add_admin_notification_email_setting.rb
@@ -1,4 +1,4 @@
-class AddAdminNotificationEmailSetting < ActiveRecord::Migration
+class AddAdminNotificationEmailSetting < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :admin_notification_email, :string
   end
diff --git a/db/migrate/20151012173029_set_jira_service_api_url.rb b/db/migrate/20151012173029_set_jira_service_api_url.rb
index 2b6f61428c013..91cc6bbc78344 100644
--- a/db/migrate/20151012173029_set_jira_service_api_url.rb
+++ b/db/migrate/20151012173029_set_jira_service_api_url.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class SetJiraServiceApiUrl < ActiveRecord::Migration
+class SetJiraServiceApiUrl < ActiveRecord::Migration[4.2]
   # This migration can be performed online without errors, but some Jira API calls may be missed
   # when doing so because api_url is not yet available.
 
diff --git a/db/migrate/20151013092124_add_artifacts_file_to_builds.rb b/db/migrate/20151013092124_add_artifacts_file_to_builds.rb
index 5a299f7b26dd0..3936386a2c0fe 100644
--- a/db/migrate/20151013092124_add_artifacts_file_to_builds.rb
+++ b/db/migrate/20151013092124_add_artifacts_file_to_builds.rb
@@ -1,4 +1,4 @@
-class AddArtifactsFileToBuilds < ActiveRecord::Migration
+class AddArtifactsFileToBuilds < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :artifacts_file, :text
   end
diff --git a/db/migrate/20151016131433_add_ci_projects_gl_project_id_index.rb b/db/migrate/20151016131433_add_ci_projects_gl_project_id_index.rb
index eb3351eb767eb..a9290fef11a2e 100644
--- a/db/migrate/20151016131433_add_ci_projects_gl_project_id_index.rb
+++ b/db/migrate/20151016131433_add_ci_projects_gl_project_id_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiProjectsGlProjectIdIndex < ActiveRecord::Migration
+class AddCiProjectsGlProjectIdIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :ci_commits, :gl_project_id
   end
diff --git a/db/migrate/20151016195451_add_ci_builds_and_projects_indexes.rb b/db/migrate/20151016195451_add_ci_builds_and_projects_indexes.rb
index 899e004d61018..c8a79f25ae509 100644
--- a/db/migrate/20151016195451_add_ci_builds_and_projects_indexes.rb
+++ b/db/migrate/20151016195451_add_ci_builds_and_projects_indexes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiBuildsAndProjectsIndexes < ActiveRecord::Migration
+class AddCiBuildsAndProjectsIndexes < ActiveRecord::Migration[4.2]
   def change
     add_index :ci_projects, :gitlab_id
     add_index :ci_projects, :shared_runners_enabled
diff --git a/db/migrate/20151016195706_add_notes_line_code_index.rb b/db/migrate/20151016195706_add_notes_line_code_index.rb
index 3298630c1e8b9..0a3ad103009f7 100644
--- a/db/migrate/20151016195706_add_notes_line_code_index.rb
+++ b/db/migrate/20151016195706_add_notes_line_code_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddNotesLineCodeIndex < ActiveRecord::Migration
+class AddNotesLineCodeIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :notes, :line_code
   end
diff --git a/db/migrate/20151019111551_fix_build_tags.rb b/db/migrate/20151019111551_fix_build_tags.rb
index 299a24b0a7c5a..3c64388314d2d 100644
--- a/db/migrate/20151019111551_fix_build_tags.rb
+++ b/db/migrate/20151019111551_fix_build_tags.rb
@@ -1,4 +1,4 @@
-class FixBuildTags < ActiveRecord::Migration
+class FixBuildTags < ActiveRecord::Migration[4.2]
   def up
     execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'")
   end
diff --git a/db/migrate/20151019111703_fail_build_without_names.rb b/db/migrate/20151019111703_fail_build_without_names.rb
index dcdb5d1b25ddc..2dc9ffa32b979 100644
--- a/db/migrate/20151019111703_fail_build_without_names.rb
+++ b/db/migrate/20151019111703_fail_build_without_names.rb
@@ -1,4 +1,4 @@
-class FailBuildWithoutNames < ActiveRecord::Migration
+class FailBuildWithoutNames < ActiveRecord::Migration[4.2]
   def up
     execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'")
   end
diff --git a/db/migrate/20151020145526_add_services_template_index.rb b/db/migrate/20151020145526_add_services_template_index.rb
index 14ff07bd72657..24c373855e246 100644
--- a/db/migrate/20151020145526_add_services_template_index.rb
+++ b/db/migrate/20151020145526_add_services_template_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddServicesTemplateIndex < ActiveRecord::Migration
+class AddServicesTemplateIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :services, :template
   end
diff --git a/db/migrate/20151020173516_ci_limits_to_mysql.rb b/db/migrate/20151020173516_ci_limits_to_mysql.rb
index 9bb960082f58b..573922b851b4e 100644
--- a/db/migrate/20151020173516_ci_limits_to_mysql.rb
+++ b/db/migrate/20151020173516_ci_limits_to_mysql.rb
@@ -1,4 +1,4 @@
-class CiLimitsToMysql < ActiveRecord::Migration
+class CiLimitsToMysql < ActiveRecord::Migration[4.2]
   def change
     return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
 
diff --git a/db/migrate/20151020173906_add_ci_builds_index_for_status.rb b/db/migrate/20151020173906_add_ci_builds_index_for_status.rb
index 81a31e46ff88f..231fc4f2a17d7 100644
--- a/db/migrate/20151020173906_add_ci_builds_index_for_status.rb
+++ b/db/migrate/20151020173906_add_ci_builds_index_for_status.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiBuildsIndexForStatus < ActiveRecord::Migration
+class AddCiBuildsIndexForStatus < ActiveRecord::Migration[4.2]
   def change
     add_index :ci_builds, [:commit_id, :status, :type]
   end
diff --git a/db/migrate/20151023112551_fail_build_with_empty_name.rb b/db/migrate/20151023112551_fail_build_with_empty_name.rb
index 41c0f0649cd61..28f531463bcaf 100644
--- a/db/migrate/20151023112551_fail_build_with_empty_name.rb
+++ b/db/migrate/20151023112551_fail_build_with_empty_name.rb
@@ -1,4 +1,4 @@
-class FailBuildWithEmptyName < ActiveRecord::Migration
+class FailBuildWithEmptyName < ActiveRecord::Migration[4.2]
   def up
     execute("UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'")
   end
diff --git a/db/migrate/20151023144219_remove_satellites.rb b/db/migrate/20151023144219_remove_satellites.rb
index e73f300028ac8..2d1310b0208c1 100644
--- a/db/migrate/20151023144219_remove_satellites.rb
+++ b/db/migrate/20151023144219_remove_satellites.rb
@@ -1,6 +1,6 @@
 require 'fileutils'
 
-class RemoveSatellites < ActiveRecord::Migration
+class RemoveSatellites < ActiveRecord::Migration[4.2]
   def up
     satellites = Gitlab.config['satellites']
     return if satellites.nil?
diff --git a/db/migrate/20151026182941_add_project_path_index.rb b/db/migrate/20151026182941_add_project_path_index.rb
index 117f65c1a1b2d..bf0444450cd3e 100644
--- a/db/migrate/20151026182941_add_project_path_index.rb
+++ b/db/migrate/20151026182941_add_project_path_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddProjectPathIndex < ActiveRecord::Migration
+class AddProjectPathIndex < ActiveRecord::Migration[4.2]
   def up
     add_index :projects, :path
   end
diff --git a/db/migrate/20151028152939_add_merge_when_build_succeeds_to_merge_request.rb b/db/migrate/20151028152939_add_merge_when_build_succeeds_to_merge_request.rb
index 4a989669464af..5b11a430e3005 100644
--- a/db/migrate/20151028152939_add_merge_when_build_succeeds_to_merge_request.rb
+++ b/db/migrate/20151028152939_add_merge_when_build_succeeds_to_merge_request.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMergeWhenBuildSucceedsToMergeRequest < ActiveRecord::Migration
+class AddMergeWhenBuildSucceedsToMergeRequest < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_requests, :merge_params, :text
     add_column :merge_requests, :merge_when_build_succeeds, :boolean, default: false, null: false
diff --git a/db/migrate/20151103001141_add_public_to_group.rb b/db/migrate/20151103001141_add_public_to_group.rb
index ba1f7c27832d1..a5590bc1adc42 100644
--- a/db/migrate/20151103001141_add_public_to_group.rb
+++ b/db/migrate/20151103001141_add_public_to_group.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPublicToGroup < ActiveRecord::Migration
+class AddPublicToGroup < ActiveRecord::Migration[4.2]
   def change
     add_column :namespaces, :public, :boolean, default: false
   end
diff --git a/db/migrate/20151103133339_add_shared_runners_setting.rb b/db/migrate/20151103133339_add_shared_runners_setting.rb
index 4231dfd5c2e81..6fc845d13962f 100644
--- a/db/migrate/20151103133339_add_shared_runners_setting.rb
+++ b/db/migrate/20151103133339_add_shared_runners_setting.rb
@@ -1,4 +1,4 @@
-class AddSharedRunnersSetting < ActiveRecord::Migration
+class AddSharedRunnersSetting < ActiveRecord::Migration[4.2]
   def up
     add_column :application_settings, :shared_runners_enabled, :boolean, default: true, null: false
   end
diff --git a/db/migrate/20151103134857_create_lfs_objects.rb b/db/migrate/20151103134857_create_lfs_objects.rb
index db6fa27199bd9..2ba77e431a17a 100644
--- a/db/migrate/20151103134857_create_lfs_objects.rb
+++ b/db/migrate/20151103134857_create_lfs_objects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateLfsObjects < ActiveRecord::Migration
+class CreateLfsObjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20151103134958_create_lfs_objects_projects.rb b/db/migrate/20151103134958_create_lfs_objects_projects.rb
index 5af1c39fd9cfc..6f8488463b09d 100644
--- a/db/migrate/20151103134958_create_lfs_objects_projects.rb
+++ b/db/migrate/20151103134958_create_lfs_objects_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateLfsObjectsProjects < ActiveRecord::Migration
+class CreateLfsObjectsProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20151104105513_add_file_to_lfs_objects.rb b/db/migrate/20151104105513_add_file_to_lfs_objects.rb
index 7c57f3f0df655..050b1e0750394 100644
--- a/db/migrate/20151104105513_add_file_to_lfs_objects.rb
+++ b/db/migrate/20151104105513_add_file_to_lfs_objects.rb
@@ -1,4 +1,4 @@
-class AddFileToLfsObjects < ActiveRecord::Migration
+class AddFileToLfsObjects < ActiveRecord::Migration[4.2]
   def change
     add_column :lfs_objects, :file, :string
   end
diff --git a/db/migrate/20151105094515_create_releases.rb b/db/migrate/20151105094515_create_releases.rb
index 34dd7a10942bb..4b180a59486a3 100644
--- a/db/migrate/20151105094515_create_releases.rb
+++ b/db/migrate/20151105094515_create_releases.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateReleases < ActiveRecord::Migration
+class CreateReleases < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20151106000015_add_is_award_to_notes.rb b/db/migrate/20151106000015_add_is_award_to_notes.rb
index b463d939b78d4..1d866fb321384 100644
--- a/db/migrate/20151106000015_add_is_award_to_notes.rb
+++ b/db/migrate/20151106000015_add_is_award_to_notes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIsAwardToNotes < ActiveRecord::Migration
+class AddIsAwardToNotes < ActiveRecord::Migration[4.2]
   def change
     add_column :notes, :is_award, :boolean, default: false, null: false
     add_index :notes, :is_award
diff --git a/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb b/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb
index 01d8c0f043eb7..9c14cfd465625 100644
--- a/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb
+++ b/db/migrate/20151109100728_add_max_artifacts_size_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddMaxArtifactsSizeToApplicationSettings < ActiveRecord::Migration
+class AddMaxArtifactsSizeToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :max_artifacts_size, :integer, default: 100, null: false
   end
diff --git a/db/migrate/20151109134526_add_issues_state_index.rb b/db/migrate/20151109134526_add_issues_state_index.rb
index 7a9970e85914e..c77ca90a0d624 100644
--- a/db/migrate/20151109134526_add_issues_state_index.rb
+++ b/db/migrate/20151109134526_add_issues_state_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIssuesStateIndex < ActiveRecord::Migration
+class AddIssuesStateIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :issues, :state
   end
diff --git a/db/migrate/20151109134916_add_projects_visibility_level_index.rb b/db/migrate/20151109134916_add_projects_visibility_level_index.rb
index 471db437b111e..1e945f0e56f0b 100644
--- a/db/migrate/20151109134916_add_projects_visibility_level_index.rb
+++ b/db/migrate/20151109134916_add_projects_visibility_level_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddProjectsVisibilityLevelIndex < ActiveRecord::Migration
+class AddProjectsVisibilityLevelIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :projects, :visibility_level
   end
diff --git a/db/migrate/20151110125604_add_import_error_to_project.rb b/db/migrate/20151110125604_add_import_error_to_project.rb
index 7fc990f8d0a9f..48a15ad073700 100644
--- a/db/migrate/20151110125604_add_import_error_to_project.rb
+++ b/db/migrate/20151110125604_add_import_error_to_project.rb
@@ -1,4 +1,4 @@
-class AddImportErrorToProject < ActiveRecord::Migration
+class AddImportErrorToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :import_error, :text
   end
diff --git a/db/migrate/20151114113410_add_index_for_lfs_oid_and_size.rb b/db/migrate/20151114113410_add_index_for_lfs_oid_and_size.rb
index 00a4c74ffbcc0..f2788117cc2d8 100644
--- a/db/migrate/20151114113410_add_index_for_lfs_oid_and_size.rb
+++ b/db/migrate/20151114113410_add_index_for_lfs_oid_and_size.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexForLfsOidAndSize < ActiveRecord::Migration
+class AddIndexForLfsOidAndSize < ActiveRecord::Migration[4.2]
   def change
     add_index :lfs_objects, :oid
     add_index :lfs_objects, [:oid, :size]
diff --git a/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb b/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb
index 1f192544ea155..3bfbae67119c5 100644
--- a/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb
+++ b/db/migrate/20151116144118_add_unique_for_lfs_oid_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddUniqueForLfsOidIndex < ActiveRecord::Migration
+class AddUniqueForLfsOidIndex < ActiveRecord::Migration[4.2]
   def change
     remove_index :lfs_objects, :oid
     remove_index :lfs_objects, [:oid, :size]
diff --git a/db/migrate/20151118162244_add_projects_public_index.rb b/db/migrate/20151118162244_add_projects_public_index.rb
index 589f124c21e67..3a525c69ad06c 100644
--- a/db/migrate/20151118162244_add_projects_public_index.rb
+++ b/db/migrate/20151118162244_add_projects_public_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddProjectsPublicIndex < ActiveRecord::Migration
+class AddProjectsPublicIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :namespaces, :public
   end
diff --git a/db/migrate/20151201203948_raise_hook_url_limit.rb b/db/migrate/20151201203948_raise_hook_url_limit.rb
index 98a7fca6f6f3e..c1a4974b8c9a4 100644
--- a/db/migrate/20151201203948_raise_hook_url_limit.rb
+++ b/db/migrate/20151201203948_raise_hook_url_limit.rb
@@ -1,4 +1,4 @@
-class RaiseHookUrlLimit < ActiveRecord::Migration
+class RaiseHookUrlLimit < ActiveRecord::Migration[4.2]
   def change
     change_column :web_hooks, :url, :string, limit: 2000
   end
diff --git a/db/migrate/20151203162133_add_hide_project_limit_to_users.rb b/db/migrate/20151203162133_add_hide_project_limit_to_users.rb
index 5dc6d8bf44527..1b96a0dc55017 100644
--- a/db/migrate/20151203162133_add_hide_project_limit_to_users.rb
+++ b/db/migrate/20151203162133_add_hide_project_limit_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddHideProjectLimitToUsers < ActiveRecord::Migration
+class AddHideProjectLimitToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :hide_project_limit, :boolean, default: false
   end
diff --git a/db/migrate/20151203162134_add_build_events_to_services.rb b/db/migrate/20151203162134_add_build_events_to_services.rb
index 455882e5ec06b..c49604f8b61ed 100644
--- a/db/migrate/20151203162134_add_build_events_to_services.rb
+++ b/db/migrate/20151203162134_add_build_events_to_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddBuildEventsToServices < ActiveRecord::Migration
+class AddBuildEventsToServices < ActiveRecord::Migration[4.2]
   def change
     add_column :services, :build_events, :boolean, default: false, null: false
     add_column :web_hooks, :build_events, :boolean, default: false, null: false
diff --git a/db/migrate/20151209144329_migrate_ci_web_hooks.rb b/db/migrate/20151209144329_migrate_ci_web_hooks.rb
index e1e4729f82104..7562735cb1e16 100644
--- a/db/migrate/20151209144329_migrate_ci_web_hooks.rb
+++ b/db/migrate/20151209144329_migrate_ci_web_hooks.rb
@@ -1,4 +1,4 @@
-class MigrateCiWebHooks < ActiveRecord::Migration
+class MigrateCiWebHooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/db/migrate/20151209145909_migrate_ci_emails.rb b/db/migrate/20151209145909_migrate_ci_emails.rb
index e1d92f0157ea1..a1f51c55a5515 100644
--- a/db/migrate/20151209145909_migrate_ci_emails.rb
+++ b/db/migrate/20151209145909_migrate_ci_emails.rb
@@ -1,4 +1,4 @@
-class MigrateCiEmails < ActiveRecord::Migration
+class MigrateCiEmails < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/db/migrate/20151210030143_add_unlock_token_to_user.rb b/db/migrate/20151210030143_add_unlock_token_to_user.rb
index 0ea66ba65dfa6..28b736adfb57e 100644
--- a/db/migrate/20151210030143_add_unlock_token_to_user.rb
+++ b/db/migrate/20151210030143_add_unlock_token_to_user.rb
@@ -1,4 +1,4 @@
-class AddUnlockTokenToUser < ActiveRecord::Migration
+class AddUnlockTokenToUser < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :unlock_token, :string
   end
diff --git a/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb b/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb
index 00f88180e46ab..5da33149b5920 100644
--- a/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb
+++ b/db/migrate/20151210072243_add_runners_registration_token_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRunnersRegistrationTokenToApplicationSettings < ActiveRecord::Migration
+class AddRunnersRegistrationTokenToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :runners_registration_token, :string
   end
diff --git a/db/migrate/20151210125232_migrate_ci_slack_service.rb b/db/migrate/20151210125232_migrate_ci_slack_service.rb
index e6dca4c0008ed..72c90f92377f6 100644
--- a/db/migrate/20151210125232_migrate_ci_slack_service.rb
+++ b/db/migrate/20151210125232_migrate_ci_slack_service.rb
@@ -1,4 +1,4 @@
-class MigrateCiSlackService < ActiveRecord::Migration
+class MigrateCiSlackService < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb b/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb
index 72fcebf2959a4..5ec0798c38fb5 100644
--- a/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb
+++ b/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb
@@ -1,4 +1,4 @@
-class MigrateCiHipChatService < ActiveRecord::Migration
+class MigrateCiHipChatService < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/db/migrate/20151210125928_add_ci_to_project.rb b/db/migrate/20151210125928_add_ci_to_project.rb
index a9ff49a3f7e1d..182f1e17b9a0d 100644
--- a/db/migrate/20151210125928_add_ci_to_project.rb
+++ b/db/migrate/20151210125928_add_ci_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiToProject < ActiveRecord::Migration
+class AddCiToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :ci_id, :integer
     add_column :projects, :builds_enabled, :boolean, default: true, null: false
diff --git a/db/migrate/20151210125929_add_project_id_to_ci.rb b/db/migrate/20151210125929_add_project_id_to_ci.rb
index 84273591fa2ed..f5f2c353f4a04 100644
--- a/db/migrate/20151210125929_add_project_id_to_ci.rb
+++ b/db/migrate/20151210125929_add_project_id_to_ci.rb
@@ -1,4 +1,4 @@
-class AddProjectIdToCi < ActiveRecord::Migration
+class AddProjectIdToCi < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :gl_project_id, :integer
     add_column :ci_runner_projects, :gl_project_id, :integer
diff --git a/db/migrate/20151210125930_migrate_ci_to_project.rb b/db/migrate/20151210125930_migrate_ci_to_project.rb
index c32c7feb19314..f7573ad1a8d03 100644
--- a/db/migrate/20151210125930_migrate_ci_to_project.rb
+++ b/db/migrate/20151210125930_migrate_ci_to_project.rb
@@ -1,4 +1,4 @@
-class MigrateCiToProject < ActiveRecord::Migration
+class MigrateCiToProject < ActiveRecord::Migration[4.2]
   def up
     migrate_project_id_for_table('ci_runner_projects')
     migrate_project_id_for_table('ci_triggers')
diff --git a/db/migrate/20151210125931_add_index_to_ci_tables.rb b/db/migrate/20151210125931_add_index_to_ci_tables.rb
index d87d335cf6b10..2cbc5b5053882 100644
--- a/db/migrate/20151210125931_add_index_to_ci_tables.rb
+++ b/db/migrate/20151210125931_add_index_to_ci_tables.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexToCiTables < ActiveRecord::Migration
+class AddIndexToCiTables < ActiveRecord::Migration[4.2]
   def change
     add_index :ci_builds, :gl_project_id
     add_index :ci_runner_projects, :gl_project_id
diff --git a/db/migrate/20151210125932_drop_null_for_ci_tables.rb b/db/migrate/20151210125932_drop_null_for_ci_tables.rb
index e1a0a964589ad..b48fef4b749f6 100644
--- a/db/migrate/20151210125932_drop_null_for_ci_tables.rb
+++ b/db/migrate/20151210125932_drop_null_for_ci_tables.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class DropNullForCiTables < ActiveRecord::Migration
+class DropNullForCiTables < ActiveRecord::Migration[4.2]
   def change
     remove_index :ci_variables, :project_id
     remove_index :ci_runner_projects, :project_id
diff --git a/db/migrate/20151215132013_add_pages_size_to_application_settings.rb b/db/migrate/20151215132013_add_pages_size_to_application_settings.rb
index f3a663f805bd8..7190d476dc749 100644
--- a/db/migrate/20151215132013_add_pages_size_to_application_settings.rb
+++ b/db/migrate/20151215132013_add_pages_size_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddPagesSizeToApplicationSettings < ActiveRecord::Migration
+class AddPagesSizeToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20151218154042_add_tfa_to_application_settings.rb b/db/migrate/20151218154042_add_tfa_to_application_settings.rb
index dd95db775c5e5..a981fe2720f9a 100644
--- a/db/migrate/20151218154042_add_tfa_to_application_settings.rb
+++ b/db/migrate/20151218154042_add_tfa_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddTfaToApplicationSettings < ActiveRecord::Migration
+class AddTfaToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     change_table :application_settings do |t|
       t.boolean :require_two_factor_authentication, default: false
diff --git a/db/migrate/20151221234414_add_tfa_additional_fields.rb b/db/migrate/20151221234414_add_tfa_additional_fields.rb
index c16df47932f6e..fed734f77f400 100644
--- a/db/migrate/20151221234414_add_tfa_additional_fields.rb
+++ b/db/migrate/20151221234414_add_tfa_additional_fields.rb
@@ -1,4 +1,4 @@
-class AddTfaAdditionalFields < ActiveRecord::Migration
+class AddTfaAdditionalFields < ActiveRecord::Migration[4.2]
   def change
     change_table :users do |t|
       t.datetime :otp_grace_period_started_at, null: true
diff --git a/db/migrate/20151224123230_rename_emojis.rb b/db/migrate/20151224123230_rename_emojis.rb
index 62d921dfdcce3..f1e4b1fe18150 100644
--- a/db/migrate/20151224123230_rename_emojis.rb
+++ b/db/migrate/20151224123230_rename_emojis.rb
@@ -1,5 +1,5 @@
 # Migration type: online without errors (works on previous version and new one)
-class RenameEmojis < ActiveRecord::Migration
+class RenameEmojis < ActiveRecord::Migration[4.2]
   def up
     # Renames aliases to main names
     execute("UPDATE notes SET note ='thumbsup' WHERE is_award = true AND note = '+1'")
diff --git a/db/migrate/20151228111122_remove_public_from_namespace.rb b/db/migrate/20151228111122_remove_public_from_namespace.rb
index bcb322d9cba34..ad922e3fc58e7 100644
--- a/db/migrate/20151228111122_remove_public_from_namespace.rb
+++ b/db/migrate/20151228111122_remove_public_from_namespace.rb
@@ -1,6 +1,6 @@
 # rubocop:disable all
 # Migration type: online
-class RemovePublicFromNamespace < ActiveRecord::Migration
+class RemovePublicFromNamespace < ActiveRecord::Migration[4.2]
   def change
     remove_column :namespaces, :public, :boolean
   end
diff --git a/db/migrate/20151228150906_influxdb_settings.rb b/db/migrate/20151228150906_influxdb_settings.rb
index 2e080a02e6a8c..8266e3c50447f 100644
--- a/db/migrate/20151228150906_influxdb_settings.rb
+++ b/db/migrate/20151228150906_influxdb_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class InfluxdbSettings < ActiveRecord::Migration
+class InfluxdbSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :metrics_enabled, :boolean, default: false
 
diff --git a/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb b/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb
index 259fd0248d291..523f2cae0925b 100644
--- a/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb
+++ b/db/migrate/20151228175719_add_recaptcha_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRecaptchaToApplicationSettings < ActiveRecord::Migration
+class AddRecaptchaToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     change_table :application_settings do |t|
       t.boolean :recaptcha_enabled, default: false
diff --git a/db/migrate/20151229102248_influxdb_udp_port_setting.rb b/db/migrate/20151229102248_influxdb_udp_port_setting.rb
index ae0499f936d6f..da37e3bc148e5 100644
--- a/db/migrate/20151229102248_influxdb_udp_port_setting.rb
+++ b/db/migrate/20151229102248_influxdb_udp_port_setting.rb
@@ -1,4 +1,4 @@
-class InfluxdbUdpPortSetting < ActiveRecord::Migration
+class InfluxdbUdpPortSetting < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :metrics_port, :integer, default: 8089
   end
diff --git a/db/migrate/20151229112614_influxdb_remote_database_setting.rb b/db/migrate/20151229112614_influxdb_remote_database_setting.rb
index d2ac906ead335..5fdf4c6d4cbd5 100644
--- a/db/migrate/20151229112614_influxdb_remote_database_setting.rb
+++ b/db/migrate/20151229112614_influxdb_remote_database_setting.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class InfluxdbRemoteDatabaseSetting < ActiveRecord::Migration
+class InfluxdbRemoteDatabaseSetting < ActiveRecord::Migration[4.2]
   def change
     remove_column :application_settings, :metrics_database
   end
diff --git a/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb b/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb
index 6c282fc50394e..61a3d6486f3f5 100644
--- a/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb
+++ b/db/migrate/20151230132518_add_artifacts_metadata_to_ci_build.rb
@@ -1,4 +1,4 @@
-class AddArtifactsMetadataToCiBuild < ActiveRecord::Migration
+class AddArtifactsMetadataToCiBuild < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :artifacts_metadata, :text
   end
diff --git a/db/migrate/20151231152326_add_akismet_to_application_settings.rb b/db/migrate/20151231152326_add_akismet_to_application_settings.rb
index 3f52c758f9a9a..ef51ea03a5bf9 100644
--- a/db/migrate/20151231152326_add_akismet_to_application_settings.rb
+++ b/db/migrate/20151231152326_add_akismet_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddAkismetToApplicationSettings < ActiveRecord::Migration
+class AddAkismetToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     change_table :application_settings do |t|
       t.boolean :akismet_enabled, default: false
diff --git a/db/migrate/20151231202530_remove_alert_type_from_broadcast_messages.rb b/db/migrate/20151231202530_remove_alert_type_from_broadcast_messages.rb
index 0bdd639eb2140..2d8b44840f013 100644
--- a/db/migrate/20151231202530_remove_alert_type_from_broadcast_messages.rb
+++ b/db/migrate/20151231202530_remove_alert_type_from_broadcast_messages.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveAlertTypeFromBroadcastMessages < ActiveRecord::Migration
+class RemoveAlertTypeFromBroadcastMessages < ActiveRecord::Migration[4.2]
   def change
     remove_column :broadcast_messages, :alert_type, :integer
   end
diff --git a/db/migrate/20160106162223_add_index_milestones_title.rb b/db/migrate/20160106162223_add_index_milestones_title.rb
index 9b9b6445a0839..d42bddefe643e 100644
--- a/db/migrate/20160106162223_add_index_milestones_title.rb
+++ b/db/migrate/20160106162223_add_index_milestones_title.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexMilestonesTitle < ActiveRecord::Migration
+class AddIndexMilestonesTitle < ActiveRecord::Migration[4.2]
   def change
     add_index :milestones, :title
   end
diff --git a/db/migrate/20160106164438_remove_influxdb_credentials.rb b/db/migrate/20160106164438_remove_influxdb_credentials.rb
index 987d75d6fdab4..569d5a0cf36d9 100644
--- a/db/migrate/20160106164438_remove_influxdb_credentials.rb
+++ b/db/migrate/20160106164438_remove_influxdb_credentials.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveInfluxdbCredentials < ActiveRecord::Migration
+class RemoveInfluxdbCredentials < ActiveRecord::Migration[4.2]
   def change
     remove_column :application_settings, :metrics_username, :string
     remove_column :application_settings, :metrics_password, :string
diff --git a/db/migrate/20160109054846_create_spam_logs.rb b/db/migrate/20160109054846_create_spam_logs.rb
index f710327663919..dc97d03f7fff2 100644
--- a/db/migrate/20160109054846_create_spam_logs.rb
+++ b/db/migrate/20160109054846_create_spam_logs.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateSpamLogs < ActiveRecord::Migration
+class CreateSpamLogs < ActiveRecord::Migration[4.2]
   def change
     create_table :spam_logs do |t|
       t.integer :user_id
diff --git a/db/migrate/20160113111034_add_metrics_sample_interval.rb b/db/migrate/20160113111034_add_metrics_sample_interval.rb
index b741f5d2c758d..9c3377571aa2b 100644
--- a/db/migrate/20160113111034_add_metrics_sample_interval.rb
+++ b/db/migrate/20160113111034_add_metrics_sample_interval.rb
@@ -1,4 +1,4 @@
-class AddMetricsSampleInterval < ActiveRecord::Migration
+class AddMetricsSampleInterval < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :metrics_sample_interval, :integer,
       default: 15
diff --git a/db/migrate/20160118155830_add_sentry_to_application_settings.rb b/db/migrate/20160118155830_add_sentry_to_application_settings.rb
index fa7ff9d92289c..20f3925b964cd 100644
--- a/db/migrate/20160118155830_add_sentry_to_application_settings.rb
+++ b/db/migrate/20160118155830_add_sentry_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddSentryToApplicationSettings < ActiveRecord::Migration
+class AddSentryToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     change_table :application_settings do |t|
       t.boolean :sentry_enabled, default: false
diff --git a/db/migrate/20160118232755_add_ip_blocking_settings_to_application_settings.rb b/db/migrate/20160118232755_add_ip_blocking_settings_to_application_settings.rb
index 19ea40b5547e4..809a6cceef51d 100644
--- a/db/migrate/20160118232755_add_ip_blocking_settings_to_application_settings.rb
+++ b/db/migrate/20160118232755_add_ip_blocking_settings_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIpBlockingSettingsToApplicationSettings < ActiveRecord::Migration
+class AddIpBlockingSettingsToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :ip_blocking_enabled, :boolean, default: false
     add_column :application_settings, :dnsbl_servers_list, :text
diff --git a/db/migrate/20160119111158_add_services_category.rb b/db/migrate/20160119111158_add_services_category.rb
index f77484b2f9685..979a48584a935 100644
--- a/db/migrate/20160119111158_add_services_category.rb
+++ b/db/migrate/20160119111158_add_services_category.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddServicesCategory < ActiveRecord::Migration
+class AddServicesCategory < ActiveRecord::Migration[4.2]
   def up
     add_column :services, :category, :string, default: 'common', null: false
 
diff --git a/db/migrate/20160119112418_add_services_default.rb b/db/migrate/20160119112418_add_services_default.rb
index 7fa531899fedf..41ba5d98afe77 100644
--- a/db/migrate/20160119112418_add_services_default.rb
+++ b/db/migrate/20160119112418_add_services_default.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddServicesDefault < ActiveRecord::Migration
+class AddServicesDefault < ActiveRecord::Migration[4.2]
   def up
     add_column :services, :default, :boolean, default: false
 
diff --git a/db/migrate/20160119145451_add_ldap_email_to_users.rb b/db/migrate/20160119145451_add_ldap_email_to_users.rb
index 5b2b0bd31cad9..bf8c27900b8ee 100644
--- a/db/migrate/20160119145451_add_ldap_email_to_users.rb
+++ b/db/migrate/20160119145451_add_ldap_email_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddLdapEmailToUsers < ActiveRecord::Migration
+class AddLdapEmailToUsers < ActiveRecord::Migration[4.2]
   def up
     add_column :users, :ldap_email, :boolean, default: false, null: false
 
diff --git a/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb b/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb
index d6c6aa4a4e83d..9c0a91758f599 100644
--- a/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb
+++ b/db/migrate/20160120172143_add_base_commit_sha_to_merge_request_diffs.rb
@@ -1,4 +1,4 @@
-class AddBaseCommitShaToMergeRequestDiffs < ActiveRecord::Migration
+class AddBaseCommitShaToMergeRequestDiffs < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_request_diffs, :base_commit_sha, :string
   end
diff --git a/db/migrate/20160121030729_add_email_author_in_body_to_application_settings.rb b/db/migrate/20160121030729_add_email_author_in_body_to_application_settings.rb
index 9a2570ae54486..0cb1fbe864157 100644
--- a/db/migrate/20160121030729_add_email_author_in_body_to_application_settings.rb
+++ b/db/migrate/20160121030729_add_email_author_in_body_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddEmailAuthorInBodyToApplicationSettings < ActiveRecord::Migration
+class AddEmailAuthorInBodyToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :email_author_in_body, :boolean, default: false
   end
diff --git a/db/migrate/20160122185421_add_pending_delete_to_project.rb b/db/migrate/20160122185421_add_pending_delete_to_project.rb
index 61db852843fe0..8db0adc922178 100644
--- a/db/migrate/20160122185421_add_pending_delete_to_project.rb
+++ b/db/migrate/20160122185421_add_pending_delete_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPendingDeleteToProject < ActiveRecord::Migration
+class AddPendingDeleteToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :pending_delete, :boolean, default: false
   end
diff --git a/db/migrate/20160128212447_remove_ip_blocking_settings_from_application_settings.rb b/db/migrate/20160128212447_remove_ip_blocking_settings_from_application_settings.rb
index 60ecda998dd83..e76f0249ae58b 100644
--- a/db/migrate/20160128212447_remove_ip_blocking_settings_from_application_settings.rb
+++ b/db/migrate/20160128212447_remove_ip_blocking_settings_from_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveIpBlockingSettingsFromApplicationSettings < ActiveRecord::Migration
+class RemoveIpBlockingSettingsFromApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     remove_column :application_settings, :ip_blocking_enabled, :boolean, default: false
     remove_column :application_settings, :dnsbl_servers_list, :text
diff --git a/db/migrate/20160128233227_change_lfs_objects_size_column.rb b/db/migrate/20160128233227_change_lfs_objects_size_column.rb
index e7fd1f7177779..65aaf2d9a0b41 100644
--- a/db/migrate/20160128233227_change_lfs_objects_size_column.rb
+++ b/db/migrate/20160128233227_change_lfs_objects_size_column.rb
@@ -1,4 +1,4 @@
-class ChangeLfsObjectsSizeColumn < ActiveRecord::Migration
+class ChangeLfsObjectsSizeColumn < ActiveRecord::Migration[4.2]
   def change
     change_column :lfs_objects, :size, :integer, limit: 8
   end
diff --git a/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb b/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
index d3ea956952e7d..6254017615b8b 100644
--- a/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
+++ b/db/migrate/20160129135155_remove_dot_atom_path_ending_of_projects.rb
@@ -1,4 +1,4 @@
-class RemoveDotAtomPathEndingOfProjects < ActiveRecord::Migration
+class RemoveDotAtomPathEndingOfProjects < ActiveRecord::Migration[4.2]
   include Gitlab::ShellAdapter
 
   class ProjectPath
diff --git a/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb b/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb
index f0d9422651483..8b84705ce7d06 100644
--- a/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb
+++ b/db/migrate/20160129155512_add_merge_commit_sha_to_merge_requests.rb
@@ -1,4 +1,4 @@
-class AddMergeCommitShaToMergeRequests < ActiveRecord::Migration
+class AddMergeCommitShaToMergeRequests < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_requests, :merge_commit_sha, :string
   end
diff --git a/db/migrate/20160202091601_add_erasable_to_ci_build.rb b/db/migrate/20160202091601_add_erasable_to_ci_build.rb
index 767ae160d0855..214028bd8d3e9 100644
--- a/db/migrate/20160202091601_add_erasable_to_ci_build.rb
+++ b/db/migrate/20160202091601_add_erasable_to_ci_build.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddErasableToCiBuild < ActiveRecord::Migration
+class AddErasableToCiBuild < ActiveRecord::Migration[4.2]
   def change
     add_reference :ci_builds, :erased_by, references: :users, index: true
     add_column :ci_builds, :erased_at, :datetime
diff --git a/db/migrate/20160202164642_add_allow_guest_to_access_builds_project.rb b/db/migrate/20160202164642_add_allow_guest_to_access_builds_project.rb
index 2c5cb307fada3..542f94379114e 100644
--- a/db/migrate/20160202164642_add_allow_guest_to_access_builds_project.rb
+++ b/db/migrate/20160202164642_add_allow_guest_to_access_builds_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddAllowGuestToAccessBuildsProject < ActiveRecord::Migration
+class AddAllowGuestToAccessBuildsProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :public_builds, :boolean, default: true, null: false
   end
diff --git a/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb b/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb
index f996ae74dca17..c1f1faf027918 100644
--- a/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb
+++ b/db/migrate/20160204144558_add_real_size_to_merge_request_diffs.rb
@@ -1,4 +1,4 @@
-class AddRealSizeToMergeRequestDiffs < ActiveRecord::Migration
+class AddRealSizeToMergeRequestDiffs < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_request_diffs, :real_size, :string
   end
diff --git a/db/migrate/20160209130428_add_index_to_snippet.rb b/db/migrate/20160209130428_add_index_to_snippet.rb
index 4d17c3a2917b1..480ac193d634a 100644
--- a/db/migrate/20160209130428_add_index_to_snippet.rb
+++ b/db/migrate/20160209130428_add_index_to_snippet.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexToSnippet < ActiveRecord::Migration
+class AddIndexToSnippet < ActiveRecord::Migration[4.2]
   def change
     add_index :snippets, :updated_at
   end
diff --git a/db/migrate/20160210105555_create_pages_domain.rb b/db/migrate/20160210105555_create_pages_domain.rb
index 0e8507c7e9ad6..a46906d64caa0 100644
--- a/db/migrate/20160210105555_create_pages_domain.rb
+++ b/db/migrate/20160210105555_create_pages_domain.rb
@@ -1,4 +1,4 @@
-class CreatePagesDomain < ActiveRecord::Migration
+class CreatePagesDomain < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160212123307_create_tasks.rb b/db/migrate/20160212123307_create_tasks.rb
index cd3ad0e4cd8d9..33acc8af91ff1 100644
--- a/db/migrate/20160212123307_create_tasks.rb
+++ b/db/migrate/20160212123307_create_tasks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateTasks < ActiveRecord::Migration
+class CreateTasks < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160217100506_add_description_to_label.rb b/db/migrate/20160217100506_add_description_to_label.rb
index eed6d1f236aa1..116de8ddfa9a9 100644
--- a/db/migrate/20160217100506_add_description_to_label.rb
+++ b/db/migrate/20160217100506_add_description_to_label.rb
@@ -1,4 +1,4 @@
-class AddDescriptionToLabel < ActiveRecord::Migration
+class AddDescriptionToLabel < ActiveRecord::Migration[4.2]
   def change
     add_column :labels, :description, :string
   end
diff --git a/db/migrate/20160217174422_add_note_to_tasks.rb b/db/migrate/20160217174422_add_note_to_tasks.rb
index da5cb2e05db69..c2a42ce5dd886 100644
--- a/db/migrate/20160217174422_add_note_to_tasks.rb
+++ b/db/migrate/20160217174422_add_note_to_tasks.rb
@@ -1,4 +1,4 @@
-class AddNoteToTasks < ActiveRecord::Migration
+class AddNoteToTasks < ActiveRecord::Migration[4.2]
   def change
     add_reference :tasks, :note, index: true
   end
diff --git a/db/migrate/20160220123949_rename_tasks_to_todos.rb b/db/migrate/20160220123949_rename_tasks_to_todos.rb
index 30c10d27146e7..0cc110a0a1a27 100644
--- a/db/migrate/20160220123949_rename_tasks_to_todos.rb
+++ b/db/migrate/20160220123949_rename_tasks_to_todos.rb
@@ -1,4 +1,4 @@
-class RenameTasksToTodos < ActiveRecord::Migration
+class RenameTasksToTodos < ActiveRecord::Migration[4.2]
   def change
     rename_table :tasks, :todos
   end
diff --git a/db/migrate/20160222153918_create_appearances_ce.rb b/db/migrate/20160222153918_create_appearances_ce.rb
index b2d5949b23f52..37bbe62ad3dc5 100644
--- a/db/migrate/20160222153918_create_appearances_ce.rb
+++ b/db/migrate/20160222153918_create_appearances_ce.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateAppearancesCe < ActiveRecord::Migration
+class CreateAppearancesCe < ActiveRecord::Migration[4.2]
   def change
     unless table_exists?(:appearances)
       create_table :appearances do |t|
diff --git a/db/migrate/20160223192159_add_confidential_to_issues.rb b/db/migrate/20160223192159_add_confidential_to_issues.rb
index 5b99ce30e9f06..ca029f12337d8 100644
--- a/db/migrate/20160223192159_add_confidential_to_issues.rb
+++ b/db/migrate/20160223192159_add_confidential_to_issues.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddConfidentialToIssues < ActiveRecord::Migration
+class AddConfidentialToIssues < ActiveRecord::Migration[4.2]
   def change
     add_column :issues, :confidential, :boolean, default: false
     add_index :issues, :confidential
diff --git a/db/migrate/20160225090018_add_delete_at_to_issues.rb b/db/migrate/20160225090018_add_delete_at_to_issues.rb
index 139f911e1c90b..3ae74f491f6f4 100644
--- a/db/migrate/20160225090018_add_delete_at_to_issues.rb
+++ b/db/migrate/20160225090018_add_delete_at_to_issues.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddDeleteAtToIssues < ActiveRecord::Migration
+class AddDeleteAtToIssues < ActiveRecord::Migration[4.2]
   def change
     add_column :issues, :deleted_at, :datetime
     add_index :issues, :deleted_at
diff --git a/db/migrate/20160225101956_add_delete_at_to_merge_requests.rb b/db/migrate/20160225101956_add_delete_at_to_merge_requests.rb
index 4ca3f0dcdc522..ce8657ba88cc4 100644
--- a/db/migrate/20160225101956_add_delete_at_to_merge_requests.rb
+++ b/db/migrate/20160225101956_add_delete_at_to_merge_requests.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddDeleteAtToMergeRequests < ActiveRecord::Migration
+class AddDeleteAtToMergeRequests < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_requests, :deleted_at, :datetime
     add_index :merge_requests, :deleted_at
diff --git a/db/migrate/20160226114608_add_trigram_indexes_for_searching.rb b/db/migrate/20160226114608_add_trigram_indexes_for_searching.rb
index 7aa79bf5e02cd..82b54c552e0f3 100644
--- a/db/migrate/20160226114608_add_trigram_indexes_for_searching.rb
+++ b/db/migrate/20160226114608_add_trigram_indexes_for_searching.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddTrigramIndexesForSearching < ActiveRecord::Migration
+class AddTrigramIndexesForSearching < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def up
diff --git a/db/migrate/20160227120001_add_event_field_for_web_hook.rb b/db/migrate/20160227120001_add_event_field_for_web_hook.rb
index 89910893ee1b1..22bbd73114f89 100644
--- a/db/migrate/20160227120001_add_event_field_for_web_hook.rb
+++ b/db/migrate/20160227120001_add_event_field_for_web_hook.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddEventFieldForWebHook < ActiveRecord::Migration
+class AddEventFieldForWebHook < ActiveRecord::Migration[4.2]
   def change
     add_column :web_hooks, :wiki_page_events, :boolean, default: false, null: false
   end
diff --git a/db/migrate/20160227120047_add_event_to_services.rb b/db/migrate/20160227120047_add_event_to_services.rb
index fe7c54ca4eb91..a3b94734ec2f3 100644
--- a/db/migrate/20160227120047_add_event_to_services.rb
+++ b/db/migrate/20160227120047_add_event_to_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddEventToServices < ActiveRecord::Migration
+class AddEventToServices < ActiveRecord::Migration[4.2]
   def change
     add_column :services, :wiki_page_events, :boolean, default: true
   end
diff --git a/db/migrate/20160229193553_add_main_language_to_repository.rb b/db/migrate/20160229193553_add_main_language_to_repository.rb
index b5446c6a4472c..15f9a3828027e 100644
--- a/db/migrate/20160229193553_add_main_language_to_repository.rb
+++ b/db/migrate/20160229193553_add_main_language_to_repository.rb
@@ -1,4 +1,4 @@
-class AddMainLanguageToRepository < ActiveRecord::Migration
+class AddMainLanguageToRepository < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :main_language, :string
   end
diff --git a/db/migrate/20160301124843_add_visibility_level_to_groups.rb b/db/migrate/20160301124843_add_visibility_level_to_groups.rb
index a874e6758dd23..ed4bca4f1bac3 100644
--- a/db/migrate/20160301124843_add_visibility_level_to_groups.rb
+++ b/db/migrate/20160301124843_add_visibility_level_to_groups.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddVisibilityLevelToGroups < ActiveRecord::Migration
+class AddVisibilityLevelToGroups < ActiveRecord::Migration[4.2]
   def up
     add_column :namespaces, :visibility_level, :integer, null: false, default: Gitlab::VisibilityLevel::PUBLIC
     add_index :namespaces, :visibility_level
diff --git a/db/migrate/20160301174731_add_fingerprint_index.rb b/db/migrate/20160301174731_add_fingerprint_index.rb
index f2c3d1ba1eadb..b13373a046847 100644
--- a/db/migrate/20160301174731_add_fingerprint_index.rb
+++ b/db/migrate/20160301174731_add_fingerprint_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddFingerprintIndex < ActiveRecord::Migration
+class AddFingerprintIndex < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   DOWNTIME = false
diff --git a/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb b/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb
index ffcd64266e380..b0ea05bd6e154 100644
--- a/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb
+++ b/db/migrate/20160302151724_add_import_credentials_to_project_import_data.rb
@@ -1,4 +1,4 @@
-class AddImportCredentialsToProjectImportData < ActiveRecord::Migration
+class AddImportCredentialsToProjectImportData < ActiveRecord::Migration[4.2]
   def change
     add_column :project_import_data, :encrypted_credentials, :text
     add_column :project_import_data, :encrypted_credentials_iv, :string
diff --git a/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb b/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb
index 951051187646c..8a319554c281f 100644
--- a/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb
+++ b/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb
@@ -2,7 +2,7 @@
 # Loops through old importer projects that kept a token/password in the import URL
 # and encrypts the credentials into a separate field in project#import_data
 # #down method not supported
-class RemoveWrongImportUrlFromProjects < ActiveRecord::Migration
+class RemoveWrongImportUrlFromProjects < ActiveRecord::Migration[4.2]
 
   class ProjectImportDataFake
     extend AttrEncrypted
diff --git a/db/migrate/20160305220806_remove_expires_at_from_snippets.rb b/db/migrate/20160305220806_remove_expires_at_from_snippets.rb
index cac78703bc22b..6835f534926ac 100644
--- a/db/migrate/20160305220806_remove_expires_at_from_snippets.rb
+++ b/db/migrate/20160305220806_remove_expires_at_from_snippets.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveExpiresAtFromSnippets < ActiveRecord::Migration
+class RemoveExpiresAtFromSnippets < ActiveRecord::Migration[4.2]
   def change
     remove_column :snippets, :expires_at, :datetime
   end
diff --git a/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb b/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb
index 49e787d9a9a59..26b65ef7037aa 100644
--- a/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb
+++ b/db/migrate/20160307221555_disallow_blank_line_code_on_note.rb
@@ -1,4 +1,4 @@
-class DisallowBlankLineCodeOnNote < ActiveRecord::Migration
+class DisallowBlankLineCodeOnNote < ActiveRecord::Migration[4.2]
   def up
     execute("UPDATE notes SET line_code = NULL WHERE line_code = ''")
   end
diff --git a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb
index 92c0a1e088e9a..16053408fe0fc 100644
--- a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb
+++ b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb
@@ -3,7 +3,7 @@
 # Sets default_visibility_level to value on settings if not restricted
 # If value is restricted takes higher visibility level allowed
 
-class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration
+class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration[4.2]
   def up
     add_column :application_settings, :default_group_visibility, :integer
     # Unfortunately, this can't be a `default`, since we don't want the configuration specific
diff --git a/db/migrate/20160309140734_fix_todos.rb b/db/migrate/20160309140734_fix_todos.rb
index 94fe1e4fdc300..917055f5036c1 100644
--- a/db/migrate/20160309140734_fix_todos.rb
+++ b/db/migrate/20160309140734_fix_todos.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class FixTodos < ActiveRecord::Migration
+class FixTodos < ActiveRecord::Migration[4.2]
  def up
     execute <<-SQL
       DELETE FROM todos
diff --git a/db/migrate/20160310124959_add_due_date_to_issues.rb b/db/migrate/20160310124959_add_due_date_to_issues.rb
index a4eb6aaee63ed..8da38ea60b15c 100644
--- a/db/migrate/20160310124959_add_due_date_to_issues.rb
+++ b/db/migrate/20160310124959_add_due_date_to_issues.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddDueDateToIssues < ActiveRecord::Migration
+class AddDueDateToIssues < ActiveRecord::Migration[4.2]
   def change
     add_column :issues, :due_date, :date
     add_index :issues, :due_date
diff --git a/db/migrate/20160310185910_add_external_flag_to_users.rb b/db/migrate/20160310185910_add_external_flag_to_users.rb
index 209496dc7861a..768bbe4cd42e7 100644
--- a/db/migrate/20160310185910_add_external_flag_to_users.rb
+++ b/db/migrate/20160310185910_add_external_flag_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddExternalFlagToUsers < ActiveRecord::Migration
+class AddExternalFlagToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :external, :boolean, default: false
   end
diff --git a/db/migrate/20160314094147_add_priority_to_label.rb b/db/migrate/20160314094147_add_priority_to_label.rb
index 7fb23cba4c90e..8e2aaf5010918 100644
--- a/db/migrate/20160314094147_add_priority_to_label.rb
+++ b/db/migrate/20160314094147_add_priority_to_label.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddPriorityToLabel < ActiveRecord::Migration
+class AddPriorityToLabel < ActiveRecord::Migration[4.2]
   def change
     add_column :labels, :priority, :integer
     add_index :labels, :priority
diff --git a/db/migrate/20160314114439_add_requested_at_to_members.rb b/db/migrate/20160314114439_add_requested_at_to_members.rb
index 76c8b8a1a24fc..e7e03f96ef8b7 100644
--- a/db/migrate/20160314114439_add_requested_at_to_members.rb
+++ b/db/migrate/20160314114439_add_requested_at_to_members.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddRequestedAtToMembers < ActiveRecord::Migration
+class AddRequestedAtToMembers < ActiveRecord::Migration[4.2]
   def change
     add_column :members, :requested_at, :datetime
   end
diff --git a/db/migrate/20160314143402_projects_add_pushes_since_gc.rb b/db/migrate/20160314143402_projects_add_pushes_since_gc.rb
index 9f8ffe073a316..e64093d39cfc7 100644
--- a/db/migrate/20160314143402_projects_add_pushes_since_gc.rb
+++ b/db/migrate/20160314143402_projects_add_pushes_since_gc.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class ProjectsAddPushesSinceGc < ActiveRecord::Migration
+class ProjectsAddPushesSinceGc < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :pushes_since_gc, :integer, default: 0
   end
diff --git a/db/migrate/20160315135439_project_add_repository_check.rb b/db/migrate/20160315135439_project_add_repository_check.rb
index 8fe649246c747..c03d8bb041c63 100644
--- a/db/migrate/20160315135439_project_add_repository_check.rb
+++ b/db/migrate/20160315135439_project_add_repository_check.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class ProjectAddRepositoryCheck < ActiveRecord::Migration
+class ProjectAddRepositoryCheck < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :last_repository_check_failed, :boolean
     add_index :projects, :last_repository_check_failed
diff --git a/db/migrate/20160316123110_ci_runners_token_index.rb b/db/migrate/20160316123110_ci_runners_token_index.rb
index ff3d36d68ee21..026846e646465 100644
--- a/db/migrate/20160316123110_ci_runners_token_index.rb
+++ b/db/migrate/20160316123110_ci_runners_token_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CiRunnersTokenIndex < ActiveRecord::Migration
+class CiRunnersTokenIndex < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def change
diff --git a/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb b/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb
index 6871b3920df14..488c3d4945c2e 100644
--- a/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb
+++ b/db/migrate/20160316192622_change_target_id_to_null_on_todos.rb
@@ -1,4 +1,4 @@
-class ChangeTargetIdToNullOnTodos < ActiveRecord::Migration
+class ChangeTargetIdToNullOnTodos < ActiveRecord::Migration[4.2]
   def change
     change_column_null :todos, :target_id, true
   end
diff --git a/db/migrate/20160316204731_add_commit_id_to_todos.rb b/db/migrate/20160316204731_add_commit_id_to_todos.rb
index d79858fc920d0..d1c004b2ced66 100644
--- a/db/migrate/20160316204731_add_commit_id_to_todos.rb
+++ b/db/migrate/20160316204731_add_commit_id_to_todos.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCommitIdToTodos < ActiveRecord::Migration
+class AddCommitIdToTodos < ActiveRecord::Migration[4.2]
   def change
     add_column :todos, :commit_id, :string
     add_index :todos, :commit_id
diff --git a/db/migrate/20160317092222_add_moved_to_to_issue.rb b/db/migrate/20160317092222_add_moved_to_to_issue.rb
index 2bf549d7ecdae..8d81d84fd2022 100644
--- a/db/migrate/20160317092222_add_moved_to_to_issue.rb
+++ b/db/migrate/20160317092222_add_moved_to_to_issue.rb
@@ -1,4 +1,4 @@
-class AddMovedToToIssue < ActiveRecord::Migration
+class AddMovedToToIssue < ActiveRecord::Migration[4.2]
   def change
     add_reference :issues, :moved_to, references: :issues # rubocop:disable Migration/AddReference
   end
diff --git a/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb b/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
index 07ae7c95477d6..9692def430cd0 100644
--- a/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
+++ b/db/migrate/20160320204112_index_namespaces_on_visibility_level.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class IndexNamespacesOnVisibilityLevel < ActiveRecord::Migration
+class IndexNamespacesOnVisibilityLevel < ActiveRecord::Migration[4.2]
   def change
     unless index_exists?(:namespaces, :visibility_level)
       add_index :namespaces, :visibility_level
diff --git a/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb b/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb
index 1fff9759d1e38..a25d15a81efcd 100644
--- a/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb
+++ b/db/migrate/20160324020319_remove_todos_for_deleted_issues.rb
@@ -1,4 +1,4 @@
-class RemoveTodosForDeletedIssues < ActiveRecord::Migration
+class RemoveTodosForDeletedIssues < ActiveRecord::Migration[4.2]
   def up
     execute <<-SQL
       DELETE FROM todos
diff --git a/db/migrate/20160328112808_create_notification_settings.rb b/db/migrate/20160328112808_create_notification_settings.rb
index 7d77e8004baf0..db19d2e370c42 100644
--- a/db/migrate/20160328112808_create_notification_settings.rb
+++ b/db/migrate/20160328112808_create_notification_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateNotificationSettings < ActiveRecord::Migration
+class CreateNotificationSettings < ActiveRecord::Migration[4.2]
   def change
     create_table :notification_settings do |t|
       t.references :user, null: false
diff --git a/db/migrate/20160328115649_migrate_new_notification_setting.rb b/db/migrate/20160328115649_migrate_new_notification_setting.rb
index 3c81b2c37bfe5..5ba09e75145d8 100644
--- a/db/migrate/20160328115649_migrate_new_notification_setting.rb
+++ b/db/migrate/20160328115649_migrate_new_notification_setting.rb
@@ -5,7 +5,7 @@
 # - during migration some users will receive notifications based on their global settings (project/group settings will be ignored)
 # - its possible to get duplicate records for notification settings since we don't create uniq index yet
 #
-class MigrateNewNotificationSetting < ActiveRecord::Migration
+class MigrateNewNotificationSetting < ActiveRecord::Migration[4.2]
   def up
     timestamp = Time.now.strftime('%F %T')
     execute "INSERT INTO notification_settings ( user_id, source_id, source_type, level, created_at, updated_at ) SELECT user_id, source_id, source_type, notification_level, '#{timestamp}', '#{timestamp}' FROM members WHERE user_id IS NOT NULL"
diff --git a/db/migrate/20160328121138_add_notification_setting_index.rb b/db/migrate/20160328121138_add_notification_setting_index.rb
index 667270d6b0488..ed82b17229671 100644
--- a/db/migrate/20160328121138_add_notification_setting_index.rb
+++ b/db/migrate/20160328121138_add_notification_setting_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddNotificationSettingIndex < ActiveRecord::Migration
+class AddNotificationSettingIndex < ActiveRecord::Migration[4.2]
   def change
     add_index :notification_settings, :user_id
     add_index :notification_settings, [:source_id, :source_type]
diff --git a/db/migrate/20160329144452_add_index_on_pending_delete_projects.rb b/db/migrate/20160329144452_add_index_on_pending_delete_projects.rb
index a3df8fb4e2ec2..15c44f74451a7 100644
--- a/db/migrate/20160329144452_add_index_on_pending_delete_projects.rb
+++ b/db/migrate/20160329144452_add_index_on_pending_delete_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexOnPendingDeleteProjects < ActiveRecord::Migration
+class AddIndexOnPendingDeleteProjects < ActiveRecord::Migration[4.2]
   def change
     add_index :projects, :pending_delete
   end
diff --git a/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb b/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb
index 54cea964ff2c7..634a696377ceb 100644
--- a/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb
+++ b/db/migrate/20160331133914_remove_todos_for_deleted_merge_requests.rb
@@ -1,4 +1,4 @@
-class RemoveTodosForDeletedMergeRequests < ActiveRecord::Migration
+class RemoveTodosForDeletedMergeRequests < ActiveRecord::Migration[4.2]
   def up
     execute <<-SQL
       DELETE FROM todos
diff --git a/db/migrate/20160331223143_remove_twitter_sharing_enabled_from_application_settings.rb b/db/migrate/20160331223143_remove_twitter_sharing_enabled_from_application_settings.rb
index dec80497fb31d..6e5a748d09668 100644
--- a/db/migrate/20160331223143_remove_twitter_sharing_enabled_from_application_settings.rb
+++ b/db/migrate/20160331223143_remove_twitter_sharing_enabled_from_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveTwitterSharingEnabledFromApplicationSettings < ActiveRecord::Migration
+class RemoveTwitterSharingEnabledFromApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     remove_column :application_settings, :twitter_sharing_enabled, :boolean
   end
diff --git a/db/migrate/20160407120251_add_images_enabled_for_project.rb b/db/migrate/20160407120251_add_images_enabled_for_project.rb
index 47f0ca8e8debd..2c42d89ccdf9e 100644
--- a/db/migrate/20160407120251_add_images_enabled_for_project.rb
+++ b/db/migrate/20160407120251_add_images_enabled_for_project.rb
@@ -1,4 +1,4 @@
-class AddImagesEnabledForProject < ActiveRecord::Migration
+class AddImagesEnabledForProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :container_registry_enabled, :boolean
   end
diff --git a/db/migrate/20160412140240_add_repository_checks_enabled_setting.rb b/db/migrate/20160412140240_add_repository_checks_enabled_setting.rb
index 920d4d4111041..a59563b835ea5 100644
--- a/db/migrate/20160412140240_add_repository_checks_enabled_setting.rb
+++ b/db/migrate/20160412140240_add_repository_checks_enabled_setting.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddRepositoryChecksEnabledSetting < ActiveRecord::Migration
+class AddRepositoryChecksEnabledSetting < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :repository_checks_enabled, :boolean, default: true
   end
diff --git a/db/migrate/20160412173416_add_fields_to_ci_commit.rb b/db/migrate/20160412173416_add_fields_to_ci_commit.rb
index 00162af5cdadd..4b3d4e8bd30d2 100644
--- a/db/migrate/20160412173416_add_fields_to_ci_commit.rb
+++ b/db/migrate/20160412173416_add_fields_to_ci_commit.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddFieldsToCiCommit < ActiveRecord::Migration
+class AddFieldsToCiCommit < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_commits, :status, :string
     add_column :ci_commits, :started_at, :timestamp
diff --git a/db/migrate/20160412173417_update_ci_commit.rb b/db/migrate/20160412173417_update_ci_commit.rb
index 858faeb060e68..91dd4582f7ac3 100644
--- a/db/migrate/20160412173417_update_ci_commit.rb
+++ b/db/migrate/20160412173417_update_ci_commit.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class UpdateCiCommit < ActiveRecord::Migration
+class UpdateCiCommit < ActiveRecord::Migration[4.2]
   # This migration can be run online, but needs to be executed for the second time after restarting Unicorn workers
   # Otherwise Offline migration should be used.
   def change
diff --git a/db/migrate/20160412173418_add_ci_commit_indexes.rb b/db/migrate/20160412173418_add_ci_commit_indexes.rb
index 414f1f8279fe7..709e6b84d5765 100644
--- a/db/migrate/20160412173418_add_ci_commit_indexes.rb
+++ b/db/migrate/20160412173418_add_ci_commit_indexes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddCiCommitIndexes < ActiveRecord::Migration
+class AddCiCommitIndexes < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def change
diff --git a/db/migrate/20160413115152_add_token_to_web_hooks.rb b/db/migrate/20160413115152_add_token_to_web_hooks.rb
index f04225068cd2c..43fe46dfe5d8c 100644
--- a/db/migrate/20160413115152_add_token_to_web_hooks.rb
+++ b/db/migrate/20160413115152_add_token_to_web_hooks.rb
@@ -1,4 +1,4 @@
-class AddTokenToWebHooks < ActiveRecord::Migration
+class AddTokenToWebHooks < ActiveRecord::Migration[4.2]
   def change
     add_column :web_hooks, :token, :string
   end
diff --git a/db/migrate/20160415062917_create_personal_access_tokens.rb b/db/migrate/20160415062917_create_personal_access_tokens.rb
index 946500269942e..43599db799ed2 100644
--- a/db/migrate/20160415062917_create_personal_access_tokens.rb
+++ b/db/migrate/20160415062917_create_personal_access_tokens.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreatePersonalAccessTokens < ActiveRecord::Migration
+class CreatePersonalAccessTokens < ActiveRecord::Migration[4.2]
   def change
     create_table :personal_access_tokens do |t|
       t.references :user, index: true, foreign_key: true, null: false
diff --git a/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb b/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb
index d493044c67b83..e96c0591a0718 100644
--- a/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb
+++ b/db/migrate/20160415133440_add_shared_runners_text_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddSharedRunnersTextToApplicationSettings < ActiveRecord::Migration
+class AddSharedRunnersTextToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :shared_runners_text, :text
   end
diff --git a/db/migrate/20160416180807_add_award_emoji.rb b/db/migrate/20160416180807_add_award_emoji.rb
index 0d252e5044e8a..99c984fd1167d 100644
--- a/db/migrate/20160416180807_add_award_emoji.rb
+++ b/db/migrate/20160416180807_add_award_emoji.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddAwardEmoji < ActiveRecord::Migration
+class AddAwardEmoji < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb
index 50f159a80b18b..af2820986f0f9 100644
--- a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb
+++ b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb
@@ -1,4 +1,4 @@
-class ConvertAwardNoteToEmojiAward < ActiveRecord::Migration
+class ConvertAwardNoteToEmojiAward < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def up
diff --git a/db/migrate/20160419120017_add_metrics_packet_size.rb b/db/migrate/20160419120017_add_metrics_packet_size.rb
index 78c163d62acf8..16c3ebfe22b43 100644
--- a/db/migrate/20160419120017_add_metrics_packet_size.rb
+++ b/db/migrate/20160419120017_add_metrics_packet_size.rb
@@ -1,4 +1,4 @@
-class AddMetricsPacketSize < ActiveRecord::Migration
+class AddMetricsPacketSize < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :metrics_packet_size, :integer, default: 1
   end
diff --git a/db/migrate/20160419122101_add_only_allow_merge_if_build_succeeds_to_projects.rb b/db/migrate/20160419122101_add_only_allow_merge_if_build_succeeds_to_projects.rb
index 1716b6e815358..cf842a684a643 100644
--- a/db/migrate/20160419122101_add_only_allow_merge_if_build_succeeds_to_projects.rb
+++ b/db/migrate/20160419122101_add_only_allow_merge_if_build_succeeds_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddOnlyAllowMergeIfBuildSucceedsToProjects < ActiveRecord::Migration
+class AddOnlyAllowMergeIfBuildSucceedsToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160421130527_disable_repository_checks.rb b/db/migrate/20160421130527_disable_repository_checks.rb
index 7e65ddc45e731..8b3ce73c5e819 100644
--- a/db/migrate/20160421130527_disable_repository_checks.rb
+++ b/db/migrate/20160421130527_disable_repository_checks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class DisableRepositoryChecks < ActiveRecord::Migration
+class DisableRepositoryChecks < ActiveRecord::Migration[4.2]
   def up
     change_column_default :application_settings, :repository_checks_enabled, false 
     execute 'UPDATE application_settings SET repository_checks_enabled = false'
diff --git a/db/migrate/20160425045124_create_u2f_registrations.rb b/db/migrate/20160425045124_create_u2f_registrations.rb
index 72cbe98ebba36..9b48fc822b614 100644
--- a/db/migrate/20160425045124_create_u2f_registrations.rb
+++ b/db/migrate/20160425045124_create_u2f_registrations.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateU2fRegistrations < ActiveRecord::Migration
+class CreateU2fRegistrations < ActiveRecord::Migration[4.2]
   def change
     create_table :u2f_registrations do |t|
       t.text :certificate
diff --git a/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb b/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb
index facd33875ba1e..9a0d1a2d31655 100644
--- a/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb
+++ b/db/migrate/20160504091942_add_disabled_oauth_sign_in_sources_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddDisabledOauthSignInSourcesToApplicationSettings < ActiveRecord::Migration
+class AddDisabledOauthSignInSourcesToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :disabled_oauth_sign_in_sources, :text
   end
diff --git a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
index 84e5e4eabe276..03ec29b9951d3 100644
--- a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
+++ b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
@@ -1,4 +1,4 @@
-class AddRunUntaggedToCiRunner < ActiveRecord::Migration
+class AddRunUntaggedToCiRunner < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160508194200_remove_wall_enabled_from_projects.rb b/db/migrate/20160508194200_remove_wall_enabled_from_projects.rb
index 6792ffc957abd..4edbeb09f7432 100644
--- a/db/migrate/20160508194200_remove_wall_enabled_from_projects.rb
+++ b/db/migrate/20160508194200_remove_wall_enabled_from_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class RemoveWallEnabledFromProjects < ActiveRecord::Migration
+class RemoveWallEnabledFromProjects < ActiveRecord::Migration[4.2]
   def change
     remove_column :projects, :wall_enabled, :boolean, default: true, null: false
   end
diff --git a/db/migrate/20160508202603_add_head_commit_id_to_merge_request_diffs.rb b/db/migrate/20160508202603_add_head_commit_id_to_merge_request_diffs.rb
index 1c4d60e7234fa..ee7c9326bfeac 100644
--- a/db/migrate/20160508202603_add_head_commit_id_to_merge_request_diffs.rb
+++ b/db/migrate/20160508202603_add_head_commit_id_to_merge_request_diffs.rb
@@ -1,4 +1,4 @@
-class AddHeadCommitIdToMergeRequestDiffs < ActiveRecord::Migration
+class AddHeadCommitIdToMergeRequestDiffs < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_request_diffs, :head_commit_sha, :string
   end
diff --git a/db/migrate/20160508215820_add_type_to_notes.rb b/db/migrate/20160508215820_add_type_to_notes.rb
index 58944d4e651c4..343743a589c95 100644
--- a/db/migrate/20160508215820_add_type_to_notes.rb
+++ b/db/migrate/20160508215820_add_type_to_notes.rb
@@ -1,4 +1,4 @@
-class AddTypeToNotes < ActiveRecord::Migration
+class AddTypeToNotes < ActiveRecord::Migration[4.2]
   def change
     add_column :notes, :type, :string
   end
diff --git a/db/migrate/20160508215920_add_positions_to_diff_notes.rb b/db/migrate/20160508215920_add_positions_to_diff_notes.rb
index 2952c25004ea6..e0ee03d0fb512 100644
--- a/db/migrate/20160508215920_add_positions_to_diff_notes.rb
+++ b/db/migrate/20160508215920_add_positions_to_diff_notes.rb
@@ -1,4 +1,4 @@
-class AddPositionsToDiffNotes < ActiveRecord::Migration
+class AddPositionsToDiffNotes < ActiveRecord::Migration[4.2]
   def change
     add_column :notes, :position, :text
     add_column :notes, :original_position, :text
diff --git a/db/migrate/20160508221410_set_type_on_legacy_diff_notes.rb b/db/migrate/20160508221410_set_type_on_legacy_diff_notes.rb
index 6dd958ff4a074..567754d4f4ed0 100644
--- a/db/migrate/20160508221410_set_type_on_legacy_diff_notes.rb
+++ b/db/migrate/20160508221410_set_type_on_legacy_diff_notes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class SetTypeOnLegacyDiffNotes < ActiveRecord::Migration
+class SetTypeOnLegacyDiffNotes < ActiveRecord::Migration[4.2]
   def change
     execute "UPDATE notes SET type = 'LegacyDiffNote' WHERE line_code IS NOT NULL"
   end
diff --git a/db/migrate/20160509091049_add_locked_to_ci_runner.rb b/db/migrate/20160509091049_add_locked_to_ci_runner.rb
index 3fbaef3b7f0ae..e19db5a4504d2 100644
--- a/db/migrate/20160509091049_add_locked_to_ci_runner.rb
+++ b/db/migrate/20160509091049_add_locked_to_ci_runner.rb
@@ -1,4 +1,4 @@
-class AddLockedToCiRunner < ActiveRecord::Migration
+class AddLockedToCiRunner < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb b/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb
index 9d729fec18987..54d615f7e21c9 100644
--- a/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb
+++ b/db/migrate/20160509201028_add_health_check_access_token_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddHealthCheckAccessTokenToApplicationSettings < ActiveRecord::Migration
+class AddHealthCheckAccessTokenToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :health_check_access_token, :string
   end
diff --git a/db/migrate/20160516174813_add_send_user_confirmation_email_to_application_settings.rb b/db/migrate/20160516174813_add_send_user_confirmation_email_to_application_settings.rb
index 8c96353b850e0..9e203b97a4311 100644
--- a/db/migrate/20160516174813_add_send_user_confirmation_email_to_application_settings.rb
+++ b/db/migrate/20160516174813_add_send_user_confirmation_email_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddSendUserConfirmationEmailToApplicationSettings < ActiveRecord::Migration
+class AddSendUserConfirmationEmailToApplicationSettings < ActiveRecord::Migration[4.2]
   def up
     add_column :application_settings, :send_user_confirmation_email, :boolean, default: false
 
diff --git a/db/migrate/20160516224534_add_start_commit_id_to_merge_request_diffs.rb b/db/migrate/20160516224534_add_start_commit_id_to_merge_request_diffs.rb
index b7fd76ee84ba9..a84bfd64bdaf7 100644
--- a/db/migrate/20160516224534_add_start_commit_id_to_merge_request_diffs.rb
+++ b/db/migrate/20160516224534_add_start_commit_id_to_merge_request_diffs.rb
@@ -1,4 +1,4 @@
-class AddStartCommitIdToMergeRequestDiffs < ActiveRecord::Migration
+class AddStartCommitIdToMergeRequestDiffs < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_request_diffs, :start_commit_sha, :string
   end
diff --git a/db/migrate/20160518200441_add_artifacts_expire_date_to_ci_builds.rb b/db/migrate/20160518200441_add_artifacts_expire_date_to_ci_builds.rb
index 8e9ab3f8accee..143b84a1662a8 100644
--- a/db/migrate/20160518200441_add_artifacts_expire_date_to_ci_builds.rb
+++ b/db/migrate/20160518200441_add_artifacts_expire_date_to_ci_builds.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddArtifactsExpireDateToCiBuilds < ActiveRecord::Migration
+class AddArtifactsExpireDateToCiBuilds < ActiveRecord::Migration[4.2]
   def change
     add_column :ci_builds, :artifacts_expire_at, :timestamp
   end
diff --git a/db/migrate/20160519203051_add_developers_can_merge_to_protected_branches.rb b/db/migrate/20160519203051_add_developers_can_merge_to_protected_branches.rb
index ac50035eba41e..ba0e165437968 100644
--- a/db/migrate/20160519203051_add_developers_can_merge_to_protected_branches.rb
+++ b/db/migrate/20160519203051_add_developers_can_merge_to_protected_branches.rb
@@ -1,4 +1,4 @@
-class AddDevelopersCanMergeToProtectedBranches < ActiveRecord::Migration
+class AddDevelopersCanMergeToProtectedBranches < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160522215720_add_note_type_and_position_to_sent_notification.rb b/db/migrate/20160522215720_add_note_type_and_position_to_sent_notification.rb
index 4eef16c940823..f569fc7c73f9f 100644
--- a/db/migrate/20160522215720_add_note_type_and_position_to_sent_notification.rb
+++ b/db/migrate/20160522215720_add_note_type_and_position_to_sent_notification.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddNoteTypeAndPositionToSentNotification < ActiveRecord::Migration
+class AddNoteTypeAndPositionToSentNotification < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/db/migrate/20160525205328_remove_main_language_from_projects.rb b/db/migrate/20160525205328_remove_main_language_from_projects.rb
index dc4ceacddb1b3..81d0fb5b08063 100644
--- a/db/migrate/20160525205328_remove_main_language_from_projects.rb
+++ b/db/migrate/20160525205328_remove_main_language_from_projects.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveMainLanguageFromProjects < ActiveRecord::Migration
+class RemoveMainLanguageFromProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb b/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb
index 7910120b4e06c..c530c09859d40 100644
--- a/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb
+++ b/db/migrate/20160527020117_remove_notification_settings_for_deleted_projects.rb
@@ -1,4 +1,4 @@
-class RemoveNotificationSettingsForDeletedProjects < ActiveRecord::Migration
+class RemoveNotificationSettingsForDeletedProjects < ActiveRecord::Migration[4.2]
   def up
     execute <<-SQL
       DELETE FROM notification_settings
diff --git a/db/migrate/20160528043124_add_users_state_index.rb b/db/migrate/20160528043124_add_users_state_index.rb
index 6419d2ae71d82..3437b35a0c066 100644
--- a/db/migrate/20160528043124_add_users_state_index.rb
+++ b/db/migrate/20160528043124_add_users_state_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddUsersStateIndex < ActiveRecord::Migration
+class AddUsersStateIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb b/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb
index e21376bd57193..7b20146e21caa 100644
--- a/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb
+++ b/db/migrate/20160530150109_add_container_registry_token_expire_delay_to_application_settings.rb
@@ -1,6 +1,6 @@
 # This is ONLINE migration
 
-class AddContainerRegistryTokenExpireDelayToApplicationSettings < ActiveRecord::Migration
+class AddContainerRegistryTokenExpireDelayToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160603075128_add_has_external_issue_tracker_to_projects.rb b/db/migrate/20160603075128_add_has_external_issue_tracker_to_projects.rb
index be295f0181d34..a7d2d7f99528c 100644
--- a/db/migrate/20160603075128_add_has_external_issue_tracker_to_projects.rb
+++ b/db/migrate/20160603075128_add_has_external_issue_tracker_to_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddHasExternalIssueTrackerToProjects < ActiveRecord::Migration
+class AddHasExternalIssueTrackerToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160603180330_remove_duplicated_notification_settings.rb b/db/migrate/20160603180330_remove_duplicated_notification_settings.rb
index fe1c863b5b954..0d8c4bf011cd2 100644
--- a/db/migrate/20160603180330_remove_duplicated_notification_settings.rb
+++ b/db/migrate/20160603180330_remove_duplicated_notification_settings.rb
@@ -1,4 +1,4 @@
-class RemoveDuplicatedNotificationSettings < ActiveRecord::Migration
+class RemoveDuplicatedNotificationSettings < ActiveRecord::Migration[4.2]
   def up
     duplicates = exec_query(%Q{
       SELECT user_id, source_type, source_id
diff --git a/db/migrate/20160603182247_add_index_to_notification_settings.rb b/db/migrate/20160603182247_add_index_to_notification_settings.rb
index f6ae26d555f44..cea178d555c91 100644
--- a/db/migrate/20160603182247_add_index_to_notification_settings.rb
+++ b/db/migrate/20160603182247_add_index_to_notification_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIndexToNotificationSettings < ActiveRecord::Migration
+class AddIndexToNotificationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb b/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb
index 89826fb96cb14..3b3f68529a5ce 100644
--- a/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb
+++ b/db/migrate/20160608155312_add_after_sign_up_text_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddAfterSignUpTextToApplicationSettings < ActiveRecord::Migration
+class AddAfterSignUpTextToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :after_sign_up_text, :text
   end
diff --git a/db/migrate/20160608195742_add_repository_storage_to_projects.rb b/db/migrate/20160608195742_add_repository_storage_to_projects.rb
index e4febd1614d71..2b20c9fbd5fc5 100644
--- a/db/migrate/20160608195742_add_repository_storage_to_projects.rb
+++ b/db/migrate/20160608195742_add_repository_storage_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddRepositoryStorageToProjects < ActiveRecord::Migration
+class AddRepositoryStorageToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160608211215_add_user_default_external_to_application_settings.rb b/db/migrate/20160608211215_add_user_default_external_to_application_settings.rb
index 34c702e3fa62c..9b5cfc67d5aef 100644
--- a/db/migrate/20160608211215_add_user_default_external_to_application_settings.rb
+++ b/db/migrate/20160608211215_add_user_default_external_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddUserDefaultExternalToApplicationSettings < ActiveRecord::Migration
+class AddUserDefaultExternalToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160610140403_remove_notification_setting_not_null_constraints.rb b/db/migrate/20160610140403_remove_notification_setting_not_null_constraints.rb
index 259abb08e4742..d5301672dc58f 100644
--- a/db/migrate/20160610140403_remove_notification_setting_not_null_constraints.rb
+++ b/db/migrate/20160610140403_remove_notification_setting_not_null_constraints.rb
@@ -1,4 +1,4 @@
-class RemoveNotificationSettingNotNullConstraints < ActiveRecord::Migration
+class RemoveNotificationSettingNotNullConstraints < ActiveRecord::Migration[4.2]
   def up
     change_column :notification_settings, :source_type, :string, null: true
     change_column :notification_settings, :source_id, :integer, null: true
diff --git a/db/migrate/20160610194713_remove_deprecated_issues_tracker_columns_from_projects.rb b/db/migrate/20160610194713_remove_deprecated_issues_tracker_columns_from_projects.rb
index 21b367711c3ab..1ac659974038e 100644
--- a/db/migrate/20160610194713_remove_deprecated_issues_tracker_columns_from_projects.rb
+++ b/db/migrate/20160610194713_remove_deprecated_issues_tracker_columns_from_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveDeprecatedIssuesTrackerColumnsFromProjects < ActiveRecord::Migration
+class RemoveDeprecatedIssuesTrackerColumnsFromProjects < ActiveRecord::Migration[4.2]
   def change
     remove_column :projects, :issues_tracker, :string, default: 'gitlab', null: false
     remove_column :projects, :issues_tracker_id, :string
diff --git a/db/migrate/20160610201627_migrate_users_notification_level.rb b/db/migrate/20160610201627_migrate_users_notification_level.rb
index cd8b505de9f94..553b7f074f277 100644
--- a/db/migrate/20160610201627_migrate_users_notification_level.rb
+++ b/db/migrate/20160610201627_migrate_users_notification_level.rb
@@ -1,4 +1,4 @@
-class MigrateUsersNotificationLevel < ActiveRecord::Migration
+class MigrateUsersNotificationLevel < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   # Migrates only users who changed their default notification level :participating
diff --git a/db/migrate/20160610204157_add_deployments.rb b/db/migrate/20160610204157_add_deployments.rb
index 0ee0b1f5a86c4..91b619e7d3dd3 100644
--- a/db/migrate/20160610204157_add_deployments.rb
+++ b/db/migrate/20160610204157_add_deployments.rb
@@ -1,6 +1,6 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
-class AddDeployments < ActiveRecord::Migration
+class AddDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160610204158_add_environments.rb b/db/migrate/20160610204158_add_environments.rb
index 534a73a5fb6b6..55fb8b1227b02 100644
--- a/db/migrate/20160610204158_add_environments.rb
+++ b/db/migrate/20160610204158_add_environments.rb
@@ -1,6 +1,6 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
-class AddEnvironments < ActiveRecord::Migration
+class AddEnvironments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160610211845_add_environment_to_builds.rb b/db/migrate/20160610211845_add_environment_to_builds.rb
index 990e445ac55b0..16d5465cafa54 100644
--- a/db/migrate/20160610211845_add_environment_to_builds.rb
+++ b/db/migrate/20160610211845_add_environment_to_builds.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEnvironmentToBuilds < ActiveRecord::Migration
+class AddEnvironmentToBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160610301627_remove_notification_level_from_users.rb b/db/migrate/20160610301627_remove_notification_level_from_users.rb
index 356e53b4b23bd..93f70c476d2d2 100644
--- a/db/migrate/20160610301627_remove_notification_level_from_users.rb
+++ b/db/migrate/20160610301627_remove_notification_level_from_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveNotificationLevelFromUsers < ActiveRecord::Migration
+class RemoveNotificationLevelFromUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160614182521_add_repository_storage_to_application_settings.rb b/db/migrate/20160614182521_add_repository_storage_to_application_settings.rb
index 6dae91b700b86..a1bc0e5cd86b9 100644
--- a/db/migrate/20160614182521_add_repository_storage_to_application_settings.rb
+++ b/db/migrate/20160614182521_add_repository_storage_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRepositoryStorageToApplicationSettings < ActiveRecord::Migration
+class AddRepositoryStorageToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :repository_storage, :string, default: 'default'
   end
diff --git a/db/migrate/20160615142710_add_index_on_requested_at_to_members.rb b/db/migrate/20160615142710_add_index_on_requested_at_to_members.rb
index 178e4bf5ed376..1b1dab141f81d 100644
--- a/db/migrate/20160615142710_add_index_on_requested_at_to_members.rb
+++ b/db/migrate/20160615142710_add_index_on_requested_at_to_members.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexOnRequestedAtToMembers < ActiveRecord::Migration
+class AddIndexOnRequestedAtToMembers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb b/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
index d0e6d8d1ea15b..deb4b86a2fdf2 100644
--- a/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
+++ b/db/migrate/20160615173316_add_enabled_git_access_protocols_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migration
+class AddEnabledGitAccessProtocolsToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb b/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb
index c58cb957df405..11d15e7c15fe4 100644
--- a/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb
+++ b/db/migrate/20160615191922_set_missing_stage_on_ci_builds.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/UpdateColumnInBatches
-class SetMissingStageOnCiBuilds < ActiveRecord::Migration
+class SetMissingStageOnCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20160616084004_change_project_of_environment.rb b/db/migrate/20160616084004_change_project_of_environment.rb
index cc1daf9b621c1..23914a0325ae1 100644
--- a/db/migrate/20160616084004_change_project_of_environment.rb
+++ b/db/migrate/20160616084004_change_project_of_environment.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ChangeProjectOfEnvironment < ActiveRecord::Migration
+class ChangeProjectOfEnvironment < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/db/migrate/20160616102642_remove_duplicated_keys.rb b/db/migrate/20160616102642_remove_duplicated_keys.rb
index 5e41cc53e3243..0b896108292ee 100644
--- a/db/migrate/20160616102642_remove_duplicated_keys.rb
+++ b/db/migrate/20160616102642_remove_duplicated_keys.rb
@@ -1,4 +1,4 @@
-class RemoveDuplicatedKeys < ActiveRecord::Migration
+class RemoveDuplicatedKeys < ActiveRecord::Migration[4.2]
   def up
     select_all("SELECT fingerprint FROM #{quote_table_name(:keys)} GROUP BY fingerprint HAVING COUNT(*) > 1").each do |row|
       fingerprint = connection.quote(row['fingerprint'])
diff --git a/db/migrate/20160616103005_remove_keys_fingerprint_index_if_exists.rb b/db/migrate/20160616103005_remove_keys_fingerprint_index_if_exists.rb
index 081df23f394dd..afccc40cc673d 100644
--- a/db/migrate/20160616103005_remove_keys_fingerprint_index_if_exists.rb
+++ b/db/migrate/20160616103005_remove_keys_fingerprint_index_if_exists.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class RemoveKeysFingerprintIndexIfExists < ActiveRecord::Migration
+class RemoveKeysFingerprintIndexIfExists < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20160616103948_add_unique_index_to_keys_fingerprint.rb b/db/migrate/20160616103948_add_unique_index_to_keys_fingerprint.rb
index 76bb6a096391f..d619acad3d096 100644
--- a/db/migrate/20160616103948_add_unique_index_to_keys_fingerprint.rb
+++ b/db/migrate/20160616103948_add_unique_index_to_keys_fingerprint.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddUniqueIndexToKeysFingerprint < ActiveRecord::Migration
+class AddUniqueIndexToKeysFingerprint < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20160617301627_add_events_to_notification_settings.rb b/db/migrate/20160617301627_add_events_to_notification_settings.rb
index 609596f45e455..109817e3d8abb 100644
--- a/db/migrate/20160617301627_add_events_to_notification_settings.rb
+++ b/db/migrate/20160617301627_add_events_to_notification_settings.rb
@@ -1,4 +1,4 @@
-class AddEventsToNotificationSettings < ActiveRecord::Migration
+class AddEventsToNotificationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160620115026_add_index_on_runners_locked.rb b/db/migrate/20160620115026_add_index_on_runners_locked.rb
index 48f4495b0a47e..c619dc07a916d 100644
--- a/db/migrate/20160620115026_add_index_on_runners_locked.rb
+++ b/db/migrate/20160620115026_add_index_on_runners_locked.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIndexOnRunnersLocked < ActiveRecord::Migration
+class AddIndexOnRunnersLocked < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160621123729_add_rebase_commit_sha_to_merge_requests.rb b/db/migrate/20160621123729_add_rebase_commit_sha_to_merge_requests.rb
index 1222dc640a8a1..2d3ab4e258340 100644
--- a/db/migrate/20160621123729_add_rebase_commit_sha_to_merge_requests.rb
+++ b/db/migrate/20160621123729_add_rebase_commit_sha_to_merge_requests.rb
@@ -5,7 +5,7 @@
 # into EE.
 #
 # See discussion at https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3932
-class AddRebaseCommitShaToMergeRequests < ActiveRecord::Migration
+class AddRebaseCommitShaToMergeRequests < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20160628085157_add_artifacts_size_to_ci_builds.rb b/db/migrate/20160628085157_add_artifacts_size_to_ci_builds.rb
index 61dd726fac7bc..60bd4c36eb6b1 100644
--- a/db/migrate/20160628085157_add_artifacts_size_to_ci_builds.rb
+++ b/db/migrate/20160628085157_add_artifacts_size_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddArtifactsSizeToCiBuilds < ActiveRecord::Migration
+class AddArtifactsSizeToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160629025435_add_column_in_progress_merge_commit_sha_to_merge_requests.rb b/db/migrate/20160629025435_add_column_in_progress_merge_commit_sha_to_merge_requests.rb
index 7c5f76572ef80..13e1280b71af6 100644
--- a/db/migrate/20160629025435_add_column_in_progress_merge_commit_sha_to_merge_requests.rb
+++ b/db/migrate/20160629025435_add_column_in_progress_merge_commit_sha_to_merge_requests.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddColumnInProgressMergeCommitShaToMergeRequests < ActiveRecord::Migration
+class AddColumnInProgressMergeCommitShaToMergeRequests < ActiveRecord::Migration[4.2]
   def change
     add_column :merge_requests, :in_progress_merge_commit_sha, :string
   end
diff --git a/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb b/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb
index 0c25f87dfb4b0..8a576b99de0fd 100644
--- a/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb
+++ b/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb
@@ -1,7 +1,7 @@
 # rubocop:disable all
 # Migration type: online without errors
 
-class AddIndexOnAwardEmojiUserAndName < ActiveRecord::Migration
+class AddIndexOnAwardEmojiUserAndName < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160705054938_add_protected_branches_push_access.rb b/db/migrate/20160705054938_add_protected_branches_push_access.rb
index de3aefcb1fb39..314d90efa908d 100644
--- a/db/migrate/20160705054938_add_protected_branches_push_access.rb
+++ b/db/migrate/20160705054938_add_protected_branches_push_access.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/Timestamps
-class AddProtectedBranchesPushAccess < ActiveRecord::Migration
+class AddProtectedBranchesPushAccess < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160705054952_add_protected_branches_merge_access.rb b/db/migrate/20160705054952_add_protected_branches_merge_access.rb
index 9b18a2061b329..672e0e291dbb5 100644
--- a/db/migrate/20160705054952_add_protected_branches_merge_access.rb
+++ b/db/migrate/20160705054952_add_protected_branches_merge_access.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/Timestamps
-class AddProtectedBranchesMergeAccess < ActiveRecord::Migration
+class AddProtectedBranchesMergeAccess < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb b/db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb
index 1db0df92becc3..1bd462cab064f 100644
--- a/db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb
+++ b/db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MoveFromDevelopersCanMergeToProtectedBranchesMergeAccess < ActiveRecord::Migration
+class MoveFromDevelopersCanMergeToProtectedBranchesMergeAccess < ActiveRecord::Migration[4.2]
   DOWNTIME = true
   DOWNTIME_REASON = <<-HEREDOC
     We're creating a `merge_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
diff --git a/db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb b/db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb
index 5c3e189bb5ba0..d480dac777a00 100644
--- a/db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb
+++ b/db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MoveFromDevelopersCanPushToProtectedBranchesPushAccess < ActiveRecord::Migration
+class MoveFromDevelopersCanPushToProtectedBranchesPushAccess < ActiveRecord::Migration[4.2]
   DOWNTIME = true
   DOWNTIME_REASON = <<-HEREDOC
     We're creating a `push_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
diff --git a/db/migrate/20160705055809_remove_developers_can_push_from_protected_branches.rb b/db/migrate/20160705055809_remove_developers_can_push_from_protected_branches.rb
index 058bd539e65c8..e5c9da072cf31 100644
--- a/db/migrate/20160705055809_remove_developers_can_push_from_protected_branches.rb
+++ b/db/migrate/20160705055809_remove_developers_can_push_from_protected_branches.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveDevelopersCanPushFromProtectedBranches < ActiveRecord::Migration
+class RemoveDevelopersCanPushFromProtectedBranches < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # This is only required for `#down`
diff --git a/db/migrate/20160705055813_remove_developers_can_merge_from_protected_branches.rb b/db/migrate/20160705055813_remove_developers_can_merge_from_protected_branches.rb
index d0e5da4d28b77..2a623b558390f 100644
--- a/db/migrate/20160705055813_remove_developers_can_merge_from_protected_branches.rb
+++ b/db/migrate/20160705055813_remove_developers_can_merge_from_protected_branches.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveDevelopersCanMergeFromProtectedBranches < ActiveRecord::Migration
+class RemoveDevelopersCanMergeFromProtectedBranches < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # This is only required for `#down`
diff --git a/db/migrate/20160705163108_remove_requesters_that_are_owners.rb b/db/migrate/20160705163108_remove_requesters_that_are_owners.rb
index 1fca230c01949..449c67e1b6abc 100644
--- a/db/migrate/20160705163108_remove_requesters_that_are_owners.rb
+++ b/db/migrate/20160705163108_remove_requesters_that_are_owners.rb
@@ -1,4 +1,4 @@
-class RemoveRequestersThatAreOwners < ActiveRecord::Migration
+class RemoveRequestersThatAreOwners < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/db/migrate/20160707104333_add_lock_to_issuables.rb b/db/migrate/20160707104333_add_lock_to_issuables.rb
index 54866d02cbc46..fdc3abf46ccbe 100644
--- a/db/migrate/20160707104333_add_lock_to_issuables.rb
+++ b/db/migrate/20160707104333_add_lock_to_issuables.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLockToIssuables < ActiveRecord::Migration
+class AddLockToIssuables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160712171823_remove_award_emojis_with_no_user.rb b/db/migrate/20160712171823_remove_award_emojis_with_no_user.rb
index 8ebf1a5234dc0..0b553182a81b5 100644
--- a/db/migrate/20160712171823_remove_award_emojis_with_no_user.rb
+++ b/db/migrate/20160712171823_remove_award_emojis_with_no_user.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveAwardEmojisWithNoUser < ActiveRecord::Migration
+class RemoveAwardEmojisWithNoUser < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/db/migrate/20160713200638_add_repository_read_only_to_projects.rb b/db/migrate/20160713200638_add_repository_read_only_to_projects.rb
index 8ee8b55f210d6..ba61bc8cbb041 100644
--- a/db/migrate/20160713200638_add_repository_read_only_to_projects.rb
+++ b/db/migrate/20160713200638_add_repository_read_only_to_projects.rb
@@ -1,4 +1,4 @@
-class AddRepositoryReadOnlyToProjects < ActiveRecord::Migration
+class AddRepositoryReadOnlyToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160713205315_add_domain_blacklist_to_application_settings.rb b/db/migrate/20160713205315_add_domain_blacklist_to_application_settings.rb
index f64dfa7675fbf..4b9ac12253ea2 100644
--- a/db/migrate/20160713205315_add_domain_blacklist_to_application_settings.rb
+++ b/db/migrate/20160713205315_add_domain_blacklist_to_application_settings.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/SaferBooleanColumn
-class AddDomainBlacklistToApplicationSettings < ActiveRecord::Migration
+class AddDomainBlacklistToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/db/migrate/20160713222618_add_usage_ping_to_application_settings.rb b/db/migrate/20160713222618_add_usage_ping_to_application_settings.rb
index a7f76cc626eaf..7ef0231633812 100644
--- a/db/migrate/20160713222618_add_usage_ping_to_application_settings.rb
+++ b/db/migrate/20160713222618_add_usage_ping_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddUsagePingToApplicationSettings < ActiveRecord::Migration
+class AddUsagePingToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160715132507_add_user_id_to_pipeline.rb b/db/migrate/20160715132507_add_user_id_to_pipeline.rb
index af0461c4daf9e..b1e22b1c2bb39 100644
--- a/db/migrate/20160715132507_add_user_id_to_pipeline.rb
+++ b/db/migrate/20160715132507_add_user_id_to_pipeline.rb
@@ -1,4 +1,4 @@
-class AddUserIdToPipeline < ActiveRecord::Migration
+class AddUserIdToPipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb b/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb
index fec17ffb7f6c2..8e7ac86a8b75f 100644
--- a/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb
+++ b/db/migrate/20160715134306_add_index_for_pipeline_user_id.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexForPipelineUserId < ActiveRecord::Migration
+class AddIndexForPipelineUserId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160715154212_add_request_access_enabled_to_projects.rb b/db/migrate/20160715154212_add_request_access_enabled_to_projects.rb
index 22c925799a397..96260f5fd554f 100644
--- a/db/migrate/20160715154212_add_request_access_enabled_to_projects.rb
+++ b/db/migrate/20160715154212_add_request_access_enabled_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddRequestAccessEnabledToProjects < ActiveRecord::Migration
+class AddRequestAccessEnabledToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160715204316_add_request_access_enabled_to_groups.rb b/db/migrate/20160715204316_add_request_access_enabled_to_groups.rb
index 4fcb29e1325e6..14065434523e1 100644
--- a/db/migrate/20160715204316_add_request_access_enabled_to_groups.rb
+++ b/db/migrate/20160715204316_add_request_access_enabled_to_groups.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddRequestAccessEnabledToGroups < ActiveRecord::Migration
+class AddRequestAccessEnabledToGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160715230841_rename_application_settings_restricted_signup_domains.rb b/db/migrate/20160715230841_rename_application_settings_restricted_signup_domains.rb
index dd15704800a58..6a2674fb60466 100644
--- a/db/migrate/20160715230841_rename_application_settings_restricted_signup_domains.rb
+++ b/db/migrate/20160715230841_rename_application_settings_restricted_signup_domains.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameApplicationSettingsRestrictedSignupDomains < ActiveRecord::Migration
+class RenameApplicationSettingsRestrictedSignupDomains < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/db/migrate/20160716115710_add_when_and_yaml_variables_to_ci_builds.rb b/db/migrate/20160716115710_add_when_and_yaml_variables_to_ci_builds.rb
index 3e084023a6503..d403b0a3cc9a1 100644
--- a/db/migrate/20160716115710_add_when_and_yaml_variables_to_ci_builds.rb
+++ b/db/migrate/20160716115710_add_when_and_yaml_variables_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddWhenAndYamlVariablesToCiBuilds < ActiveRecord::Migration
+class AddWhenAndYamlVariablesToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160716115711_add_queued_at_to_ci_builds.rb b/db/migrate/20160716115711_add_queued_at_to_ci_builds.rb
index fd7a48d881e51..2bb9a30e3a3d2 100644
--- a/db/migrate/20160716115711_add_queued_at_to_ci_builds.rb
+++ b/db/migrate/20160716115711_add_queued_at_to_ci_builds.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddQueuedAtToCiBuilds < ActiveRecord::Migration
+class AddQueuedAtToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb b/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb
index 55a3e954292d8..e3e4afaf512bc 100644
--- a/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb
+++ b/db/migrate/20160718153603_add_has_external_wiki_to_projects.rb
@@ -1,4 +1,4 @@
-class AddHasExternalWikiToProjects < ActiveRecord::Migration
+class AddHasExternalWikiToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb b/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb
index 58f7f2a284171..d31bbb223923d 100644
--- a/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb
+++ b/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/UpdateColumnInBatches
-class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration
+class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160722221922_nullify_blank_type_on_notes.rb b/db/migrate/20160722221922_nullify_blank_type_on_notes.rb
index c4b78e8e15cf5..83ca5c1e6ec8a 100644
--- a/db/migrate/20160722221922_nullify_blank_type_on_notes.rb
+++ b/db/migrate/20160722221922_nullify_blank_type_on_notes.rb
@@ -1,4 +1,4 @@
-class NullifyBlankTypeOnNotes < ActiveRecord::Migration
+class NullifyBlankTypeOnNotes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160724205507_add_resolved_to_notes.rb b/db/migrate/20160724205507_add_resolved_to_notes.rb
index 3aca272a3f7bc..fc56d3b145247 100644
--- a/db/migrate/20160724205507_add_resolved_to_notes.rb
+++ b/db/migrate/20160724205507_add_resolved_to_notes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddResolvedToNotes < ActiveRecord::Migration
+class AddResolvedToNotes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160725083350_add_external_url_to_enviroments.rb b/db/migrate/20160725083350_add_external_url_to_enviroments.rb
index 21a8abd310b21..e060c6a849954 100644
--- a/db/migrate/20160725083350_add_external_url_to_enviroments.rb
+++ b/db/migrate/20160725083350_add_external_url_to_enviroments.rb
@@ -1,4 +1,4 @@
-class AddExternalUrlToEnviroments < ActiveRecord::Migration
+class AddExternalUrlToEnviroments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160725104020_merge_request_diff_remove_uniq.rb b/db/migrate/20160725104020_merge_request_diff_remove_uniq.rb
index 12e11bc3fbe45..d8b4696a246ea 100644
--- a/db/migrate/20160725104020_merge_request_diff_remove_uniq.rb
+++ b/db/migrate/20160725104020_merge_request_diff_remove_uniq.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class MergeRequestDiffRemoveUniq < ActiveRecord::Migration
+class MergeRequestDiffRemoveUniq < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160725104452_merge_request_diff_add_index.rb b/db/migrate/20160725104452_merge_request_diff_add_index.rb
index 60d81e0bdc079..d3369b3f9610e 100644
--- a/db/migrate/20160725104452_merge_request_diff_add_index.rb
+++ b/db/migrate/20160725104452_merge_request_diff_add_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class MergeRequestDiffAddIndex < ActiveRecord::Migration
+class MergeRequestDiffAddIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160727163552_create_user_agent_details.rb b/db/migrate/20160727163552_create_user_agent_details.rb
index 3eb36f8464f82..6ef54deca9005 100644
--- a/db/migrate/20160727163552_create_user_agent_details.rb
+++ b/db/migrate/20160727163552_create_user_agent_details.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateUserAgentDetails < ActiveRecord::Migration
+class CreateUserAgentDetails < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160727191041_create_boards.rb b/db/migrate/20160727191041_create_boards.rb
index 9ec8df1b8e8ca..60ed5508b106d 100644
--- a/db/migrate/20160727191041_create_boards.rb
+++ b/db/migrate/20160727191041_create_boards.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateBoards < ActiveRecord::Migration
+class CreateBoards < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160727193336_create_lists.rb b/db/migrate/20160727193336_create_lists.rb
index 3fd95dc8cfc41..4591c9a120f9a 100644
--- a/db/migrate/20160727193336_create_lists.rb
+++ b/db/migrate/20160727193336_create_lists.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateLists < ActiveRecord::Migration
+class CreateLists < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160728081025_add_pipeline_events_to_web_hooks.rb b/db/migrate/20160728081025_add_pipeline_events_to_web_hooks.rb
index b800e6d7283c5..fc3e9f03c744f 100644
--- a/db/migrate/20160728081025_add_pipeline_events_to_web_hooks.rb
+++ b/db/migrate/20160728081025_add_pipeline_events_to_web_hooks.rb
@@ -1,4 +1,4 @@
-class AddPipelineEventsToWebHooks < ActiveRecord::Migration
+class AddPipelineEventsToWebHooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160728103734_add_pipeline_events_to_services.rb b/db/migrate/20160728103734_add_pipeline_events_to_services.rb
index bcd24fe1566b3..421859ff5fd2a 100644
--- a/db/migrate/20160728103734_add_pipeline_events_to_services.rb
+++ b/db/migrate/20160728103734_add_pipeline_events_to_services.rb
@@ -1,4 +1,4 @@
-class AddPipelineEventsToServices < ActiveRecord::Migration
+class AddPipelineEventsToServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160729173930_remove_project_id_from_spam_logs.rb b/db/migrate/20160729173930_remove_project_id_from_spam_logs.rb
index baf254c3bcc4a..02e417e376fde 100644
--- a/db/migrate/20160729173930_remove_project_id_from_spam_logs.rb
+++ b/db/migrate/20160729173930_remove_project_id_from_spam_logs.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveProjectIdFromSpamLogs < ActiveRecord::Migration
+class RemoveProjectIdFromSpamLogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160801163421_add_expires_at_to_member.rb b/db/migrate/20160801163421_add_expires_at_to_member.rb
index 8db0fc60c4b68..13ca1d04658c3 100644
--- a/db/migrate/20160801163421_add_expires_at_to_member.rb
+++ b/db/migrate/20160801163421_add_expires_at_to_member.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddExpiresAtToMember < ActiveRecord::Migration
+class AddExpiresAtToMember < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160801163709_add_submitted_as_ham_to_spam_logs.rb b/db/migrate/20160801163709_add_submitted_as_ham_to_spam_logs.rb
index 20a77000ba84d..fde9dee980e48 100644
--- a/db/migrate/20160801163709_add_submitted_as_ham_to_spam_logs.rb
+++ b/db/migrate/20160801163709_add_submitted_as_ham_to_spam_logs.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddSubmittedAsHamToSpamLogs < ActiveRecord::Migration
+class AddSubmittedAsHamToSpamLogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160802010328_remove_builds_enable_index_on_projects.rb b/db/migrate/20160802010328_remove_builds_enable_index_on_projects.rb
index 6d7733762c811..4ad740e081281 100644
--- a/db/migrate/20160802010328_remove_builds_enable_index_on_projects.rb
+++ b/db/migrate/20160802010328_remove_builds_enable_index_on_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class RemoveBuildsEnableIndexOnProjects < ActiveRecord::Migration
+class RemoveBuildsEnableIndexOnProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb b/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb
index 9c1511963f78c..f866fe15ec1d8 100644
--- a/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb
+++ b/db/migrate/20160803161903_add_unique_index_to_lists_label_id.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddUniqueIndexToListsLabelId < ActiveRecord::Migration
+class AddUniqueIndexToListsLabelId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160804142904_add_ci_config_file_to_project.rb b/db/migrate/20160804142904_add_ci_config_file_to_project.rb
index 341ae555c1b95..abd94e63db32b 100644
--- a/db/migrate/20160804142904_add_ci_config_file_to_project.rb
+++ b/db/migrate/20160804142904_add_ci_config_file_to_project.rb
@@ -1,4 +1,4 @@
-class AddCiConfigFileToProject < ActiveRecord::Migration
+class AddCiConfigFileToProject < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160804150737_add_timestamps_to_members_again.rb b/db/migrate/20160804150737_add_timestamps_to_members_again.rb
index 6691ba57fbb32..4e71197b8e724 100644
--- a/db/migrate/20160804150737_add_timestamps_to_members_again.rb
+++ b/db/migrate/20160804150737_add_timestamps_to_members_again.rb
@@ -6,7 +6,7 @@
 #
 # Why this happened is lost in the mists of time, so repeat the SQL query
 # without speculation, just in case more than one person was affected.
-class AddTimestampsToMembersAgain < ActiveRecord::Migration
+class AddTimestampsToMembersAgain < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20160805041956_add_deleted_at_to_namespaces.rb b/db/migrate/20160805041956_add_deleted_at_to_namespaces.rb
index 404c253e18bfa..a0dfa3259ec71 100644
--- a/db/migrate/20160805041956_add_deleted_at_to_namespaces.rb
+++ b/db/migrate/20160805041956_add_deleted_at_to_namespaces.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/Datetime
 # rubocop:disable RemoveIndex
-class AddDeletedAtToNamespaces < ActiveRecord::Migration
+class AddDeletedAtToNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160808085531_add_token_to_build.rb b/db/migrate/20160808085531_add_token_to_build.rb
index 3ed2a103ae3ca..a1d8945a53817 100644
--- a/db/migrate/20160808085531_add_token_to_build.rb
+++ b/db/migrate/20160808085531_add_token_to_build.rb
@@ -1,4 +1,4 @@
-class AddTokenToBuild < ActiveRecord::Migration
+class AddTokenToBuild < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160808085602_add_index_for_build_token.rb b/db/migrate/20160808085602_add_index_for_build_token.rb
index 0446b2f2e15ab..22d50e4165a5a 100644
--- a/db/migrate/20160808085602_add_index_for_build_token.rb
+++ b/db/migrate/20160808085602_add_index_for_build_token.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexForBuildToken < ActiveRecord::Migration
+class AddIndexForBuildToken < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160810102349_remove_ci_runner_trigram_indexes.rb b/db/migrate/20160810102349_remove_ci_runner_trigram_indexes.rb
index 0cfb637804bb5..738b93912b690 100644
--- a/db/migrate/20160810102349_remove_ci_runner_trigram_indexes.rb
+++ b/db/migrate/20160810102349_remove_ci_runner_trigram_indexes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveCiRunnerTrigramIndexes < ActiveRecord::Migration
+class RemoveCiRunnerTrigramIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160810142633_remove_redundant_indexes.rb b/db/migrate/20160810142633_remove_redundant_indexes.rb
index ea7d1f9a4369c..91f82cf9afabe 100644
--- a/db/migrate/20160810142633_remove_redundant_indexes.rb
+++ b/db/migrate/20160810142633_remove_redundant_indexes.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class RemoveRedundantIndexes < ActiveRecord::Migration
+class RemoveRedundantIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160811172945_add_can_push_to_keys.rb b/db/migrate/20160811172945_add_can_push_to_keys.rb
index 5fd303fe8fbdf..2e78ab0249ee8 100644
--- a/db/migrate/20160811172945_add_can_push_to_keys.rb
+++ b/db/migrate/20160811172945_add_can_push_to_keys.rb
@@ -1,4 +1,4 @@
-class AddCanPushToKeys < ActiveRecord::Migration
+class AddCanPushToKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160816161312_add_column_name_to_u2f_registrations.rb b/db/migrate/20160816161312_add_column_name_to_u2f_registrations.rb
index 7152bd04331a9..76b60787323c5 100644
--- a/db/migrate/20160816161312_add_column_name_to_u2f_registrations.rb
+++ b/db/migrate/20160816161312_add_column_name_to_u2f_registrations.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddColumnNameToU2fRegistrations < ActiveRecord::Migration
+class AddColumnNameToU2fRegistrations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160817133006_add_koding_to_application_settings.rb b/db/migrate/20160817133006_add_koding_to_application_settings.rb
index 46120652d8e2b..04f9d7be29b0d 100644
--- a/db/migrate/20160817133006_add_koding_to_application_settings.rb
+++ b/db/migrate/20160817133006_add_koding_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/SaferBooleanColumn
-class AddKodingToApplicationSettings < ActiveRecord::Migration
+class AddKodingToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160817154936_add_discussion_ids_to_notes.rb b/db/migrate/20160817154936_add_discussion_ids_to_notes.rb
index 61facce665a4e..e735eeadac55c 100644
--- a/db/migrate/20160817154936_add_discussion_ids_to_notes.rb
+++ b/db/migrate/20160817154936_add_discussion_ids_to_notes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddDiscussionIdsToNotes < ActiveRecord::Migration
+class AddDiscussionIdsToNotes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb b/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb
index 0ed538b0df830..06f621c6c2ee7 100644
--- a/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb
+++ b/db/migrate/20160818205718_add_expires_at_to_project_group_links.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddExpiresAtToProjectGroupLinks < ActiveRecord::Migration
+class AddExpiresAtToProjectGroupLinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160819221631_add_index_to_note_discussion_id.rb b/db/migrate/20160819221631_add_index_to_note_discussion_id.rb
index 843643c4e9533..1dbc0474fd2d3 100644
--- a/db/migrate/20160819221631_add_index_to_note_discussion_id.rb
+++ b/db/migrate/20160819221631_add_index_to_note_discussion_id.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIndexToNoteDiscussionId < ActiveRecord::Migration
+class AddIndexToNoteDiscussionId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb b/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb
index 0c68cf01900f6..61f593a52c576 100644
--- a/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb
+++ b/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ResetDiffNoteDiscussionIdBecauseItWasCalculatedWrongly < ActiveRecord::Migration
+class ResetDiffNoteDiscussionIdBecauseItWasCalculatedWrongly < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160819232256_add_incoming_email_token_to_users.rb b/db/migrate/20160819232256_add_incoming_email_token_to_users.rb
index a004a3802a250..0a7190f632d9e 100644
--- a/db/migrate/20160819232256_add_incoming_email_token_to_users.rb
+++ b/db/migrate/20160819232256_add_incoming_email_token_to_users.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIncomingEmailTokenToUsers < ActiveRecord::Migration
+class AddIncomingEmailTokenToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160823081327_change_merge_error_to_text.rb b/db/migrate/20160823081327_change_merge_error_to_text.rb
index 7920389cd83a1..23b4f35a776be 100644
--- a/db/migrate/20160823081327_change_merge_error_to_text.rb
+++ b/db/migrate/20160823081327_change_merge_error_to_text.rb
@@ -1,4 +1,4 @@
-class ChangeMergeErrorToText < ActiveRecord::Migration
+class ChangeMergeErrorToText < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20160823083941_add_column_scopes_to_personal_access_tokens.rb b/db/migrate/20160823083941_add_column_scopes_to_personal_access_tokens.rb
index 91479de840b77..4c320123088d0 100644
--- a/db/migrate/20160823083941_add_column_scopes_to_personal_access_tokens.rb
+++ b/db/migrate/20160823083941_add_column_scopes_to_personal_access_tokens.rb
@@ -2,7 +2,7 @@
 # It's easier to achieve this by adding the column with the `['api']` default, and then changing the default to
 # `[]`.
 
-class AddColumnScopesToPersonalAccessTokens < ActiveRecord::Migration
+class AddColumnScopesToPersonalAccessTokens < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160823213309_add_lfs_enabled_to_projects.rb b/db/migrate/20160823213309_add_lfs_enabled_to_projects.rb
index c169084e97697..87e6e8b69451d 100644
--- a/db/migrate/20160823213309_add_lfs_enabled_to_projects.rb
+++ b/db/migrate/20160823213309_add_lfs_enabled_to_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLfsEnabledToProjects < ActiveRecord::Migration
+class AddLfsEnabledToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160824103857_drop_unused_ci_tables.rb b/db/migrate/20160824103857_drop_unused_ci_tables.rb
index 65cf46308d95b..8a2076838483e 100644
--- a/db/migrate/20160824103857_drop_unused_ci_tables.rb
+++ b/db/migrate/20160824103857_drop_unused_ci_tables.rb
@@ -1,4 +1,4 @@
-class DropUnusedCiTables < ActiveRecord::Migration
+class DropUnusedCiTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160824124900_add_table_issue_metrics.rb b/db/migrate/20160824124900_add_table_issue_metrics.rb
index 49be8bc949b5b..4f34f377e22dd 100644
--- a/db/migrate/20160824124900_add_table_issue_metrics.rb
+++ b/db/migrate/20160824124900_add_table_issue_metrics.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 # rubocop:disable Migration/Timestamps
-class AddTableIssueMetrics < ActiveRecord::Migration
+class AddTableIssueMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160825052008_add_table_merge_request_metrics.rb b/db/migrate/20160825052008_add_table_merge_request_metrics.rb
index 3c9dcc0819040..150f698869d5d 100644
--- a/db/migrate/20160825052008_add_table_merge_request_metrics.rb
+++ b/db/migrate/20160825052008_add_table_merge_request_metrics.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 # rubocop:disable Migration/Timestamps
-class AddTableMergeRequestMetrics < ActiveRecord::Migration
+class AddTableMergeRequestMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160827011312_ensure_lock_version_has_no_default.rb b/db/migrate/20160827011312_ensure_lock_version_has_no_default.rb
index 7c55bc23cf2fe..18c0f0be3eb9b 100644
--- a/db/migrate/20160827011312_ensure_lock_version_has_no_default.rb
+++ b/db/migrate/20160827011312_ensure_lock_version_has_no_default.rb
@@ -1,4 +1,4 @@
-class EnsureLockVersionHasNoDefault < ActiveRecord::Migration
+class EnsureLockVersionHasNoDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160829114652_add_markdown_cache_columns.rb b/db/migrate/20160829114652_add_markdown_cache_columns.rb
index 6ad7237f4cd7a..b1c5e38c3c493 100644
--- a/db/migrate/20160829114652_add_markdown_cache_columns.rb
+++ b/db/migrate/20160829114652_add_markdown_cache_columns.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddMarkdownCacheColumns < ActiveRecord::Migration
+class AddMarkdownCacheColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160830203109_add_confidential_issues_events_to_web_hooks.rb b/db/migrate/20160830203109_add_confidential_issues_events_to_web_hooks.rb
index a27947212f603..771a6b84648d4 100644
--- a/db/migrate/20160830203109_add_confidential_issues_events_to_web_hooks.rb
+++ b/db/migrate/20160830203109_add_confidential_issues_events_to_web_hooks.rb
@@ -1,4 +1,4 @@
-class AddConfidentialIssuesEventsToWebHooks < ActiveRecord::Migration
+class AddConfidentialIssuesEventsToWebHooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160830211132_add_confidential_issues_events_to_services.rb b/db/migrate/20160830211132_add_confidential_issues_events_to_services.rb
index 030e7c39350e3..a18072643416d 100644
--- a/db/migrate/20160830211132_add_confidential_issues_events_to_services.rb
+++ b/db/migrate/20160830211132_add_confidential_issues_events_to_services.rb
@@ -1,4 +1,4 @@
-class AddConfidentialIssuesEventsToServices < ActiveRecord::Migration
+class AddConfidentialIssuesEventsToServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160830232601_change_lock_version_not_null.rb b/db/migrate/20160830232601_change_lock_version_not_null.rb
index 01c58ed5bdca8..1e34b57e53fde 100644
--- a/db/migrate/20160830232601_change_lock_version_not_null.rb
+++ b/db/migrate/20160830232601_change_lock_version_not_null.rb
@@ -1,4 +1,4 @@
-class ChangeLockVersionNotNull < ActiveRecord::Migration
+class ChangeLockVersionNotNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160831214002_create_project_features.rb b/db/migrate/20160831214002_create_project_features.rb
index 7ac6c8ec65429..e1e61c3a4a22d 100644
--- a/db/migrate/20160831214002_create_project_features.rb
+++ b/db/migrate/20160831214002_create_project_features.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateProjectFeatures < ActiveRecord::Migration
+class CreateProjectFeatures < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20160831214543_migrate_project_features.rb b/db/migrate/20160831214543_migrate_project_features.rb
index 79a5fb29d6405..ba7ffd7c9f213 100644
--- a/db/migrate/20160831214543_migrate_project_features.rb
+++ b/db/migrate/20160831214543_migrate_project_features.rb
@@ -1,4 +1,4 @@
-class MigrateProjectFeatures < ActiveRecord::Migration
+class MigrateProjectFeatures < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20160831223750_remove_features_enabled_from_projects.rb b/db/migrate/20160831223750_remove_features_enabled_from_projects.rb
index 9eafd8b947766..6d39d42882b2a 100644
--- a/db/migrate/20160831223750_remove_features_enabled_from_projects.rb
+++ b/db/migrate/20160831223750_remove_features_enabled_from_projects.rb
@@ -3,7 +3,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/UpdateLargeTable
-class RemoveFeaturesEnabledFromProjects < ActiveRecord::Migration
+class RemoveFeaturesEnabledFromProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20160901141443_set_confidential_issues_events_on_webhooks.rb b/db/migrate/20160901141443_set_confidential_issues_events_on_webhooks.rb
index f8486e3e1a614..2921bb566c9ac 100644
--- a/db/migrate/20160901141443_set_confidential_issues_events_on_webhooks.rb
+++ b/db/migrate/20160901141443_set_confidential_issues_events_on_webhooks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateColumnInBatches
-class SetConfidentialIssuesEventsOnWebhooks < ActiveRecord::Migration
+class SetConfidentialIssuesEventsOnWebhooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160901213340_add_lfs_enabled_to_namespaces.rb b/db/migrate/20160901213340_add_lfs_enabled_to_namespaces.rb
index fd413d1ca8cf2..1be5f3f6ab05f 100644
--- a/db/migrate/20160901213340_add_lfs_enabled_to_namespaces.rb
+++ b/db/migrate/20160901213340_add_lfs_enabled_to_namespaces.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLfsEnabledToNamespaces < ActiveRecord::Migration
+class AddLfsEnabledToNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
index a80a57254dd6f..6c2dc58876e41 100644
--- a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
+++ b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
@@ -1,4 +1,4 @@
-class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration
+class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # After the deploy the caches will be cold anyway
diff --git a/db/migrate/20160907131111_add_environment_type_to_environments.rb b/db/migrate/20160907131111_add_environment_type_to_environments.rb
index fac73753d5b44..34463178fcabd 100644
--- a/db/migrate/20160907131111_add_environment_type_to_environments.rb
+++ b/db/migrate/20160907131111_add_environment_type_to_environments.rb
@@ -1,4 +1,4 @@
-class AddEnvironmentTypeToEnvironments < ActiveRecord::Migration
+class AddEnvironmentTypeToEnvironments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160913162434_remove_projects_pushes_since_gc.rb b/db/migrate/20160913162434_remove_projects_pushes_since_gc.rb
index f32167037e086..51650c6817052 100644
--- a/db/migrate/20160913162434_remove_projects_pushes_since_gc.rb
+++ b/db/migrate/20160913162434_remove_projects_pushes_since_gc.rb
@@ -3,7 +3,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/UpdateLargeTable
-class RemoveProjectsPushesSinceGc < ActiveRecord::Migration
+class RemoveProjectsPushesSinceGc < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20160913212128_change_artifacts_size_column.rb b/db/migrate/20160913212128_change_artifacts_size_column.rb
index 063bbca537c04..f2c2aaff9a882 100644
--- a/db/migrate/20160913212128_change_artifacts_size_column.rb
+++ b/db/migrate/20160913212128_change_artifacts_size_column.rb
@@ -1,4 +1,4 @@
-class ChangeArtifactsSizeColumn < ActiveRecord::Migration
+class ChangeArtifactsSizeColumn < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20160914131004_only_allow_merge_if_all_discussions_are_resolved.rb b/db/migrate/20160914131004_only_allow_merge_if_all_discussions_are_resolved.rb
index 4da5ec9bd2892..81511f9861b7c 100644
--- a/db/migrate/20160914131004_only_allow_merge_if_all_discussions_are_resolved.rb
+++ b/db/migrate/20160914131004_only_allow_merge_if_all_discussions_are_resolved.rb
@@ -1,4 +1,4 @@
-class OnlyAllowMergeIfAllDiscussionsAreResolved < ActiveRecord::Migration
+class OnlyAllowMergeIfAllDiscussionsAreResolved < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160915042921_create_merge_requests_closing_issues.rb b/db/migrate/20160915042921_create_merge_requests_closing_issues.rb
index 10c5604bb5c4c..3efe8c8901b04 100644
--- a/db/migrate/20160915042921_create_merge_requests_closing_issues.rb
+++ b/db/migrate/20160915042921_create_merge_requests_closing_issues.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/Timestamps
-class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
+class CreateMergeRequestsClosingIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20160919144305_add_type_to_labels.rb b/db/migrate/20160919144305_add_type_to_labels.rb
index d08b339cd2791..f897646d264b5 100644
--- a/db/migrate/20160919144305_add_type_to_labels.rb
+++ b/db/migrate/20160919144305_add_type_to_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateColumnInBatches
-class AddTypeToLabels < ActiveRecord::Migration
+class AddTypeToLabels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20160919145149_add_group_id_to_labels.rb b/db/migrate/20160919145149_add_group_id_to_labels.rb
index 917c2b0c521f3..df11a2fc4c8a8 100644
--- a/db/migrate/20160919145149_add_group_id_to_labels.rb
+++ b/db/migrate/20160919145149_add_group_id_to_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddGroupIdToLabels < ActiveRecord::Migration
+class AddGroupIdToLabels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160920160832_add_index_to_labels_title.rb b/db/migrate/20160920160832_add_index_to_labels_title.rb
index e38c655baeee1..e6c87836d4e12 100644
--- a/db/migrate/20160920160832_add_index_to_labels_title.rb
+++ b/db/migrate/20160920160832_add_index_to_labels_title.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToLabelsTitle < ActiveRecord::Migration
+class AddIndexToLabelsTitle < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20160926145521_add_organization_to_user.rb b/db/migrate/20160926145521_add_organization_to_user.rb
index e0bef6e7548b4..2d8d907591d6b 100644
--- a/db/migrate/20160926145521_add_organization_to_user.rb
+++ b/db/migrate/20160926145521_add_organization_to_user.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddOrganizationToUser < ActiveRecord::Migration
+class AddOrganizationToUser < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161006104309_add_state_to_environment.rb b/db/migrate/20161006104309_add_state_to_environment.rb
index ccb546654f988..c51dada9bca5c 100644
--- a/db/migrate/20161006104309_add_state_to_environment.rb
+++ b/db/migrate/20161006104309_add_state_to_environment.rb
@@ -1,4 +1,4 @@
-class AddStateToEnvironment < ActiveRecord::Migration
+class AddStateToEnvironment < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161007073613_create_user_activities.rb b/db/migrate/20161007073613_create_user_activities.rb
index a2f4a38f19a3c..dc972bf466456 100644
--- a/db/migrate/20161007073613_create_user_activities.rb
+++ b/db/migrate/20161007073613_create_user_activities.rb
@@ -1,5 +1,5 @@
 
-class CreateUserActivities < ActiveRecord::Migration
+class CreateUserActivities < ActiveRecord::Migration[4.2]
   # Set this constant to true if this migration requires downtime.
   DOWNTIME = true
 
diff --git a/db/migrate/20161007133303_precalculate_trending_projects.rb b/db/migrate/20161007133303_precalculate_trending_projects.rb
index b324cd942689a..c7a678c9d8f62 100644
--- a/db/migrate/20161007133303_precalculate_trending_projects.rb
+++ b/db/migrate/20161007133303_precalculate_trending_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PrecalculateTrendingProjects < ActiveRecord::Migration
+class PrecalculateTrendingProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161010142410_create_project_authorizations.rb b/db/migrate/20161010142410_create_project_authorizations.rb
index e095ab969f833..b340a4ece1922 100644
--- a/db/migrate/20161010142410_create_project_authorizations.rb
+++ b/db/migrate/20161010142410_create_project_authorizations.rb
@@ -1,4 +1,4 @@
-class CreateProjectAuthorizations < ActiveRecord::Migration
+class CreateProjectAuthorizations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161012180455_add_repository_access_level_to_project_feature.rb b/db/migrate/20161012180455_add_repository_access_level_to_project_feature.rb
index 7b33da3ea111e..3024ea81ed8bf 100644
--- a/db/migrate/20161012180455_add_repository_access_level_to_project_feature.rb
+++ b/db/migrate/20161012180455_add_repository_access_level_to_project_feature.rb
@@ -1,4 +1,4 @@
-class AddRepositoryAccessLevelToProjectFeature < ActiveRecord::Migration
+class AddRepositoryAccessLevelToProjectFeature < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20161014173530_create_label_priorities.rb b/db/migrate/20161014173530_create_label_priorities.rb
index 28937c81e0264..c7d60caa7d19c 100644
--- a/db/migrate/20161014173530_create_label_priorities.rb
+++ b/db/migrate/20161014173530_create_label_priorities.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateLabelPriorities < ActiveRecord::Migration
+class CreateLabelPriorities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161017091941_add_authorized_projects_populated_to_users.rb b/db/migrate/20161017091941_add_authorized_projects_populated_to_users.rb
index 8f6be9dd67755..11f4fa1a1f7b1 100644
--- a/db/migrate/20161017091941_add_authorized_projects_populated_to_users.rb
+++ b/db/migrate/20161017091941_add_authorized_projects_populated_to_users.rb
@@ -1,4 +1,4 @@
-class AddAuthorizedProjectsPopulatedToUsers < ActiveRecord::Migration
+class AddAuthorizedProjectsPopulatedToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161017095000_add_properties_to_deployment.rb b/db/migrate/20161017095000_add_properties_to_deployment.rb
index f620ee0de1cd7..31bd4cd24ad03 100644
--- a/db/migrate/20161017095000_add_properties_to_deployment.rb
+++ b/db/migrate/20161017095000_add_properties_to_deployment.rb
@@ -1,4 +1,4 @@
-class AddPropertiesToDeployment < ActiveRecord::Migration
+class AddPropertiesToDeployment < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161017125927_add_unique_index_to_labels.rb b/db/migrate/20161017125927_add_unique_index_to_labels.rb
index fcdd79d3b029e..b5326789f5262 100644
--- a/db/migrate/20161017125927_add_unique_index_to_labels.rb
+++ b/db/migrate/20161017125927_add_unique_index_to_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddUniqueIndexToLabels < ActiveRecord::Migration
+class AddUniqueIndexToLabels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161018024215_migrate_labels_priority.rb b/db/migrate/20161018024215_migrate_labels_priority.rb
index 22bec2382f460..3e2540c134cdd 100644
--- a/db/migrate/20161018024215_migrate_labels_priority.rb
+++ b/db/migrate/20161018024215_migrate_labels_priority.rb
@@ -1,4 +1,4 @@
-class MigrateLabelsPriority < ActiveRecord::Migration
+class MigrateLabelsPriority < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161018024550_remove_priority_from_labels.rb b/db/migrate/20161018024550_remove_priority_from_labels.rb
index bc25a43526cc2..e164d959bdfc7 100644
--- a/db/migrate/20161018024550_remove_priority_from_labels.rb
+++ b/db/migrate/20161018024550_remove_priority_from_labels.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemovePriorityFromLabels < ActiveRecord::Migration
+class RemovePriorityFromLabels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161018124658_make_project_owners_masters.rb b/db/migrate/20161018124658_make_project_owners_masters.rb
index cb93b449067ae..132c17388dc5e 100644
--- a/db/migrate/20161018124658_make_project_owners_masters.rb
+++ b/db/migrate/20161018124658_make_project_owners_masters.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateColumnInBatches
-class MakeProjectOwnersMasters < ActiveRecord::Migration
+class MakeProjectOwnersMasters < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161019190736_migrate_sidekiq_queues_from_default.rb b/db/migrate/20161019190736_migrate_sidekiq_queues_from_default.rb
index 9f502a8df734f..fc6d97846382e 100644
--- a/db/migrate/20161019190736_migrate_sidekiq_queues_from_default.rb
+++ b/db/migrate/20161019190736_migrate_sidekiq_queues_from_default.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration
+class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161019213545_generate_project_feature_for_projects.rb b/db/migrate/20161019213545_generate_project_feature_for_projects.rb
index 4554e14b0df61..587bdf60f705c 100644
--- a/db/migrate/20161019213545_generate_project_feature_for_projects.rb
+++ b/db/migrate/20161019213545_generate_project_feature_for_projects.rb
@@ -1,4 +1,4 @@
-class GenerateProjectFeatureForProjects < ActiveRecord::Migration
+class GenerateProjectFeatureForProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = true
 
   DOWNTIME_REASON = <<-HEREDOC
diff --git a/db/migrate/20161020075734_default_request_access_groups.rb b/db/migrate/20161020075734_default_request_access_groups.rb
index 9721cc88724a0..72aec86167e32 100644
--- a/db/migrate/20161020075734_default_request_access_groups.rb
+++ b/db/migrate/20161020075734_default_request_access_groups.rb
@@ -1,4 +1,4 @@
-class DefaultRequestAccessGroups < ActiveRecord::Migration
+class DefaultRequestAccessGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/migrate/20161020075830_default_request_access_projects.rb b/db/migrate/20161020075830_default_request_access_projects.rb
index a3a53350e8dcc..b457e39f83883 100644
--- a/db/migrate/20161020075830_default_request_access_projects.rb
+++ b/db/migrate/20161020075830_default_request_access_projects.rb
@@ -1,4 +1,4 @@
-class DefaultRequestAccessProjects < ActiveRecord::Migration
+class DefaultRequestAccessProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb b/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
index b77daf12f6822..60352363e42ff 100644
--- a/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
+++ b/db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddPipelineIdToMergeRequestMetrics < ActiveRecord::Migration
+class AddPipelineIdToMergeRequestMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161020180657_add_minimum_key_length_to_application_settings.rb b/db/migrate/20161020180657_add_minimum_key_length_to_application_settings.rb
index 5b6079002c098..7839bee6a5b3e 100644
--- a/db/migrate/20161020180657_add_minimum_key_length_to_application_settings.rb
+++ b/db/migrate/20161020180657_add_minimum_key_length_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddMinimumKeyLengthToApplicationSettings < ActiveRecord::Migration
+class AddMinimumKeyLengthToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161021114307_add_lock_version_to_build_and_pipelines.rb b/db/migrate/20161021114307_add_lock_version_to_build_and_pipelines.rb
index b47f3aa281018..e172dc3adf241 100644
--- a/db/migrate/20161021114307_add_lock_version_to_build_and_pipelines.rb
+++ b/db/migrate/20161021114307_add_lock_version_to_build_and_pipelines.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLockVersionToBuildAndPipelines < ActiveRecord::Migration
+class AddLockVersionToBuildAndPipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb b/db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb
index fc2e4c12b300a..d27f8fc38c8a5 100644
--- a/db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb
+++ b/db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
+class MigrateMailroomQueueFromDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161025231710_migrate_jira_to_gem.rb b/db/migrate/20161025231710_migrate_jira_to_gem.rb
index 870b00411d2bf..aa1c59ec9e676 100644
--- a/db/migrate/20161025231710_migrate_jira_to_gem.rb
+++ b/db/migrate/20161025231710_migrate_jira_to_gem.rb
@@ -1,4 +1,4 @@
-class MigrateJiraToGem < ActiveRecord::Migration
+class MigrateJiraToGem < ActiveRecord::Migration[4.2]
   DOWNTIME = true
 
   DOWNTIME_REASON = <<-HEREDOC
diff --git a/db/migrate/20161031155516_add_housekeeping_to_application_settings.rb b/db/migrate/20161031155516_add_housekeeping_to_application_settings.rb
index 5a451fb575b8c..963358fe3e58d 100644
--- a/db/migrate/20161031155516_add_housekeeping_to_application_settings.rb
+++ b/db/migrate/20161031155516_add_housekeeping_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddHousekeepingToApplicationSettings < ActiveRecord::Migration
+class AddHousekeepingToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161031171301_add_project_id_to_subscriptions.rb b/db/migrate/20161031171301_add_project_id_to_subscriptions.rb
index 8b1c10a124fd6..5fd10d9b3595e 100644
--- a/db/migrate/20161031171301_add_project_id_to_subscriptions.rb
+++ b/db/migrate/20161031171301_add_project_id_to_subscriptions.rb
@@ -1,4 +1,4 @@
-class AddProjectIdToSubscriptions < ActiveRecord::Migration
+class AddProjectIdToSubscriptions < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161031174110_migrate_subscriptions_project_id.rb b/db/migrate/20161031174110_migrate_subscriptions_project_id.rb
index 549145a0a6523..7f4087fdcd3f5 100644
--- a/db/migrate/20161031174110_migrate_subscriptions_project_id.rb
+++ b/db/migrate/20161031174110_migrate_subscriptions_project_id.rb
@@ -1,4 +1,4 @@
-class MigrateSubscriptionsProjectId < ActiveRecord::Migration
+class MigrateSubscriptionsProjectId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161031181638_add_unique_index_to_subscriptions.rb b/db/migrate/20161031181638_add_unique_index_to_subscriptions.rb
index f263377fbc68a..23a775d62821b 100644
--- a/db/migrate/20161031181638_add_unique_index_to_subscriptions.rb
+++ b/db/migrate/20161031181638_add_unique_index_to_subscriptions.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddUniqueIndexToSubscriptions < ActiveRecord::Migration
+class AddUniqueIndexToSubscriptions < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161103171205_rename_repository_storage_column.rb b/db/migrate/20161103171205_rename_repository_storage_column.rb
index 932805739394b..d6050500e47cb 100644
--- a/db/migrate/20161103171205_rename_repository_storage_column.rb
+++ b/db/migrate/20161103171205_rename_repository_storage_column.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameRepositoryStorageColumn < ActiveRecord::Migration
+class RenameRepositoryStorageColumn < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb b/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb
index 522437b92b4be..83c51c83509f6 100644
--- a/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb
+++ b/db/migrate/20161103191444_add_sidekiq_throttling_to_application_settings.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/SaferBooleanColumn
-class AddSidekiqThrottlingToApplicationSettings < ActiveRecord::Migration
+class AddSidekiqThrottlingToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161106185620_add_project_import_data_project_index.rb b/db/migrate/20161106185620_add_project_import_data_project_index.rb
index b3746dc4f6c57..46809ca170790 100644
--- a/db/migrate/20161106185620_add_project_import_data_project_index.rb
+++ b/db/migrate/20161106185620_add_project_import_data_project_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddProjectImportDataProjectIndex < ActiveRecord::Migration
+class AddProjectImportDataProjectIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161113184239_create_user_chat_names_table.rb b/db/migrate/20161113184239_create_user_chat_names_table.rb
index 7bead07fd76d6..0031ca66afed3 100644
--- a/db/migrate/20161113184239_create_user_chat_names_table.rb
+++ b/db/migrate/20161113184239_create_user_chat_names_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateUserChatNamesTable < ActiveRecord::Migration
+class CreateUserChatNamesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161114024742_add_coverage_regex_to_builds.rb b/db/migrate/20161114024742_add_coverage_regex_to_builds.rb
index 88aa5d52b396a..631968b4aee18 100644
--- a/db/migrate/20161114024742_add_coverage_regex_to_builds.rb
+++ b/db/migrate/20161114024742_add_coverage_regex_to_builds.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCoverageRegexToBuilds < ActiveRecord::Migration
+class AddCoverageRegexToBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161115173905_add_start_date_to_milestones.rb b/db/migrate/20161115173905_add_start_date_to_milestones.rb
index 413733b8db77f..847c4f0bebb9f 100644
--- a/db/migrate/20161115173905_add_start_date_to_milestones.rb
+++ b/db/migrate/20161115173905_add_start_date_to_milestones.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddStartDateToMilestones < ActiveRecord::Migration
+class AddStartDateToMilestones < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161117114805_remove_undeleted_groups.rb b/db/migrate/20161117114805_remove_undeleted_groups.rb
index 29040583aa253..0a4fe1c05b7f2 100644
--- a/db/migrate/20161117114805_remove_undeleted_groups.rb
+++ b/db/migrate/20161117114805_remove_undeleted_groups.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveUndeletedGroups < ActiveRecord::Migration
+class RemoveUndeletedGroups < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20161118183841_add_commit_events_to_services.rb b/db/migrate/20161118183841_add_commit_events_to_services.rb
index 4f9b5dd2281eb..0eb0891511837 100644
--- a/db/migrate/20161118183841_add_commit_events_to_services.rb
+++ b/db/migrate/20161118183841_add_commit_events_to_services.rb
@@ -1,4 +1,4 @@
-class AddCommitEventsToServices < ActiveRecord::Migration
+class AddCommitEventsToServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161124111390_add_parent_id_to_namespace.rb b/db/migrate/20161124111390_add_parent_id_to_namespace.rb
index a6fa1b70a9da0..67f6aee2b9cb9 100644
--- a/db/migrate/20161124111390_add_parent_id_to_namespace.rb
+++ b/db/migrate/20161124111390_add_parent_id_to_namespace.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddParentIdToNamespace < ActiveRecord::Migration
+class AddParentIdToNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161124111395_add_index_to_parent_id.rb b/db/migrate/20161124111395_add_index_to_parent_id.rb
index 065643e058d0e..d7a51ec905a0d 100644
--- a/db/migrate/20161124111395_add_index_to_parent_id.rb
+++ b/db/migrate/20161124111395_add_index_to_parent_id.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIndexToParentId < ActiveRecord::Migration
+class AddIndexToParentId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161124111402_add_routes_table.rb b/db/migrate/20161124111402_add_routes_table.rb
index f5241d906d18a..36f49ef8c97f5 100644
--- a/db/migrate/20161124111402_add_routes_table.rb
+++ b/db/migrate/20161124111402_add_routes_table.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/Timestamps
-class AddRoutesTable < ActiveRecord::Migration
+class AddRoutesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb b/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb
index 1eb6a8fa5df54..0772821210c94 100644
--- a/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb
+++ b/db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb
@@ -1,4 +1,4 @@
-class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration
+class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class Repository
diff --git a/db/migrate/20161128095517_add_in_reply_to_discussion_id_to_sent_notifications.rb b/db/migrate/20161128095517_add_in_reply_to_discussion_id_to_sent_notifications.rb
index d56d83ca1d336..a2971486014fa 100644
--- a/db/migrate/20161128095517_add_in_reply_to_discussion_id_to_sent_notifications.rb
+++ b/db/migrate/20161128095517_add_in_reply_to_discussion_id_to_sent_notifications.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddInReplyToDiscussionIdToSentNotifications < ActiveRecord::Migration
+class AddInReplyToDiscussionIdToSentNotifications < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161128142110_remove_unnecessary_indexes.rb b/db/migrate/20161128142110_remove_unnecessary_indexes.rb
index 699a9368eb313..b6c6e303ec7ab 100644
--- a/db/migrate/20161128142110_remove_unnecessary_indexes.rb
+++ b/db/migrate/20161128142110_remove_unnecessary_indexes.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class RemoveUnnecessaryIndexes < ActiveRecord::Migration
+class RemoveUnnecessaryIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb b/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb
index 38f5781745b92..63139eb97bd99 100644
--- a/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb
+++ b/db/migrate/20161128161412_add_html_emails_enabled_to_application_settings.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/SaferBooleanColumn
-class AddHtmlEmailsEnabledToApplicationSettings < ActiveRecord::Migration
+class AddHtmlEmailsEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161130095245_fill_routes_table.rb b/db/migrate/20161130095245_fill_routes_table.rb
index c3536d6d911a0..712be187c7ce1 100644
--- a/db/migrate/20161130095245_fill_routes_table.rb
+++ b/db/migrate/20161130095245_fill_routes_table.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class FillRoutesTable < ActiveRecord::Migration
+class FillRoutesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161130101252_fill_projects_routes_table.rb b/db/migrate/20161130101252_fill_projects_routes_table.rb
index 56ba6fcdbe35c..1900d6c801332 100644
--- a/db/migrate/20161130101252_fill_projects_routes_table.rb
+++ b/db/migrate/20161130101252_fill_projects_routes_table.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class FillProjectsRoutesTable < ActiveRecord::Migration
+class FillProjectsRoutesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161201001911_add_plant_uml_url_to_application_settings.rb b/db/migrate/20161201001911_add_plant_uml_url_to_application_settings.rb
index b8d8742ae402b..79558a6b3b945 100644
--- a/db/migrate/20161201001911_add_plant_uml_url_to_application_settings.rb
+++ b/db/migrate/20161201001911_add_plant_uml_url_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPlantUmlUrlToApplicationSettings < ActiveRecord::Migration
+class AddPlantUmlUrlToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161201155511_create_project_statistics.rb b/db/migrate/20161201155511_create_project_statistics.rb
index 26e6d3623eb13..6dcb5adb82b82 100644
--- a/db/migrate/20161201155511_create_project_statistics.rb
+++ b/db/migrate/20161201155511_create_project_statistics.rb
@@ -1,4 +1,4 @@
-class CreateProjectStatistics < ActiveRecord::Migration
+class CreateProjectStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161201160452_migrate_project_statistics.rb b/db/migrate/20161201160452_migrate_project_statistics.rb
index a547409aaa541..42c5be07e83cf 100644
--- a/db/migrate/20161201160452_migrate_project_statistics.rb
+++ b/db/migrate/20161201160452_migrate_project_statistics.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class MigrateProjectStatistics < ActiveRecord::Migration
+class MigrateProjectStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161202152031_remove_duplicates_from_routes.rb b/db/migrate/20161202152031_remove_duplicates_from_routes.rb
index d73b08475064d..0615f683859eb 100644
--- a/db/migrate/20161202152031_remove_duplicates_from_routes.rb
+++ b/db/migrate/20161202152031_remove_duplicates_from_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveDuplicatesFromRoutes < ActiveRecord::Migration
+class RemoveDuplicatesFromRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161202152035_add_index_to_routes.rb b/db/migrate/20161202152035_add_index_to_routes.rb
index 552b5fab68c2f..ad2e0cd13c93e 100644
--- a/db/migrate/20161202152035_add_index_to_routes.rb
+++ b/db/migrate/20161202152035_add_index_to_routes.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIndexToRoutes < ActiveRecord::Migration
+class AddIndexToRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161206003819_add_plant_uml_enabled_to_application_settings.rb b/db/migrate/20161206003819_add_plant_uml_enabled_to_application_settings.rb
index 7f56ecf4c9e49..bb44d56ee563c 100644
--- a/db/migrate/20161206003819_add_plant_uml_enabled_to_application_settings.rb
+++ b/db/migrate/20161206003819_add_plant_uml_enabled_to_application_settings.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/SaferBooleanColumn
-class AddPlantUmlEnabledToApplicationSettings < ActiveRecord::Migration
+class AddPlantUmlEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161206153749_remove_uniq_path_index_from_namespace.rb b/db/migrate/20161206153749_remove_uniq_path_index_from_namespace.rb
index 7d39c2ae6268e..c301d76646e00 100644
--- a/db/migrate/20161206153749_remove_uniq_path_index_from_namespace.rb
+++ b/db/migrate/20161206153749_remove_uniq_path_index_from_namespace.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class RemoveUniqPathIndexFromNamespace < ActiveRecord::Migration
+class RemoveUniqPathIndexFromNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161206153751_add_path_index_to_namespace.rb b/db/migrate/20161206153751_add_path_index_to_namespace.rb
index 623037e35cdad..f0848cc59a52b 100644
--- a/db/migrate/20161206153751_add_path_index_to_namespace.rb
+++ b/db/migrate/20161206153751_add_path_index_to_namespace.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddPathIndexToNamespace < ActiveRecord::Migration
+class AddPathIndexToNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161206153753_remove_uniq_name_index_from_namespace.rb b/db/migrate/20161206153753_remove_uniq_name_index_from_namespace.rb
index 9296ae36aa562..13660cec7aa03 100644
--- a/db/migrate/20161206153753_remove_uniq_name_index_from_namespace.rb
+++ b/db/migrate/20161206153753_remove_uniq_name_index_from_namespace.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class RemoveUniqNameIndexFromNamespace < ActiveRecord::Migration
+class RemoveUniqNameIndexFromNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161206153754_add_name_index_to_namespace.rb b/db/migrate/20161206153754_add_name_index_to_namespace.rb
index 2bbd039ff2756..14152a6dc0729 100644
--- a/db/migrate/20161206153754_add_name_index_to_namespace.rb
+++ b/db/migrate/20161206153754_add_name_index_to_namespace.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddNameIndexToNamespace < ActiveRecord::Migration
+class AddNameIndexToNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161207231620_fixup_environment_name_uniqueness.rb b/db/migrate/20161207231620_fixup_environment_name_uniqueness.rb
index 1db8c68626a5e..7cae09021cdd1 100644
--- a/db/migrate/20161207231620_fixup_environment_name_uniqueness.rb
+++ b/db/migrate/20161207231620_fixup_environment_name_uniqueness.rb
@@ -1,4 +1,4 @@
-class FixupEnvironmentNameUniqueness < ActiveRecord::Migration
+class FixupEnvironmentNameUniqueness < ActiveRecord::Migration[4.2]
   include Gitlab::Database::ArelMethods
   include Gitlab::Database::MigrationHelpers
 
diff --git a/db/migrate/20161207231621_create_environment_name_unique_index.rb b/db/migrate/20161207231621_create_environment_name_unique_index.rb
index 15093350f1204..28d226644056e 100644
--- a/db/migrate/20161207231621_create_environment_name_unique_index.rb
+++ b/db/migrate/20161207231621_create_environment_name_unique_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class CreateEnvironmentNameUniqueIndex < ActiveRecord::Migration
+class CreateEnvironmentNameUniqueIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20161207231626_add_environment_slug.rb b/db/migrate/20161207231626_add_environment_slug.rb
index 162f82a01cb9c..4657b023dfa42 100644
--- a/db/migrate/20161207231626_add_environment_slug.rb
+++ b/db/migrate/20161207231626_add_environment_slug.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEnvironmentSlug < ActiveRecord::Migration
+class AddEnvironmentSlug < ActiveRecord::Migration[4.2]
   include Gitlab::Database::ArelMethods
   include Gitlab::Database::MigrationHelpers
 
diff --git a/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb b/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb
index 42a90091b876f..57606a33cb927 100644
--- a/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb
+++ b/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddUniqueIndexForEnvironmentSlug < ActiveRecord::Migration
+class AddUniqueIndexForEnvironmentSlug < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb b/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb
index e63d5927f86b0..e8ea9cf8fda2f 100644
--- a/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb
+++ b/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb
@@ -1,4 +1,4 @@
-class CreateDoorkeeperOpenidConnectTables < ActiveRecord::Migration
+class CreateDoorkeeperOpenidConnectTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161212142807_add_lower_path_index_to_routes.rb b/db/migrate/20161212142807_add_lower_path_index_to_routes.rb
index 76db517979527..92a12dbc699f0 100644
--- a/db/migrate/20161212142807_add_lower_path_index_to_routes.rb
+++ b/db/migrate/20161212142807_add_lower_path_index_to_routes.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddLowerPathIndexToRoutes < ActiveRecord::Migration
+class AddLowerPathIndexToRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161213172958_change_slack_service_to_slack_notification_service.rb b/db/migrate/20161213172958_change_slack_service_to_slack_notification_service.rb
index dc38d0ac90674..babac6bfc4fed 100644
--- a/db/migrate/20161213172958_change_slack_service_to_slack_notification_service.rb
+++ b/db/migrate/20161213172958_change_slack_service_to_slack_notification_service.rb
@@ -1,4 +1,4 @@
-class ChangeSlackServiceToSlackNotificationService < ActiveRecord::Migration
+class ChangeSlackServiceToSlackNotificationService < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161220141214_remove_dot_git_from_group_names.rb b/db/migrate/20161220141214_remove_dot_git_from_group_names.rb
index 17357b67ab779..5c0b083325efe 100644
--- a/db/migrate/20161220141214_remove_dot_git_from_group_names.rb
+++ b/db/migrate/20161220141214_remove_dot_git_from_group_names.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveDotGitFromGroupNames < ActiveRecord::Migration
+class RemoveDotGitFromGroupNames < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   include Gitlab::ShellAdapter
 
diff --git a/db/migrate/20161221152132_add_last_used_at_to_key.rb b/db/migrate/20161221152132_add_last_used_at_to_key.rb
index 86dc787024789..a5b3f2b6f4bc7 100644
--- a/db/migrate/20161221152132_add_last_used_at_to_key.rb
+++ b/db/migrate/20161221152132_add_last_used_at_to_key.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddLastUsedAtToKey < ActiveRecord::Migration
+class AddLastUsedAtToKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161223034433_add_estimate_to_issuables_ce.rb b/db/migrate/20161223034433_add_estimate_to_issuables_ce.rb
index d5116dfab49a5..75bea41387cff 100644
--- a/db/migrate/20161223034433_add_estimate_to_issuables_ce.rb
+++ b/db/migrate/20161223034433_add_estimate_to_issuables_ce.rb
@@ -1,4 +1,4 @@
-class AddEstimateToIssuablesCe < ActiveRecord::Migration
+class AddEstimateToIssuablesCe < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161223034646_create_timelogs_ce.rb b/db/migrate/20161223034646_create_timelogs_ce.rb
index 1e894cc916113..489a2b35dfdac 100644
--- a/db/migrate/20161223034646_create_timelogs_ce.rb
+++ b/db/migrate/20161223034646_create_timelogs_ce.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateTimelogsCe < ActiveRecord::Migration
+class CreateTimelogsCe < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb
index db10426b483aa..e331878015101 100644
--- a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb
+++ b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb
@@ -1,4 +1,4 @@
-class RemoveDotGitFromUsernames < ActiveRecord::Migration
+class RemoveDotGitFromUsernames < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   include Gitlab::ShellAdapter
 
diff --git a/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb b/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb
index 6b15e5caccf40..df5714278f2a7 100644
--- a/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb
+++ b/db/migrate/20161227192806_rename_slack_and_mattermost_notification_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateColumnInBatches
-class RenameSlackAndMattermostNotificationServices < ActiveRecord::Migration
+class RenameSlackAndMattermostNotificationServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20161228124936_change_expires_at_to_date_in_personal_access_tokens.rb b/db/migrate/20161228124936_change_expires_at_to_date_in_personal_access_tokens.rb
index 16f7cc487cef1..f9f8f11316d00 100644
--- a/db/migrate/20161228124936_change_expires_at_to_date_in_personal_access_tokens.rb
+++ b/db/migrate/20161228124936_change_expires_at_to_date_in_personal_access_tokens.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/Datetime
-class ChangeExpiresAtToDateInPersonalAccessTokens < ActiveRecord::Migration
+class ChangeExpiresAtToDateInPersonalAccessTokens < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20161228135550_add_impersonation_to_personal_access_tokens.rb b/db/migrate/20161228135550_add_impersonation_to_personal_access_tokens.rb
index ea9caceaa2c3a..489d7fb8b752d 100644
--- a/db/migrate/20161228135550_add_impersonation_to_personal_access_tokens.rb
+++ b/db/migrate/20161228135550_add_impersonation_to_personal_access_tokens.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddImpersonationToPersonalAccessTokens < ActiveRecord::Migration
+class AddImpersonationToPersonalAccessTokens < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170120131253_create_chat_teams.rb b/db/migrate/20170120131253_create_chat_teams.rb
index 522088219112b..e9b9bd7bd2f2d 100644
--- a/db/migrate/20170120131253_create_chat_teams.rb
+++ b/db/migrate/20170120131253_create_chat_teams.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateChatTeams < ActiveRecord::Migration
+class CreateChatTeams < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20170121123724_add_index_to_ci_builds_for_status_runner_id_and_type.rb b/db/migrate/20170121123724_add_index_to_ci_builds_for_status_runner_id_and_type.rb
index c006098fafd07..cc1a4d2db5925 100644
--- a/db/migrate/20170121123724_add_index_to_ci_builds_for_status_runner_id_and_type.rb
+++ b/db/migrate/20170121123724_add_index_to_ci_builds_for_status_runner_id_and_type.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToCiBuildsForStatusRunnerIdAndType < ActiveRecord::Migration
+class AddIndexToCiBuildsForStatusRunnerIdAndType < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb b/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb
index 00aa0b311b139..1b83ce4cfe3f7 100644
--- a/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb
+++ b/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToCiRunnersForIsShared < ActiveRecord::Migration
+class AddIndexToCiRunnersForIsShared < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb b/db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb
index a7d4e141a1aae..ffd966be086c0 100644
--- a/db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb
+++ b/db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddForeignKeysToTimelogs < ActiveRecord::Migration
+class AddForeignKeysToTimelogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170124193147_add_two_factor_columns_to_namespaces.rb b/db/migrate/20170124193147_add_two_factor_columns_to_namespaces.rb
index 27ebe0af33be2..324e051666b63 100644
--- a/db/migrate/20170124193147_add_two_factor_columns_to_namespaces.rb
+++ b/db/migrate/20170124193147_add_two_factor_columns_to_namespaces.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddTwoFactorColumnsToNamespaces < ActiveRecord::Migration
+class AddTwoFactorColumnsToNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170124193205_add_two_factor_columns_to_users.rb b/db/migrate/20170124193205_add_two_factor_columns_to_users.rb
index 558a1837c7968..6c80dbfc965ce 100644
--- a/db/migrate/20170124193205_add_two_factor_columns_to_users.rb
+++ b/db/migrate/20170124193205_add_two_factor_columns_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddTwoFactorColumnsToUsers < ActiveRecord::Migration
+class AddTwoFactorColumnsToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170126174819_add_terminal_max_session_time_to_application_settings.rb b/db/migrate/20170126174819_add_terminal_max_session_time_to_application_settings.rb
index 334f53f9145f3..70f1669108a37 100644
--- a/db/migrate/20170126174819_add_terminal_max_session_time_to_application_settings.rb
+++ b/db/migrate/20170126174819_add_terminal_max_session_time_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddTerminalMaxSessionTimeToApplicationSettings < ActiveRecord::Migration
+class AddTerminalMaxSessionTimeToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb b/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb
index 0ee4229d1f833..2e2fecfa2a79a 100644
--- a/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb
+++ b/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb
@@ -1,4 +1,4 @@
-class RemoveBacklogListsFromBoards < ActiveRecord::Migration
+class RemoveBacklogListsFromBoards < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170130204620_add_index_to_project_authorizations.rb b/db/migrate/20170130204620_add_index_to_project_authorizations.rb
index f256251516a66..28c4480e9c65a 100644
--- a/db/migrate/20170130204620_add_index_to_project_authorizations.rb
+++ b/db/migrate/20170130204620_add_index_to_project_authorizations.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToProjectAuthorizations < ActiveRecord::Migration
+class AddIndexToProjectAuthorizations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170130221926_create_uploads.rb b/db/migrate/20170130221926_create_uploads.rb
index 6f06c5dd84082..7bf15ca4978f5 100644
--- a/db/migrate/20170130221926_create_uploads.rb
+++ b/db/migrate/20170130221926_create_uploads.rb
@@ -1,4 +1,4 @@
-class CreateUploads < ActiveRecord::Migration
+class CreateUploads < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170131221752_add_relative_position_to_issues.rb b/db/migrate/20170131221752_add_relative_position_to_issues.rb
index fd18d8b6a60f1..126cb9e54151d 100644
--- a/db/migrate/20170131221752_add_relative_position_to_issues.rb
+++ b/db/migrate/20170131221752_add_relative_position_to_issues.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddRelativePositionToIssues < ActiveRecord::Migration
+class AddRelativePositionToIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170204172458_add_name_to_route.rb b/db/migrate/20170204172458_add_name_to_route.rb
index 38ed1ad9039c5..e7c94aceb260a 100644
--- a/db/migrate/20170204172458_add_name_to_route.rb
+++ b/db/migrate/20170204172458_add_name_to_route.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddNameToRoute < ActiveRecord::Migration
+class AddNameToRoute < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb b/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb
index b1b0a60100771..746322885b1e3 100644
--- a/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb
+++ b/db/migrate/20170204181513_add_index_to_labels_for_type_and_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToLabelsForTypeAndProject < ActiveRecord::Migration
+class AddIndexToLabelsForTypeAndProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170206071414_add_recaptcha_verified_to_spam_logs.rb b/db/migrate/20170206071414_add_recaptcha_verified_to_spam_logs.rb
index 44372334d21dc..06338ac943ece 100644
--- a/db/migrate/20170206071414_add_recaptcha_verified_to_spam_logs.rb
+++ b/db/migrate/20170206071414_add_recaptcha_verified_to_spam_logs.rb
@@ -1,4 +1,4 @@
-class AddRecaptchaVerifiedToSpamLogs < ActiveRecord::Migration
+class AddRecaptchaVerifiedToSpamLogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20170206115204_add_column_ghost_to_users.rb b/db/migrate/20170206115204_add_column_ghost_to_users.rb
index cc1eeda1160f1..4b86814e05d02 100644
--- a/db/migrate/20170206115204_add_column_ghost_to_users.rb
+++ b/db/migrate/20170206115204_add_column_ghost_to_users.rb
@@ -1,4 +1,4 @@
-class AddColumnGhostToUsers < ActiveRecord::Migration
+class AddColumnGhostToUsers < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb b/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb
index 2c20f6a48ab04..d0b440b8ccb1a 100644
--- a/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb
+++ b/db/migrate/20170210062829_add_index_to_labels_for_title_and_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToLabelsForTitleAndProject < ActiveRecord::Migration
+class AddIndexToLabelsForTitleAndProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb b/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb
index c31057f2617c4..753d6c77e357d 100644
--- a/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb
+++ b/db/migrate/20170210075922_add_index_to_ci_trigger_requests_for_commit_id.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToCiTriggerRequestsForCommitId < ActiveRecord::Migration
+class AddIndexToCiTriggerRequestsForCommitId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170210103609_add_index_to_user_agent_detail.rb b/db/migrate/20170210103609_add_index_to_user_agent_detail.rb
index ba4976a5ce8e2..a2d6528ea82d7 100644
--- a/db/migrate/20170210103609_add_index_to_user_agent_detail.rb
+++ b/db/migrate/20170210103609_add_index_to_user_agent_detail.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIndexToUserAgentDetail < ActiveRecord::Migration
+class AddIndexToUserAgentDetail < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170210131347_add_unique_ips_limit_to_application_settings.rb b/db/migrate/20170210131347_add_unique_ips_limit_to_application_settings.rb
index 9ab970134be83..c286354f476b6 100644
--- a/db/migrate/20170210131347_add_unique_ips_limit_to_application_settings.rb
+++ b/db/migrate/20170210131347_add_unique_ips_limit_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddUniqueIpsLimitToApplicationSettings < ActiveRecord::Migration
+class AddUniqueIpsLimitToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
   disable_ddl_transaction!
diff --git a/db/migrate/20170214084746_add_default_artifacts_expiration_to_application_settings.rb b/db/migrate/20170214084746_add_default_artifacts_expiration_to_application_settings.rb
index e0e3ff8957a05..84814c2f8f247 100644
--- a/db/migrate/20170214084746_add_default_artifacts_expiration_to_application_settings.rb
+++ b/db/migrate/20170214084746_add_default_artifacts_expiration_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddDefaultArtifactsExpirationToApplicationSettings < ActiveRecord::Migration
+class AddDefaultArtifactsExpirationToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb b/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb
index 884c4e569d685..be393bd496d66 100644
--- a/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb
+++ b/db/migrate/20170216135621_add_index_for_latest_successful_pipeline.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexForLatestSuccessfulPipeline < ActiveRecord::Migration
+class AddIndexForLatestSuccessfulPipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/migrate/20170216141440_drop_index_for_builds_project_status.rb b/db/migrate/20170216141440_drop_index_for_builds_project_status.rb
index 56ad566ca6760..7edf7dd7e105e 100644
--- a/db/migrate/20170216141440_drop_index_for_builds_project_status.rb
+++ b/db/migrate/20170216141440_drop_index_for_builds_project_status.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class DropIndexForBuildsProjectStatus < ActiveRecord::Migration
+class DropIndexForBuildsProjectStatus < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/migrate/20170217132157_rename_merge_when_build_succeeds.rb b/db/migrate/20170217132157_rename_merge_when_build_succeeds.rb
index 9011526565dcf..ee8838eff5636 100644
--- a/db/migrate/20170217132157_rename_merge_when_build_succeeds.rb
+++ b/db/migrate/20170217132157_rename_merge_when_build_succeeds.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameMergeWhenBuildSucceeds < ActiveRecord::Migration
+class RenameMergeWhenBuildSucceeds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170217151947_rename_only_allow_merge_if_build_succeeds.rb b/db/migrate/20170217151947_rename_only_allow_merge_if_build_succeeds.rb
index b2b68ff72d134..5d35216f3af3a 100644
--- a/db/migrate/20170217151947_rename_only_allow_merge_if_build_succeeds.rb
+++ b/db/migrate/20170217151947_rename_only_allow_merge_if_build_succeeds.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameOnlyAllowMergeIfBuildSucceeds < ActiveRecord::Migration
+class RenameOnlyAllowMergeIfBuildSucceeds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170217151948_add_owner_id_to_triggers.rb b/db/migrate/20170217151948_add_owner_id_to_triggers.rb
index 16d7cc5bed691..a28711ae59ad9 100644
--- a/db/migrate/20170217151948_add_owner_id_to_triggers.rb
+++ b/db/migrate/20170217151948_add_owner_id_to_triggers.rb
@@ -1,4 +1,4 @@
-class AddOwnerIdToTriggers < ActiveRecord::Migration
+class AddOwnerIdToTriggers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170217151949_add_description_to_triggers.rb b/db/migrate/20170217151949_add_description_to_triggers.rb
index 1dca0e374124a..27cb4b3ab3127 100644
--- a/db/migrate/20170217151949_add_description_to_triggers.rb
+++ b/db/migrate/20170217151949_add_description_to_triggers.rb
@@ -1,4 +1,4 @@
-class AddDescriptionToTriggers < ActiveRecord::Migration
+class AddDescriptionToTriggers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170222111732_create_gpg_keys.rb b/db/migrate/20170222111732_create_gpg_keys.rb
index 0d6d454bbf3aa..012e8ef585488 100644
--- a/db/migrate/20170222111732_create_gpg_keys.rb
+++ b/db/migrate/20170222111732_create_gpg_keys.rb
@@ -1,4 +1,4 @@
-class CreateGpgKeys < ActiveRecord::Migration
+class CreateGpgKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170222143317_drop_ci_projects.rb b/db/migrate/20170222143317_drop_ci_projects.rb
index 4db8658f36fbe..9f3aa2da382d0 100644
--- a/db/migrate/20170222143317_drop_ci_projects.rb
+++ b/db/migrate/20170222143317_drop_ci_projects.rb
@@ -1,4 +1,4 @@
-class DropCiProjects < ActiveRecord::Migration
+class DropCiProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170222143500_remove_old_project_id_columns.rb b/db/migrate/20170222143500_remove_old_project_id_columns.rb
index 9bed38a34443f..356dee4a06087 100644
--- a/db/migrate/20170222143500_remove_old_project_id_columns.rb
+++ b/db/migrate/20170222143500_remove_old_project_id_columns.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/RemoveColumn
 # rubocop:disable RemoveIndex
-class RemoveOldProjectIdColumns < ActiveRecord::Migration
+class RemoveOldProjectIdColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170222143603_rename_gl_project_id_to_project_id.rb b/db/migrate/20170222143603_rename_gl_project_id_to_project_id.rb
index 7c19d47155781..390b2c33d9105 100644
--- a/db/migrate/20170222143603_rename_gl_project_id_to_project_id.rb
+++ b/db/migrate/20170222143603_rename_gl_project_id_to_project_id.rb
@@ -1,4 +1,4 @@
-class RenameGlProjectIdToProjectId < ActiveRecord::Migration
+class RenameGlProjectIdToProjectId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20170301101006_add_ci_runner_namespaces.rb b/db/migrate/20170301101006_add_ci_runner_namespaces.rb
index deaf03e928ba8..aa2d8a14242c1 100644
--- a/db/migrate/20170301101006_add_ci_runner_namespaces.rb
+++ b/db/migrate/20170301101006_add_ci_runner_namespaces.rb
@@ -1,4 +1,4 @@
-class AddCiRunnerNamespaces < ActiveRecord::Migration
+class AddCiRunnerNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170301125302_add_printing_merge_request_link_enabled_to_project.rb b/db/migrate/20170301125302_add_printing_merge_request_link_enabled_to_project.rb
index 6d43f346d4f7c..a7efeb8ae6f47 100644
--- a/db/migrate/20170301125302_add_printing_merge_request_link_enabled_to_project.rb
+++ b/db/migrate/20170301125302_add_printing_merge_request_link_enabled_to_project.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/UpdateLargeTable
-class AddPrintingMergeRequestLinkEnabledToProject < ActiveRecord::Migration
+class AddPrintingMergeRequestLinkEnabledToProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170301195939_rename_ci_commits_to_ci_pipelines.rb b/db/migrate/20170301195939_rename_ci_commits_to_ci_pipelines.rb
index 4f061d9639214..791e9c845a6ff 100644
--- a/db/migrate/20170301195939_rename_ci_commits_to_ci_pipelines.rb
+++ b/db/migrate/20170301195939_rename_ci_commits_to_ci_pipelines.rb
@@ -1,4 +1,4 @@
-class RenameCiCommitsToCiPipelines < ActiveRecord::Migration
+class RenameCiCommitsToCiPipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb b/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb
index ee802ab34ca9f..08a11aee99213 100644
--- a/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb
+++ b/db/migrate/20170301205639_remove_unused_ci_tables_and_columns.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveUnusedCiTablesAndColumns < ActiveRecord::Migration
+class RemoveUnusedCiTablesAndColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/migrate/20170305180853_add_auto_cancel_pending_pipelines_to_project.rb b/db/migrate/20170305180853_add_auto_cancel_pending_pipelines_to_project.rb
index 3c5cd95726a1e..3e317bb524850 100644
--- a/db/migrate/20170305180853_add_auto_cancel_pending_pipelines_to_project.rb
+++ b/db/migrate/20170305180853_add_auto_cancel_pending_pipelines_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddAutoCancelPendingPipelinesToProject < ActiveRecord::Migration
+class AddAutoCancelPendingPipelinesToProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170305203726_add_owner_id_foreign_key.rb b/db/migrate/20170305203726_add_owner_id_foreign_key.rb
index 5fbdc45f1a748..b3bd441ff9cf2 100644
--- a/db/migrate/20170305203726_add_owner_id_foreign_key.rb
+++ b/db/migrate/20170305203726_add_owner_id_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddOwnerIdForeignKey < ActiveRecord::Migration
+class AddOwnerIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170307125949_add_last_activity_on_to_users.rb b/db/migrate/20170307125949_add_last_activity_on_to_users.rb
index 0100836b4733c..42331eab7537d 100644
--- a/db/migrate/20170307125949_add_last_activity_on_to_users.rb
+++ b/db/migrate/20170307125949_add_last_activity_on_to_users.rb
@@ -1,4 +1,4 @@
-class AddLastActivityOnToUsers < ActiveRecord::Migration
+class AddLastActivityOnToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170309173138_create_protected_tags.rb b/db/migrate/20170309173138_create_protected_tags.rb
index 4684c9964c496..f518b500bd41d 100644
--- a/db/migrate/20170309173138_create_protected_tags.rb
+++ b/db/migrate/20170309173138_create_protected_tags.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateProtectedTags < ActiveRecord::Migration
+class CreateProtectedTags < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170312114329_add_auto_canceled_by_id_to_pipeline.rb b/db/migrate/20170312114329_add_auto_canceled_by_id_to_pipeline.rb
index 1690ce9056431..26187a9e8b3fe 100644
--- a/db/migrate/20170312114329_add_auto_canceled_by_id_to_pipeline.rb
+++ b/db/migrate/20170312114329_add_auto_canceled_by_id_to_pipeline.rb
@@ -1,4 +1,4 @@
-class AddAutoCanceledByIdToPipeline < ActiveRecord::Migration
+class AddAutoCanceledByIdToPipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170312114529_add_auto_canceled_by_id_foreign_key_to_pipeline.rb b/db/migrate/20170312114529_add_auto_canceled_by_id_foreign_key_to_pipeline.rb
index 1e7b02ecf0e3f..a2b5c1c4533ba 100644
--- a/db/migrate/20170312114529_add_auto_canceled_by_id_foreign_key_to_pipeline.rb
+++ b/db/migrate/20170312114529_add_auto_canceled_by_id_foreign_key_to_pipeline.rb
@@ -1,4 +1,4 @@
-class AddAutoCanceledByIdForeignKeyToPipeline < ActiveRecord::Migration
+class AddAutoCanceledByIdForeignKeyToPipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170313213916_add_index_to_user_ghost.rb b/db/migrate/20170313213916_add_index_to_user_ghost.rb
index fe5847ed225f4..66e57b444a020 100644
--- a/db/migrate/20170313213916_add_index_to_user_ghost.rb
+++ b/db/migrate/20170313213916_add_index_to_user_ghost.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class AddIndexToUserGhost < ActiveRecord::Migration
+class AddIndexToUserGhost < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170314082049_create_system_note_metadata.rb b/db/migrate/20170314082049_create_system_note_metadata.rb
index fee47e9605327..d0cc6e3be36d5 100644
--- a/db/migrate/20170314082049_create_system_note_metadata.rb
+++ b/db/migrate/20170314082049_create_system_note_metadata.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateSystemNoteMetadata < ActiveRecord::Migration
+class CreateSystemNoteMetadata < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb b/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb
index 9b9098d115df3..8773c7ea657f4 100644
--- a/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb
+++ b/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/RemoveColumn
 # rubocop:disable Migration/UpdateLargeTable
-class RevertAddNotifiedOfOwnActivityToUsers < ActiveRecord::Migration
+class RevertAddNotifiedOfOwnActivityToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170315194013_add_closed_at_to_issues.rb b/db/migrate/20170315194013_add_closed_at_to_issues.rb
index 34a1bd7ca8c86..0b06ee6e74ccd 100644
--- a/db/migrate/20170315194013_add_closed_at_to_issues.rb
+++ b/db/migrate/20170315194013_add_closed_at_to_issues.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddClosedAtToIssues < ActiveRecord::Migration
+class AddClosedAtToIssues < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170316061730_readd_notified_of_own_activity_to_users.rb b/db/migrate/20170316061730_readd_notified_of_own_activity_to_users.rb
index 524eb2557ce1b..82029dfd3fc17 100644
--- a/db/migrate/20170316061730_readd_notified_of_own_activity_to_users.rb
+++ b/db/migrate/20170316061730_readd_notified_of_own_activity_to_users.rb
@@ -1,4 +1,4 @@
-class ReaddNotifiedOfOwnActivityToUsers < ActiveRecord::Migration
+class ReaddNotifiedOfOwnActivityToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170316163845_move_uploads_to_system_dir.rb b/db/migrate/20170316163845_move_uploads_to_system_dir.rb
index cfcb909ddaff3..d24527b55cdf3 100644
--- a/db/migrate/20170316163845_move_uploads_to_system_dir.rb
+++ b/db/migrate/20170316163845_move_uploads_to_system_dir.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MoveUploadsToSystemDir < ActiveRecord::Migration
+class MoveUploadsToSystemDir < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170317203554_index_routes_path_for_like.rb b/db/migrate/20170317203554_index_routes_path_for_like.rb
index 8d3609135d0f4..a1bee3c8783d5 100644
--- a/db/migrate/20170317203554_index_routes_path_for_like.rb
+++ b/db/migrate/20170317203554_index_routes_path_for_like.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class IndexRoutesPathForLike < ActiveRecord::Migration
+class IndexRoutesPathForLike < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170320173259_migrate_assignees.rb b/db/migrate/20170320173259_migrate_assignees.rb
index 255b5e9c4db15..43a90758bd907 100644
--- a/db/migrate/20170320173259_migrate_assignees.rb
+++ b/db/migrate/20170320173259_migrate_assignees.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/UpdateColumnInBatches
-class MigrateAssignees < ActiveRecord::Migration
+class MigrateAssignees < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170322013926_create_container_repository.rb b/db/migrate/20170322013926_create_container_repository.rb
index 242f7b8d17df0..b1e778671b2c0 100644
--- a/db/migrate/20170322013926_create_container_repository.rb
+++ b/db/migrate/20170322013926_create_container_repository.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateContainerRepository < ActiveRecord::Migration
+class CreateContainerRepository < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170327091750_add_created_at_index_to_deployments.rb b/db/migrate/20170327091750_add_created_at_index_to_deployments.rb
index fd6ed499b80a1..f29fff7d5b91c 100644
--- a/db/migrate/20170327091750_add_created_at_index_to_deployments.rb
+++ b/db/migrate/20170327091750_add_created_at_index_to_deployments.rb
@@ -1,4 +1,4 @@
-class AddCreatedAtIndexToDeployments < ActiveRecord::Migration
+class AddCreatedAtIndexToDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170328010804_add_uuid_to_application_settings.rb b/db/migrate/20170328010804_add_uuid_to_application_settings.rb
index 5dfcc751c7b5b..95a01c2dc8f5e 100644
--- a/db/migrate/20170328010804_add_uuid_to_application_settings.rb
+++ b/db/migrate/20170328010804_add_uuid_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddUuidToApplicationSettings < ActiveRecord::Migration
+class AddUuidToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170329095325_add_ref_to_triggers.rb b/db/migrate/20170329095325_add_ref_to_triggers.rb
index 4aa52dd8f8f8f..db09b36db1713 100644
--- a/db/migrate/20170329095325_add_ref_to_triggers.rb
+++ b/db/migrate/20170329095325_add_ref_to_triggers.rb
@@ -1,4 +1,4 @@
-class AddRefToTriggers < ActiveRecord::Migration
+class AddRefToTriggers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170329095907_create_ci_trigger_schedules.rb b/db/migrate/20170329095907_create_ci_trigger_schedules.rb
index cfcfa27ebb538..7f759f908cd07 100644
--- a/db/migrate/20170329095907_create_ci_trigger_schedules.rb
+++ b/db/migrate/20170329095907_create_ci_trigger_schedules.rb
@@ -1,4 +1,4 @@
-class CreateCiTriggerSchedules < ActiveRecord::Migration
+class CreateCiTriggerSchedules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb b/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb
index a8affd19a0b48..17307879a2a6e 100644
--- a/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb
+++ b/db/migrate/20170329124448_add_polling_interval_multiplier_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPollingIntervalMultiplierToApplicationSettings < ActiveRecord::Migration
+class AddPollingIntervalMultiplierToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170330141723_disable_invalid_service_templates2.rb b/db/migrate/20170330141723_disable_invalid_service_templates2.rb
index 8424e56d8a180..91ec19dfa8764 100644
--- a/db/migrate/20170330141723_disable_invalid_service_templates2.rb
+++ b/db/migrate/20170330141723_disable_invalid_service_templates2.rb
@@ -1,7 +1,7 @@
 # This is the same as DisableInvalidServiceTemplates. Later migrations may have
 # inadventently enabled some invalid templates again.
 #
-class DisableInvalidServiceTemplates2 < ActiveRecord::Migration
+class DisableInvalidServiceTemplates2 < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   unless defined?(Service)
diff --git a/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb b/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
index 42c90103262ee..4c417ce2f7124 100644
--- a/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
+++ b/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
@@ -1,6 +1,6 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
-class RemoveIndexForUsersCurrentSignInAt < ActiveRecord::Migration
+class RemoveIndexForUsersCurrentSignInAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170404163427_add_trigger_id_foreign_key.rb b/db/migrate/20170404163427_add_trigger_id_foreign_key.rb
index 6679a95ca116c..f35730c8e4507 100644
--- a/db/migrate/20170404163427_add_trigger_id_foreign_key.rb
+++ b/db/migrate/20170404163427_add_trigger_id_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddTriggerIdForeignKey < ActiveRecord::Migration
+class AddTriggerIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170405080720_add_import_jid_to_projects.rb b/db/migrate/20170405080720_add_import_jid_to_projects.rb
index 55b87b9d56d0d..ddbea9d7ab6f1 100644
--- a/db/migrate/20170405080720_add_import_jid_to_projects.rb
+++ b/db/migrate/20170405080720_add_import_jid_to_projects.rb
@@ -1,4 +1,4 @@
-class AddImportJidToProjects < ActiveRecord::Migration
+class AddImportJidToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170406114958_add_auto_canceled_by_id_to_ci_builds.rb b/db/migrate/20170406114958_add_auto_canceled_by_id_to_ci_builds.rb
index c1d803b43084c..ba43a070587e2 100644
--- a/db/migrate/20170406114958_add_auto_canceled_by_id_to_ci_builds.rb
+++ b/db/migrate/20170406114958_add_auto_canceled_by_id_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddAutoCanceledByIdToCiBuilds < ActiveRecord::Migration
+class AddAutoCanceledByIdToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170406115029_add_auto_canceled_by_id_foreign_key_to_ci_builds.rb b/db/migrate/20170406115029_add_auto_canceled_by_id_foreign_key_to_ci_builds.rb
index 3004683933b15..2ec281e20c1b7 100644
--- a/db/migrate/20170406115029_add_auto_canceled_by_id_foreign_key_to_ci_builds.rb
+++ b/db/migrate/20170406115029_add_auto_canceled_by_id_foreign_key_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddAutoCanceledByIdForeignKeyToCiBuilds < ActiveRecord::Migration
+class AddAutoCanceledByIdForeignKeyToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170407114956_add_ref_to_ci_trigger_schedule.rb b/db/migrate/20170407114956_add_ref_to_ci_trigger_schedule.rb
index 523a306f12706..5d156b7ef2eee 100644
--- a/db/migrate/20170407114956_add_ref_to_ci_trigger_schedule.rb
+++ b/db/migrate/20170407114956_add_ref_to_ci_trigger_schedule.rb
@@ -1,4 +1,4 @@
-class AddRefToCiTriggerSchedule < ActiveRecord::Migration
+class AddRefToCiTriggerSchedule < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170407122426_add_active_to_ci_trigger_schedule.rb b/db/migrate/20170407122426_add_active_to_ci_trigger_schedule.rb
index 36892118ac071..33295bd3f2ef1 100644
--- a/db/migrate/20170407122426_add_active_to_ci_trigger_schedule.rb
+++ b/db/migrate/20170407122426_add_active_to_ci_trigger_schedule.rb
@@ -1,4 +1,4 @@
-class AddActiveToCiTriggerSchedule < ActiveRecord::Migration
+class AddActiveToCiTriggerSchedule < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170407135259_add_foreigh_key_trigger_requests_trigger.rb b/db/migrate/20170407135259_add_foreigh_key_trigger_requests_trigger.rb
index 81761c65a9fa0..9aaa4d0eddf31 100644
--- a/db/migrate/20170407135259_add_foreigh_key_trigger_requests_trigger.rb
+++ b/db/migrate/20170407135259_add_foreigh_key_trigger_requests_trigger.rb
@@ -1,4 +1,4 @@
-class AddForeighKeyTriggerRequestsTrigger < ActiveRecord::Migration
+class AddForeighKeyTriggerRequestsTrigger < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170407140450_add_index_to_next_run_at_and_active.rb b/db/migrate/20170407140450_add_index_to_next_run_at_and_active.rb
index 626c2a67fdcc0..0bde4f69b3bd9 100644
--- a/db/migrate/20170407140450_add_index_to_next_run_at_and_active.rb
+++ b/db/migrate/20170407140450_add_index_to_next_run_at_and_active.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexToNextRunAtAndActive < ActiveRecord::Migration
+class AddIndexToNextRunAtAndActive < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170410133135_add_version_field_to_markdown_cache.rb b/db/migrate/20170410133135_add_version_field_to_markdown_cache.rb
index d9209fe577033..c019e0627d3ac 100644
--- a/db/migrate/20170410133135_add_version_field_to_markdown_cache.rb
+++ b/db/migrate/20170410133135_add_version_field_to_markdown_cache.rb
@@ -1,4 +1,4 @@
-class AddVersionFieldToMarkdownCache < ActiveRecord::Migration
+class AddVersionFieldToMarkdownCache < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170413035209_add_preferred_language_to_users.rb b/db/migrate/20170413035209_add_preferred_language_to_users.rb
index 92f1d6f243633..5b5f00ea60fee 100644
--- a/db/migrate/20170413035209_add_preferred_language_to_users.rb
+++ b/db/migrate/20170413035209_add_preferred_language_to_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPreferredLanguageToUsers < ActiveRecord::Migration
+class AddPreferredLanguageToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170418103908_delete_orphan_notification_settings.rb b/db/migrate/20170418103908_delete_orphan_notification_settings.rb
index e4b9cf6593646..c99729b912750 100644
--- a/db/migrate/20170418103908_delete_orphan_notification_settings.rb
+++ b/db/migrate/20170418103908_delete_orphan_notification_settings.rb
@@ -1,4 +1,4 @@
-class DeleteOrphanNotificationSettings < ActiveRecord::Migration
+class DeleteOrphanNotificationSettings < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170419001229_add_index_to_system_note_metadata.rb b/db/migrate/20170419001229_add_index_to_system_note_metadata.rb
index c68fd920fff45..59cd55395fc66 100644
--- a/db/migrate/20170419001229_add_index_to_system_note_metadata.rb
+++ b/db/migrate/20170419001229_add_index_to_system_note_metadata.rb
@@ -1,4 +1,4 @@
-class AddIndexToSystemNoteMetadata < ActiveRecord::Migration
+class AddIndexToSystemNoteMetadata < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170421102337_remove_nil_type_services.rb b/db/migrate/20170421102337_remove_nil_type_services.rb
index b835b9c6ed992..561eddf69e058 100644
--- a/db/migrate/20170421102337_remove_nil_type_services.rb
+++ b/db/migrate/20170421102337_remove_nil_type_services.rb
@@ -1,4 +1,4 @@
-class RemoveNilTypeServices < ActiveRecord::Migration
+class RemoveNilTypeServices < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb b/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb
index 0bbb74ee05ef7..76252378c2e70 100644
--- a/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb
+++ b/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexOnCiBuildsUpdatedAt < ActiveRecord::Migration
+class AddIndexOnCiBuildsUpdatedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170424095707_add_index_on_ci_builds_user_id.rb b/db/migrate/20170424095707_add_index_on_ci_builds_user_id.rb
index 348d5dbc27052..ab2501da94172 100644
--- a/db/migrate/20170424095707_add_index_on_ci_builds_user_id.rb
+++ b/db/migrate/20170424095707_add_index_on_ci_builds_user_id.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexOnCiBuildsUserId < ActiveRecord::Migration
+class AddIndexOnCiBuildsUserId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170424142900_add_index_to_web_hooks_type.rb b/db/migrate/20170424142900_add_index_to_web_hooks_type.rb
index 9af158e3844da..1c56c1ed65a63 100644
--- a/db/migrate/20170424142900_add_index_to_web_hooks_type.rb
+++ b/db/migrate/20170424142900_add_index_to_web_hooks_type.rb
@@ -1,4 +1,4 @@
-class AddIndexToWebHooksType < ActiveRecord::Migration
+class AddIndexToWebHooksType < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170425112128_create_pipeline_schedules_table.rb b/db/migrate/20170425112128_create_pipeline_schedules_table.rb
index bd15b9eef19d5..e66e81b34bec3 100644
--- a/db/migrate/20170425112128_create_pipeline_schedules_table.rb
+++ b/db/migrate/20170425112128_create_pipeline_schedules_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreatePipelineSchedulesTable < ActiveRecord::Migration
+class CreatePipelineSchedulesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170425112628_remove_foreigh_key_ci_trigger_schedules.rb b/db/migrate/20170425112628_remove_foreigh_key_ci_trigger_schedules.rb
index 1587eee06ae2f..d89c4c61cbe5b 100644
--- a/db/migrate/20170425112628_remove_foreigh_key_ci_trigger_schedules.rb
+++ b/db/migrate/20170425112628_remove_foreigh_key_ci_trigger_schedules.rb
@@ -1,4 +1,4 @@
-class RemoveForeighKeyCiTriggerSchedules < ActiveRecord::Migration
+class RemoveForeighKeyCiTriggerSchedules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170425114731_add_pipeline_schedule_id_to_pipelines.rb b/db/migrate/20170425114731_add_pipeline_schedule_id_to_pipelines.rb
index ddb27d4dc8163..da16d89febc54 100644
--- a/db/migrate/20170425114731_add_pipeline_schedule_id_to_pipelines.rb
+++ b/db/migrate/20170425114731_add_pipeline_schedule_id_to_pipelines.rb
@@ -1,4 +1,4 @@
-class AddPipelineScheduleIdToPipelines < ActiveRecord::Migration
+class AddPipelineScheduleIdToPipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170426175636_fill_missing_uuid_on_application_settings.rb b/db/migrate/20170426175636_fill_missing_uuid_on_application_settings.rb
index 58ad2c64075e2..eeeb216f32cd1 100644
--- a/db/migrate/20170426175636_fill_missing_uuid_on_application_settings.rb
+++ b/db/migrate/20170426175636_fill_missing_uuid_on_application_settings.rb
@@ -1,4 +1,4 @@
-class FillMissingUuidOnApplicationSettings < ActiveRecord::Migration
+class FillMissingUuidOnApplicationSettings < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb b/db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb
index 879825a1934a2..e14b2eb4c8a5f 100644
--- a/db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb
+++ b/db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexOnCiRunnersContactedAt < ActiveRecord::Migration
+class AddIndexOnCiRunnersContactedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170427103502_create_web_hook_logs.rb b/db/migrate/20170427103502_create_web_hook_logs.rb
index 3643c52180c90..a7a061e7bae97 100644
--- a/db/migrate/20170427103502_create_web_hook_logs.rb
+++ b/db/migrate/20170427103502_create_web_hook_logs.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class CreateWebHookLogs < ActiveRecord::Migration
+class CreateWebHookLogs < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170427215854_create_redirect_routes.rb b/db/migrate/20170427215854_create_redirect_routes.rb
index 6db508e5db452..069c9b39d3705 100644
--- a/db/migrate/20170427215854_create_redirect_routes.rb
+++ b/db/migrate/20170427215854_create_redirect_routes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateRedirectRoutes < ActiveRecord::Migration
+class CreateRedirectRoutes < ActiveRecord::Migration[4.2]
   # Set this constant to true if this migration requires downtime.
   DOWNTIME = false
 
diff --git a/db/migrate/20170428064307_add_column_delete_error_to_projects.rb b/db/migrate/20170428064307_add_column_delete_error_to_projects.rb
index 09f9d9b5b7a9e..bef0373309cfc 100644
--- a/db/migrate/20170428064307_add_column_delete_error_to_projects.rb
+++ b/db/migrate/20170428064307_add_column_delete_error_to_projects.rb
@@ -1,4 +1,4 @@
-class AddColumnDeleteErrorToProjects < ActiveRecord::Migration
+class AddColumnDeleteErrorToProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb b/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb
index 03bf626a08a4b..e51a790de4dfc 100644
--- a/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb
+++ b/db/migrate/20170502065653_make_auto_cancel_pending_pipelines_on_by_default.rb
@@ -1,4 +1,4 @@
-class MakeAutoCancelPendingPipelinesOnByDefault < ActiveRecord::Migration
+class MakeAutoCancelPendingPipelinesOnByDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170502135553_create_index_ci_pipelines_auto_canceled_by_id.rb b/db/migrate/20170502135553_create_index_ci_pipelines_auto_canceled_by_id.rb
index b64d7e0e3f6ef..7acae645c7b54 100644
--- a/db/migrate/20170502135553_create_index_ci_pipelines_auto_canceled_by_id.rb
+++ b/db/migrate/20170502135553_create_index_ci_pipelines_auto_canceled_by_id.rb
@@ -1,4 +1,4 @@
-class CreateIndexCiPipelinesAutoCanceledById < ActiveRecord::Migration
+class CreateIndexCiPipelinesAutoCanceledById < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170502140503_create_index_ci_builds_auto_canceled_by_id.rb b/db/migrate/20170502140503_create_index_ci_builds_auto_canceled_by_id.rb
index 0a8d2c8ff61ea..f5148f6fdb802 100644
--- a/db/migrate/20170502140503_create_index_ci_builds_auto_canceled_by_id.rb
+++ b/db/migrate/20170502140503_create_index_ci_builds_auto_canceled_by_id.rb
@@ -1,4 +1,4 @@
-class CreateIndexCiBuildsAutoCanceledById < ActiveRecord::Migration
+class CreateIndexCiBuildsAutoCanceledById < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb b/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb
index 2ea49f627428f..303250ff3b02d 100644
--- a/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb
+++ b/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddLastRepositoryUpdatedAtToProjects < ActiveRecord::Migration
+class AddLastRepositoryUpdatedAtToProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb b/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb
index 6144d74745c8b..ae54cfb39f5bf 100644
--- a/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb
+++ b/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb
@@ -1,4 +1,4 @@
-class AddIndexToLastRepositoryUpdatedAtOnProjects < ActiveRecord::Migration
+class AddIndexToLastRepositoryUpdatedAtOnProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170503004426_add_retried_to_ci_build.rb b/db/migrate/20170503004426_add_retried_to_ci_build.rb
index 2851e3de47303..ff2e0ba64c50e 100644
--- a/db/migrate/20170503004426_add_retried_to_ci_build.rb
+++ b/db/migrate/20170503004426_add_retried_to_ci_build.rb
@@ -1,4 +1,4 @@
-class AddRetriedToCiBuild < ActiveRecord::Migration
+class AddRetriedToCiBuild < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170503021915_add_last_edited_at_and_last_edited_by_id_to_issues.rb b/db/migrate/20170503021915_add_last_edited_at_and_last_edited_by_id_to_issues.rb
index a5d1eca82bbd8..ef527bb8007b6 100644
--- a/db/migrate/20170503021915_add_last_edited_at_and_last_edited_by_id_to_issues.rb
+++ b/db/migrate/20170503021915_add_last_edited_at_and_last_edited_by_id_to_issues.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLastEditedAtAndLastEditedByIdToIssues < ActiveRecord::Migration
+class AddLastEditedAtAndLastEditedByIdToIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170503022548_add_last_edited_at_and_last_edited_by_id_to_merge_requests.rb b/db/migrate/20170503022548_add_last_edited_at_and_last_edited_by_id_to_merge_requests.rb
index 47ba6bde85613..19b8a9d66e70a 100644
--- a/db/migrate/20170503022548_add_last_edited_at_and_last_edited_by_id_to_merge_requests.rb
+++ b/db/migrate/20170503022548_add_last_edited_at_and_last_edited_by_id_to_merge_requests.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLastEditedAtAndLastEditedByIdToMergeRequests < ActiveRecord::Migration
+class AddLastEditedAtAndLastEditedByIdToMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170503023315_add_repository_update_events_to_web_hooks.rb b/db/migrate/20170503023315_add_repository_update_events_to_web_hooks.rb
index 0faea87a962e3..4824c404ec781 100644
--- a/db/migrate/20170503023315_add_repository_update_events_to_web_hooks.rb
+++ b/db/migrate/20170503023315_add_repository_update_events_to_web_hooks.rb
@@ -1,4 +1,4 @@
-class AddRepositoryUpdateEventsToWebHooks < ActiveRecord::Migration
+class AddRepositoryUpdateEventsToWebHooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170503114228_add_description_to_snippets.rb b/db/migrate/20170503114228_add_description_to_snippets.rb
index 3fc960b2da5b8..78151ed9ff645 100644
--- a/db/migrate/20170503114228_add_description_to_snippets.rb
+++ b/db/migrate/20170503114228_add_description_to_snippets.rb
@@ -1,4 +1,4 @@
-class AddDescriptionToSnippets < ActiveRecord::Migration
+class AddDescriptionToSnippets < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170503140201_reschedule_project_authorizations.rb b/db/migrate/20170503140201_reschedule_project_authorizations.rb
index fa45adadbae80..aa940bed2d32a 100644
--- a/db/migrate/20170503140201_reschedule_project_authorizations.rb
+++ b/db/migrate/20170503140201_reschedule_project_authorizations.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RescheduleProjectAuthorizations < ActiveRecord::Migration
+class RescheduleProjectAuthorizations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb b/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
index 33908ae115630..cfa63b65df457 100644
--- a/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
+++ b/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
@@ -5,7 +5,7 @@
 # updating a namespace to also rename directories (uploads, GitLab pages, etc).
 # The alternative is to copy hundreds of lines of code into this migration,
 # adjust them where needed, etc; something which doesn't work well at all.
-class TurnNestedGroupsIntoRegularGroupsForMysql < ActiveRecord::Migration
+class TurnNestedGroupsIntoRegularGroupsForMysql < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170503184421_add_index_to_redirect_routes.rb b/db/migrate/20170503184421_add_index_to_redirect_routes.rb
index 9062cf19a7398..6320d4bbc99a8 100644
--- a/db/migrate/20170503184421_add_index_to_redirect_routes.rb
+++ b/db/migrate/20170503184421_add_index_to_redirect_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexToRedirectRoutes < ActiveRecord::Migration
+class AddIndexToRedirectRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170503185032_index_redirect_routes_path_for_like.rb b/db/migrate/20170503185032_index_redirect_routes_path_for_like.rb
index 8eb20faa03af5..5d06fd0511cea 100644
--- a/db/migrate/20170503185032_index_redirect_routes_path_for_like.rb
+++ b/db/migrate/20170503185032_index_redirect_routes_path_for_like.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class IndexRedirectRoutesPathForLike < ActiveRecord::Migration
+class IndexRedirectRoutesPathForLike < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170504102911_add_clientside_sentry_to_application_settings.rb b/db/migrate/20170504102911_add_clientside_sentry_to_application_settings.rb
index 141112f8b5084..4659f6940209c 100644
--- a/db/migrate/20170504102911_add_clientside_sentry_to_application_settings.rb
+++ b/db/migrate/20170504102911_add_clientside_sentry_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddClientsideSentryToApplicationSettings < ActiveRecord::Migration
+class AddClientsideSentryToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170504182103_add_index_project_group_links_group_id.rb b/db/migrate/20170504182103_add_index_project_group_links_group_id.rb
index 62bf641daa6ab..5b1c14e66ddd2 100644
--- a/db/migrate/20170504182103_add_index_project_group_links_group_id.rb
+++ b/db/migrate/20170504182103_add_index_project_group_links_group_id.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexProjectGroupLinksGroupId < ActiveRecord::Migration
+class AddIndexProjectGroupLinksGroupId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170506085040_add_index_to_pipeline_pipeline_schedule_id.rb b/db/migrate/20170506085040_add_index_to_pipeline_pipeline_schedule_id.rb
index 08a7f3fc9abb7..9d8cc8a83a29f 100644
--- a/db/migrate/20170506085040_add_index_to_pipeline_pipeline_schedule_id.rb
+++ b/db/migrate/20170506085040_add_index_to_pipeline_pipeline_schedule_id.rb
@@ -1,4 +1,4 @@
-class AddIndexToPipelinePipelineScheduleId < ActiveRecord::Migration
+class AddIndexToPipelinePipelineScheduleId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170506091344_add_foreign_key_to_pipeline_schedules.rb b/db/migrate/20170506091344_add_foreign_key_to_pipeline_schedules.rb
index 7f2dba702af58..244e41e2f0766 100644
--- a/db/migrate/20170506091344_add_foreign_key_to_pipeline_schedules.rb
+++ b/db/migrate/20170506091344_add_foreign_key_to_pipeline_schedules.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToPipelineSchedules < ActiveRecord::Migration
+class AddForeignKeyToPipelineSchedules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170506185517_add_foreign_key_pipeline_schedules_and_pipelines.rb b/db/migrate/20170506185517_add_foreign_key_pipeline_schedules_and_pipelines.rb
index cc5cb355579a1..50364cac2590e 100644
--- a/db/migrate/20170506185517_add_foreign_key_pipeline_schedules_and_pipelines.rb
+++ b/db/migrate/20170506185517_add_foreign_key_pipeline_schedules_and_pipelines.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyPipelineSchedulesAndPipelines < ActiveRecord::Migration
+class AddForeignKeyPipelineSchedulesAndPipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170507205316_add_head_pipeline_id_to_merge_requests.rb b/db/migrate/20170507205316_add_head_pipeline_id_to_merge_requests.rb
index 8fc6e380a77b4..adfe6559084d8 100644
--- a/db/migrate/20170507205316_add_head_pipeline_id_to_merge_requests.rb
+++ b/db/migrate/20170507205316_add_head_pipeline_id_to_merge_requests.rb
@@ -1,4 +1,4 @@
-class AddHeadPipelineIdToMergeRequests < ActiveRecord::Migration
+class AddHeadPipelineIdToMergeRequests < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170508153950_add_not_null_contraints_to_ci_variables.rb b/db/migrate/20170508153950_add_not_null_contraints_to_ci_variables.rb
index 41c687a4f6e74..2a0c7132bfd6a 100644
--- a/db/migrate/20170508153950_add_not_null_contraints_to_ci_variables.rb
+++ b/db/migrate/20170508153950_add_not_null_contraints_to_ci_variables.rb
@@ -1,4 +1,4 @@
-class AddNotNullContraintsToCiVariables < ActiveRecord::Migration
+class AddNotNullContraintsToCiVariables < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb b/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb
index 20ecaa2c36c2a..305366b2171f6 100644
--- a/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb
+++ b/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToCiVariables < ActiveRecord::Migration
+class AddForeignKeyToCiVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170511082759_rename_web_hooks_build_events_to_job_events.rb b/db/migrate/20170511082759_rename_web_hooks_build_events_to_job_events.rb
index a2320a911b74c..3a44057d94888 100644
--- a/db/migrate/20170511082759_rename_web_hooks_build_events_to_job_events.rb
+++ b/db/migrate/20170511082759_rename_web_hooks_build_events_to_job_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameWebHooksBuildEventsToJobEvents < ActiveRecord::Migration
+class RenameWebHooksBuildEventsToJobEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170511083824_rename_services_build_events_to_job_events.rb b/db/migrate/20170511083824_rename_services_build_events_to_job_events.rb
index 303d47078e714..713adde76ef7d 100644
--- a/db/migrate/20170511083824_rename_services_build_events_to_job_events.rb
+++ b/db/migrate/20170511083824_rename_services_build_events_to_job_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameServicesBuildEventsToJobEvents < ActiveRecord::Migration
+class RenameServicesBuildEventsToJobEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb b/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb
index eed9f00d8b283..0ed4577542143 100644
--- a/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb
+++ b/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateAssigneeToSeparateTable < ActiveRecord::Migration
+class MigrateAssigneeToSeparateTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170516183131_add_indices_to_issue_assignees.rb b/db/migrate/20170516183131_add_indices_to_issue_assignees.rb
index a1f064c684836..6877fe9ff98b0 100644
--- a/db/migrate/20170516183131_add_indices_to_issue_assignees.rb
+++ b/db/migrate/20170516183131_add_indices_to_issue_assignees.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndicesToIssueAssignees < ActiveRecord::Migration
+class AddIndicesToIssueAssignees < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170519102115_add_prometheus_settings_to_metrics_settings.rb b/db/migrate/20170519102115_add_prometheus_settings_to_metrics_settings.rb
index 6ec2ed712b969..9c8f58104bdca 100644
--- a/db/migrate/20170519102115_add_prometheus_settings_to_metrics_settings.rb
+++ b/db/migrate/20170519102115_add_prometheus_settings_to_metrics_settings.rb
@@ -1,4 +1,4 @@
-class AddPrometheusSettingsToMetricsSettings < ActiveRecord::Migration
+class AddPrometheusSettingsToMetricsSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20170521184006_add_change_position_to_notes.rb b/db/migrate/20170521184006_add_change_position_to_notes.rb
index 219ed1ade4c1b..f0ca3a2a9eac8 100644
--- a/db/migrate/20170521184006_add_change_position_to_notes.rb
+++ b/db/migrate/20170521184006_add_change_position_to_notes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddChangePositionToNotes < ActiveRecord::Migration
+class AddChangePositionToNotes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170523091700_add_rss_token_to_users.rb b/db/migrate/20170523091700_add_rss_token_to_users.rb
index 06a85f6ac3d4f..e1bcd9b3fee3b 100644
--- a/db/migrate/20170523091700_add_rss_token_to_users.rb
+++ b/db/migrate/20170523091700_add_rss_token_to_users.rb
@@ -1,4 +1,4 @@
-class AddRssTokenToUsers < ActiveRecord::Migration
+class AddRssTokenToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170523121229_create_conversational_development_index_metrics.rb b/db/migrate/20170523121229_create_conversational_development_index_metrics.rb
index 7026a867ae164..5f8c0d07e3c33 100644
--- a/db/migrate/20170523121229_create_conversational_development_index_metrics.rb
+++ b/db/migrate/20170523121229_create_conversational_development_index_metrics.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateConversationalDevelopmentIndexMetrics < ActiveRecord::Migration
+class CreateConversationalDevelopmentIndexMetrics < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170524125940_add_source_to_ci_pipeline.rb b/db/migrate/20170524125940_add_source_to_ci_pipeline.rb
index 1fa3d48037be8..81358e7ce3d96 100644
--- a/db/migrate/20170524125940_add_source_to_ci_pipeline.rb
+++ b/db/migrate/20170524125940_add_source_to_ci_pipeline.rb
@@ -1,4 +1,4 @@
-class AddSourceToCiPipeline < ActiveRecord::Migration
+class AddSourceToCiPipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170524161101_add_protected_to_ci_variables.rb b/db/migrate/20170524161101_add_protected_to_ci_variables.rb
index 99d4861e88992..6125ea5d5a82c 100644
--- a/db/migrate/20170524161101_add_protected_to_ci_variables.rb
+++ b/db/migrate/20170524161101_add_protected_to_ci_variables.rb
@@ -1,4 +1,4 @@
-class AddProtectedToCiVariables < ActiveRecord::Migration
+class AddProtectedToCiVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170525130346_create_group_variables_table.rb b/db/migrate/20170525130346_create_group_variables_table.rb
index eaa38dbc40d46..6eae7eff7bde0 100644
--- a/db/migrate/20170525130346_create_group_variables_table.rb
+++ b/db/migrate/20170525130346_create_group_variables_table.rb
@@ -1,4 +1,4 @@
-class CreateGroupVariablesTable < ActiveRecord::Migration
+class CreateGroupVariablesTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170525130758_add_foreign_key_to_group_variables.rb b/db/migrate/20170525130758_add_foreign_key_to_group_variables.rb
index 0146235c5baa9..f1f51a1dda3e5 100644
--- a/db/migrate/20170525130758_add_foreign_key_to_group_variables.rb
+++ b/db/migrate/20170525130758_add_foreign_key_to_group_variables.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToGroupVariables < ActiveRecord::Migration
+class AddForeignKeyToGroupVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170525132202_create_pipeline_stages.rb b/db/migrate/20170525132202_create_pipeline_stages.rb
index 825993aa41e43..0a6400fde903b 100644
--- a/db/migrate/20170525132202_create_pipeline_stages.rb
+++ b/db/migrate/20170525132202_create_pipeline_stages.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreatePipelineStages < ActiveRecord::Migration
+class CreatePipelineStages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170525174156_create_feature_tables.rb b/db/migrate/20170525174156_create_feature_tables.rb
index a083c89c85f76..e1eaaff8d3539 100644
--- a/db/migrate/20170525174156_create_feature_tables.rb
+++ b/db/migrate/20170525174156_create_feature_tables.rb
@@ -1,4 +1,4 @@
-class CreateFeatureTables < ActiveRecord::Migration
+class CreateFeatureTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb b/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb
index d27cba76d8199..6958557d11844 100644
--- a/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb
+++ b/db/migrate/20170526185602_add_stage_id_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddStageIdToCiBuilds < ActiveRecord::Migration
+class AddStageIdToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170530130129_project_foreign_keys_with_cascading_deletes.rb b/db/migrate/20170530130129_project_foreign_keys_with_cascading_deletes.rb
index 12352d98a6278..d40c61f24b114 100644
--- a/db/migrate/20170530130129_project_foreign_keys_with_cascading_deletes.rb
+++ b/db/migrate/20170530130129_project_foreign_keys_with_cascading_deletes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ProjectForeignKeysWithCascadingDeletes < ActiveRecord::Migration
+class ProjectForeignKeysWithCascadingDeletes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170531180233_add_authorized_keys_enabled_to_application_settings.rb b/db/migrate/20170531180233_add_authorized_keys_enabled_to_application_settings.rb
index 1d86a531eb3dc..f440609ff8a3f 100644
--- a/db/migrate/20170531180233_add_authorized_keys_enabled_to_application_settings.rb
+++ b/db/migrate/20170531180233_add_authorized_keys_enabled_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddAuthorizedKeysEnabledToApplicationSettings < ActiveRecord::Migration
+class AddAuthorizedKeysEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb b/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb
index f858611d24b66..7b1a764455535 100644
--- a/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb
+++ b/db/migrate/20170531202042_rename_users_ldap_email_to_external_email.rb
@@ -1,4 +1,4 @@
-class RenameUsersLdapEmailToExternalEmail < ActiveRecord::Migration
+class RenameUsersLdapEmailToExternalEmail < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb b/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb
index e82109190a72b..4c9ac821b2095 100644
--- a/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb
+++ b/db/migrate/20170601163708_add_artifacts_store_to_ci_build.rb
@@ -1,4 +1,4 @@
-class AddArtifactsStoreToCiBuild < ActiveRecord::Migration
+class AddArtifactsStoreToCiBuild < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170602154736_add_help_page_hide_commercial_content_to_application_settings.rb b/db/migrate/20170602154736_add_help_page_hide_commercial_content_to_application_settings.rb
index d358020d182f4..ff9e188d7a849 100644
--- a/db/migrate/20170602154736_add_help_page_hide_commercial_content_to_application_settings.rb
+++ b/db/migrate/20170602154736_add_help_page_hide_commercial_content_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/SaferBooleanColumn
-class AddHelpPageHideCommercialContentToApplicationSettings < ActiveRecord::Migration
+class AddHelpPageHideCommercialContentToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170602154813_add_help_page_support_url_to_application_settings.rb b/db/migrate/20170602154813_add_help_page_support_url_to_application_settings.rb
index 138fe9b2a37b4..388e130ab88d8 100644
--- a/db/migrate/20170602154813_add_help_page_support_url_to_application_settings.rb
+++ b/db/migrate/20170602154813_add_help_page_support_url_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddHelpPageSupportUrlToApplicationSettings < ActiveRecord::Migration
+class AddHelpPageSupportUrlToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170603200744_add_email_provider_to_users.rb b/db/migrate/20170603200744_add_email_provider_to_users.rb
index ed90af9aadc63..ad6e813d31b6a 100644
--- a/db/migrate/20170603200744_add_email_provider_to_users.rb
+++ b/db/migrate/20170603200744_add_email_provider_to_users.rb
@@ -1,4 +1,4 @@
-class AddEmailProviderToUsers < ActiveRecord::Migration
+class AddEmailProviderToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170606154216_add_notification_setting_columns.rb b/db/migrate/20170606154216_add_notification_setting_columns.rb
index 0a9b5da658383..3b9493e6b497d 100644
--- a/db/migrate/20170606154216_add_notification_setting_columns.rb
+++ b/db/migrate/20170606154216_add_notification_setting_columns.rb
@@ -1,4 +1,4 @@
-class AddNotificationSettingColumns < ActiveRecord::Migration
+class AddNotificationSettingColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170608152747_prepare_events_table_for_push_events_migration.rb b/db/migrate/20170608152747_prepare_events_table_for_push_events_migration.rb
index f4f03bbabaf79..851af7f7bf6aa 100644
--- a/db/migrate/20170608152747_prepare_events_table_for_push_events_migration.rb
+++ b/db/migrate/20170608152747_prepare_events_table_for_push_events_migration.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PrepareEventsTableForPushEventsMigration < ActiveRecord::Migration
+class PrepareEventsTableForPushEventsMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170608152748_create_push_event_payloads_tables.rb b/db/migrate/20170608152748_create_push_event_payloads_tables.rb
index 6c55ad1f2f7a9..292d9e3ca06e2 100644
--- a/db/migrate/20170608152748_create_push_event_payloads_tables.rb
+++ b/db/migrate/20170608152748_create_push_event_payloads_tables.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreatePushEventPayloadsTables < ActiveRecord::Migration
+class CreatePushEventPayloadsTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170608171156_create_merge_request_diff_files.rb b/db/migrate/20170608171156_create_merge_request_diff_files.rb
index bf0c0d29adcb4..94b518455ee33 100644
--- a/db/migrate/20170608171156_create_merge_request_diff_files.rb
+++ b/db/migrate/20170608171156_create_merge_request_diff_files.rb
@@ -1,4 +1,4 @@
-class CreateMergeRequestDiffFiles < ActiveRecord::Migration
+class CreateMergeRequestDiffFiles < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/db/migrate/20170613154149_create_gpg_signatures.rb b/db/migrate/20170613154149_create_gpg_signatures.rb
index abef13a7a0b64..181d35fe7af3e 100644
--- a/db/migrate/20170613154149_create_gpg_signatures.rb
+++ b/db/migrate/20170613154149_create_gpg_signatures.rb
@@ -1,4 +1,4 @@
-class CreateGpgSignatures < ActiveRecord::Migration
+class CreateGpgSignatures < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170616133147_create_merge_request_diff_commits.rb b/db/migrate/20170616133147_create_merge_request_diff_commits.rb
index 616464cb470e8..5e148affba2ae 100644
--- a/db/migrate/20170616133147_create_merge_request_diff_commits.rb
+++ b/db/migrate/20170616133147_create_merge_request_diff_commits.rb
@@ -1,4 +1,4 @@
-class CreateMergeRequestDiffCommits < ActiveRecord::Migration
+class CreateMergeRequestDiffCommits < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb b/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb
index 02863bee08255..f97c8a14b8d3a 100644
--- a/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb
+++ b/db/migrate/20170619144837_add_index_for_head_pipeline_merge_request.rb
@@ -1,4 +1,4 @@
-class AddIndexForHeadPipelineMergeRequest < ActiveRecord::Migration
+class AddIndexForHeadPipelineMergeRequest < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170620064728_create_ci_pipeline_schedule_variables.rb b/db/migrate/20170620064728_create_ci_pipeline_schedule_variables.rb
index 92833765a8274..74f3603505b17 100644
--- a/db/migrate/20170620064728_create_ci_pipeline_schedule_variables.rb
+++ b/db/migrate/20170620064728_create_ci_pipeline_schedule_variables.rb
@@ -1,4 +1,4 @@
-class CreateCiPipelineScheduleVariables < ActiveRecord::Migration
+class CreateCiPipelineScheduleVariables < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170620065449_add_foreign_key_to_ci_pipeline_schedule_variables.rb b/db/migrate/20170620065449_add_foreign_key_to_ci_pipeline_schedule_variables.rb
index 7bbf66e0ac392..f6de19aeaf29b 100644
--- a/db/migrate/20170620065449_add_foreign_key_to_ci_pipeline_schedule_variables.rb
+++ b/db/migrate/20170620065449_add_foreign_key_to_ci_pipeline_schedule_variables.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToCiPipelineScheduleVariables < ActiveRecord::Migration
+class AddForeignKeyToCiPipelineScheduleVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170622130029_correct_protected_branches_foreign_keys.rb b/db/migrate/20170622130029_correct_protected_branches_foreign_keys.rb
index 4649777552727..c4ba3ec2cc068 100644
--- a/db/migrate/20170622130029_correct_protected_branches_foreign_keys.rb
+++ b/db/migrate/20170622130029_correct_protected_branches_foreign_keys.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CorrectProtectedBranchesForeignKeys < ActiveRecord::Migration
+class CorrectProtectedBranchesForeignKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170622132212_add_foreign_key_for_merge_request_diffs.rb b/db/migrate/20170622132212_add_foreign_key_for_merge_request_diffs.rb
index 9f524fac8a7b0..b826f67ff39e8 100644
--- a/db/migrate/20170622132212_add_foreign_key_for_merge_request_diffs.rb
+++ b/db/migrate/20170622132212_add_foreign_key_for_merge_request_diffs.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddForeignKeyForMergeRequestDiffs < ActiveRecord::Migration
+class AddForeignKeyForMergeRequestDiffs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170622135451_rename_duplicated_variable_key.rb b/db/migrate/20170622135451_rename_duplicated_variable_key.rb
index 368718ab0ce78..06a9529ae7973 100644
--- a/db/migrate/20170622135451_rename_duplicated_variable_key.rb
+++ b/db/migrate/20170622135451_rename_duplicated_variable_key.rb
@@ -1,4 +1,4 @@
-class RenameDuplicatedVariableKey < ActiveRecord::Migration
+class RenameDuplicatedVariableKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170622135628_add_environment_scope_to_ci_variables.rb b/db/migrate/20170622135628_add_environment_scope_to_ci_variables.rb
index 17fe062d8d592..8fbb2ab57d5c0 100644
--- a/db/migrate/20170622135628_add_environment_scope_to_ci_variables.rb
+++ b/db/migrate/20170622135628_add_environment_scope_to_ci_variables.rb
@@ -1,4 +1,4 @@
-class AddEnvironmentScopeToCiVariables < ActiveRecord::Migration
+class AddEnvironmentScopeToCiVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170622135728_add_unique_constraint_to_ci_variables.rb b/db/migrate/20170622135728_add_unique_constraint_to_ci_variables.rb
index 787022b7bfe36..240f55766d367 100644
--- a/db/migrate/20170622135728_add_unique_constraint_to_ci_variables.rb
+++ b/db/migrate/20170622135728_add_unique_constraint_to_ci_variables.rb
@@ -1,4 +1,4 @@
-class AddUniqueConstraintToCiVariables < ActiveRecord::Migration
+class AddUniqueConstraintToCiVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170622162730_add_ref_fetched_to_merge_request.rb b/db/migrate/20170622162730_add_ref_fetched_to_merge_request.rb
index 62aa1a4b4f05f..4715ff7a7156b 100644
--- a/db/migrate/20170622162730_add_ref_fetched_to_merge_request.rb
+++ b/db/migrate/20170622162730_add_ref_fetched_to_merge_request.rb
@@ -1,4 +1,4 @@
-class AddRefFetchedToMergeRequest < ActiveRecord::Migration
+class AddRefFetchedToMergeRequest < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb b/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb
index ddcc0292b9d66..861dbd2ee142a 100644
--- a/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb
+++ b/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb
@@ -1,4 +1,4 @@
-class RemoveCiVariablesProjectIdIndex < ActiveRecord::Migration
+class RemoveCiVariablesProjectIdIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170629171610_rename_application_settings_signin_enabled_to_password_authentication_enabled.rb b/db/migrate/20170629171610_rename_application_settings_signin_enabled_to_password_authentication_enabled.rb
index 858b3bebace58..1651a47ebec4a 100644
--- a/db/migrate/20170629171610_rename_application_settings_signin_enabled_to_password_authentication_enabled.rb
+++ b/db/migrate/20170629171610_rename_application_settings_signin_enabled_to_password_authentication_enabled.rb
@@ -1,4 +1,4 @@
-class RenameApplicationSettingsSigninEnabledToPasswordAuthenticationEnabled < ActiveRecord::Migration
+class RenameApplicationSettingsSigninEnabledToPasswordAuthenticationEnabled < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170703102400_add_stage_id_foreign_key_to_builds.rb b/db/migrate/20170703102400_add_stage_id_foreign_key_to_builds.rb
index a89d348b127fe..36ac360fb0b9a 100644
--- a/db/migrate/20170703102400_add_stage_id_foreign_key_to_builds.rb
+++ b/db/migrate/20170703102400_add_stage_id_foreign_key_to_builds.rb
@@ -1,4 +1,4 @@
-class AddStageIdForeignKeyToBuilds < ActiveRecord::Migration
+class AddStageIdForeignKeyToBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170706151212_add_performance_bar_allowed_group_id_to_application_settings.rb b/db/migrate/20170706151212_add_performance_bar_allowed_group_id_to_application_settings.rb
index fe9970ddc71e7..61416f74b6372 100644
--- a/db/migrate/20170706151212_add_performance_bar_allowed_group_id_to_application_settings.rb
+++ b/db/migrate/20170706151212_add_performance_bar_allowed_group_id_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddPerformanceBarAllowedGroupIdToApplicationSettings < ActiveRecord::Migration
+class AddPerformanceBarAllowedGroupIdToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170707183807_add_group_id_to_milestones.rb b/db/migrate/20170707183807_add_group_id_to_milestones.rb
index 675ffd4a1c92f..e778a30192f71 100644
--- a/db/migrate/20170707183807_add_group_id_to_milestones.rb
+++ b/db/migrate/20170707183807_add_group_id_to_milestones.rb
@@ -1,4 +1,4 @@
-class AddGroupIdToMilestones < ActiveRecord::Migration
+class AddGroupIdToMilestones < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170707184243_add_group_milestone_id_indexes.rb b/db/migrate/20170707184243_add_group_milestone_id_indexes.rb
index aa48fe90cadb6..545ee070194c3 100644
--- a/db/migrate/20170707184243_add_group_milestone_id_indexes.rb
+++ b/db/migrate/20170707184243_add_group_milestone_id_indexes.rb
@@ -1,4 +1,4 @@
-class AddGroupMilestoneIdIndexes < ActiveRecord::Migration
+class AddGroupMilestoneIdIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20170707184244_remove_wrong_versions_from_schema_versions.rb b/db/migrate/20170707184244_remove_wrong_versions_from_schema_versions.rb
index 38536a8b06a23..f99206c7f7831 100644
--- a/db/migrate/20170707184244_remove_wrong_versions_from_schema_versions.rb
+++ b/db/migrate/20170707184244_remove_wrong_versions_from_schema_versions.rb
@@ -1,4 +1,4 @@
-class RemoveWrongVersionsFromSchemaVersions < ActiveRecord::Migration
+class RemoveWrongVersionsFromSchemaVersions < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170710083355_clean_stage_id_reference_migration.rb b/db/migrate/20170710083355_clean_stage_id_reference_migration.rb
index 681203eaf400c..d33c6f53b158c 100644
--- a/db/migrate/20170710083355_clean_stage_id_reference_migration.rb
+++ b/db/migrate/20170710083355_clean_stage_id_reference_migration.rb
@@ -1,4 +1,4 @@
-class CleanStageIdReferenceMigration < ActiveRecord::Migration
+class CleanStageIdReferenceMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170711145320_add_status_to_ci_stages.rb b/db/migrate/20170711145320_add_status_to_ci_stages.rb
index d497a61a9591a..3ea7b75088221 100644
--- a/db/migrate/20170711145320_add_status_to_ci_stages.rb
+++ b/db/migrate/20170711145320_add_status_to_ci_stages.rb
@@ -1,4 +1,4 @@
-class AddStatusToCiStages < ActiveRecord::Migration
+class AddStatusToCiStages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170713104829_add_foreign_key_to_merge_requests.rb b/db/migrate/20170713104829_add_foreign_key_to_merge_requests.rb
index c409915ceedb2..908b122c659ef 100644
--- a/db/migrate/20170713104829_add_foreign_key_to_merge_requests.rb
+++ b/db/migrate/20170713104829_add_foreign_key_to_merge_requests.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToMergeRequests < ActiveRecord::Migration
+class AddForeignKeyToMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170717074009_move_system_upload_folder.rb b/db/migrate/20170717074009_move_system_upload_folder.rb
index d3caa53a7a414..6c57a751c8d51 100644
--- a/db/migrate/20170717074009_move_system_upload_folder.rb
+++ b/db/migrate/20170717074009_move_system_upload_folder.rb
@@ -1,4 +1,4 @@
-class MoveSystemUploadFolder < ActiveRecord::Migration
+class MoveSystemUploadFolder < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170717200542_add_trusted_column_to_oauth_applications.rb b/db/migrate/20170717200542_add_trusted_column_to_oauth_applications.rb
index 1a013e6aefb39..d9ae86f6c52d6 100644
--- a/db/migrate/20170717200542_add_trusted_column_to_oauth_applications.rb
+++ b/db/migrate/20170717200542_add_trusted_column_to_oauth_applications.rb
@@ -1,4 +1,4 @@
-class AddTrustedColumnToOauthApplications < ActiveRecord::Migration
+class AddTrustedColumnToOauthApplications < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170720111708_add_lock_version_to_ci_stages.rb b/db/migrate/20170720111708_add_lock_version_to_ci_stages.rb
index e1c4f0332864d..a5caca7e80cb7 100644
--- a/db/migrate/20170720111708_add_lock_version_to_ci_stages.rb
+++ b/db/migrate/20170720111708_add_lock_version_to_ci_stages.rb
@@ -1,4 +1,4 @@
-class AddLockVersionToCiStages < ActiveRecord::Migration
+class AddLockVersionToCiStages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170720122741_create_user_custom_attributes.rb b/db/migrate/20170720122741_create_user_custom_attributes.rb
index b1c0bebc633c1..0e6f37d73174c 100644
--- a/db/migrate/20170720122741_create_user_custom_attributes.rb
+++ b/db/migrate/20170720122741_create_user_custom_attributes.rb
@@ -1,4 +1,4 @@
-class CreateUserCustomAttributes < ActiveRecord::Migration
+class CreateUserCustomAttributes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170720130522_create_ci_pipeline_variables.rb b/db/migrate/20170720130522_create_ci_pipeline_variables.rb
index a784f5dd14239..4f162d46cf549 100644
--- a/db/migrate/20170720130522_create_ci_pipeline_variables.rb
+++ b/db/migrate/20170720130522_create_ci_pipeline_variables.rb
@@ -1,4 +1,4 @@
-class CreateCiPipelineVariables < ActiveRecord::Migration
+class CreateCiPipelineVariables < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170720130749_add_foreign_key_to_ci_pipeline_variables.rb b/db/migrate/20170720130749_add_foreign_key_to_ci_pipeline_variables.rb
index 550b8a88f020f..df9350d9ad5a2 100644
--- a/db/migrate/20170720130749_add_foreign_key_to_ci_pipeline_variables.rb
+++ b/db/migrate/20170720130749_add_foreign_key_to_ci_pipeline_variables.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToCiPipelineVariables < ActiveRecord::Migration
+class AddForeignKeyToCiPipelineVariables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170724214302_add_lower_path_index_to_redirect_routes.rb b/db/migrate/20170724214302_add_lower_path_index_to_redirect_routes.rb
index a770ff63b4e1e..1a6516f87774a 100644
--- a/db/migrate/20170724214302_add_lower_path_index_to_redirect_routes.rb
+++ b/db/migrate/20170724214302_add_lower_path_index_to_redirect_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLowerPathIndexToRedirectRoutes < ActiveRecord::Migration
+class AddLowerPathIndexToRedirectRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170725145659_add_binary_to_merge_request_diff_files.rb b/db/migrate/20170725145659_add_binary_to_merge_request_diff_files.rb
index 1f5fa7e3d49a1..c7d377547e49b 100644
--- a/db/migrate/20170725145659_add_binary_to_merge_request_diff_files.rb
+++ b/db/migrate/20170725145659_add_binary_to_merge_request_diff_files.rb
@@ -1,4 +1,4 @@
-class AddBinaryToMergeRequestDiffFiles < ActiveRecord::Migration
+class AddBinaryToMergeRequestDiffFiles < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170727123534_add_index_on_events_project_id_id.rb b/db/migrate/20170727123534_add_index_on_events_project_id_id.rb
index 1c4aaaf9dd62b..076b8ee87b2d0 100644
--- a/db/migrate/20170727123534_add_index_on_events_project_id_id.rb
+++ b/db/migrate/20170727123534_add_index_on_events_project_id_id.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexOnEventsProjectIdId < ActiveRecord::Migration
+class AddIndexOnEventsProjectIdId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170731175128_add_percentages_to_conv_dev.rb b/db/migrate/20170731175128_add_percentages_to_conv_dev.rb
index 1819bfc96bbbf..522e99c075146 100644
--- a/db/migrate/20170731175128_add_percentages_to_conv_dev.rb
+++ b/db/migrate/20170731175128_add_percentages_to_conv_dev.rb
@@ -1,4 +1,4 @@
-class AddPercentagesToConvDev < ActiveRecord::Migration
+class AddPercentagesToConvDev < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170731183033_add_merge_jid_to_merge_requests.rb b/db/migrate/20170731183033_add_merge_jid_to_merge_requests.rb
index a7d8f2f3604e1..3c677f3bc2deb 100644
--- a/db/migrate/20170731183033_add_merge_jid_to_merge_requests.rb
+++ b/db/migrate/20170731183033_add_merge_jid_to_merge_requests.rb
@@ -1,4 +1,4 @@
-class AddMergeJidToMergeRequests < ActiveRecord::Migration
+class AddMergeJidToMergeRequests < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170802013652_add_storage_fields_to_project.rb b/db/migrate/20170802013652_add_storage_fields_to_project.rb
index c2381a9d0b278..d6672b9b3af4c 100644
--- a/db/migrate/20170802013652_add_storage_fields_to_project.rb
+++ b/db/migrate/20170802013652_add_storage_fields_to_project.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddStorageFieldsToProject < ActiveRecord::Migration
+class AddStorageFieldsToProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170803130232_reorganise_issues_indexes_for_faster_sorting.rb b/db/migrate/20170803130232_reorganise_issues_indexes_for_faster_sorting.rb
index eb7d1be17320f..e92b5f286851a 100644
--- a/db/migrate/20170803130232_reorganise_issues_indexes_for_faster_sorting.rb
+++ b/db/migrate/20170803130232_reorganise_issues_indexes_for_faster_sorting.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ReorganiseIssuesIndexesForFasterSorting < ActiveRecord::Migration
+class ReorganiseIssuesIndexesForFasterSorting < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170807071105_add_hashed_storage_to_settings.rb b/db/migrate/20170807071105_add_hashed_storage_to_settings.rb
index 0846557add842..cfb89743127bd 100644
--- a/db/migrate/20170807071105_add_hashed_storage_to_settings.rb
+++ b/db/migrate/20170807071105_add_hashed_storage_to_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddHashedStorageToSettings < ActiveRecord::Migration
+class AddHashedStorageToSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170809133343_add_broadcast_messages_index.rb b/db/migrate/20170809133343_add_broadcast_messages_index.rb
index 4ab2ddb059dc3..bcbc6c9f7d276 100644
--- a/db/migrate/20170809133343_add_broadcast_messages_index.rb
+++ b/db/migrate/20170809133343_add_broadcast_messages_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddBroadcastMessagesIndex < ActiveRecord::Migration
+class AddBroadcastMessagesIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170809134534_add_broadcast_message_not_null_constraints.rb b/db/migrate/20170809134534_add_broadcast_message_not_null_constraints.rb
index 5551fb51a6e0a..fd8cdbb95aa2e 100644
--- a/db/migrate/20170809134534_add_broadcast_message_not_null_constraints.rb
+++ b/db/migrate/20170809134534_add_broadcast_message_not_null_constraints.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddBroadcastMessageNotNullConstraints < ActiveRecord::Migration
+class AddBroadcastMessageNotNullConstraints < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170809142252_cleanup_appearances_schema.rb b/db/migrate/20170809142252_cleanup_appearances_schema.rb
index acf4506011474..4c5d6a6d75d8b 100644
--- a/db/migrate/20170809142252_cleanup_appearances_schema.rb
+++ b/db/migrate/20170809142252_cleanup_appearances_schema.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupAppearancesSchema < ActiveRecord::Migration
+class CleanupAppearancesSchema < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170809161910_add_project_export_enabled_to_application_settings.rb b/db/migrate/20170809161910_add_project_export_enabled_to_application_settings.rb
index 4baba1ade6dec..9dd520de26490 100644
--- a/db/migrate/20170809161910_add_project_export_enabled_to_application_settings.rb
+++ b/db/migrate/20170809161910_add_project_export_enabled_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddProjectExportEnabledToApplicationSettings < ActiveRecord::Migration
+class AddProjectExportEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20170815221154_add_discussion_locked_to_issuable.rb b/db/migrate/20170815221154_add_discussion_locked_to_issuable.rb
index 5bd777c53a0ab..1444ca480b3f3 100644
--- a/db/migrate/20170815221154_add_discussion_locked_to_issuable.rb
+++ b/db/migrate/20170815221154_add_discussion_locked_to_issuable.rb
@@ -1,4 +1,4 @@
-class AddDiscussionLockedToIssuable < ActiveRecord::Migration
+class AddDiscussionLockedToIssuable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170816133938_add_access_level_to_ci_runners.rb b/db/migrate/20170816133938_add_access_level_to_ci_runners.rb
index fc484730f428a..5a1ea9514d151 100644
--- a/db/migrate/20170816133938_add_access_level_to_ci_runners.rb
+++ b/db/migrate/20170816133938_add_access_level_to_ci_runners.rb
@@ -1,4 +1,4 @@
-class AddAccessLevelToCiRunners < ActiveRecord::Migration
+class AddAccessLevelToCiRunners < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170816133940_add_protected_to_ci_builds.rb b/db/migrate/20170816133940_add_protected_to_ci_builds.rb
index c73a4387d2988..13e1be0d89cd3 100644
--- a/db/migrate/20170816133940_add_protected_to_ci_builds.rb
+++ b/db/migrate/20170816133940_add_protected_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddProtectedToCiBuilds < ActiveRecord::Migration
+class AddProtectedToCiBuilds < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb b/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb
index ce8f1e036862a..aefaf4a487bb4 100644
--- a/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb
+++ b/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb
@@ -1,4 +1,4 @@
-class AddProtectedToCiPipelines < ActiveRecord::Migration
+class AddProtectedToCiPipelines < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb b/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb
index caf7c705a6ee3..fbe5fe31ae895 100644
--- a/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb
+++ b/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb
@@ -1,4 +1,4 @@
-class AddIndexOnCiBuildsProtected < ActiveRecord::Migration
+class AddIndexOnCiBuildsProtected < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170816234252_add_theme_id_to_users.rb b/db/migrate/20170816234252_add_theme_id_to_users.rb
index 5043f9ec59174..bd04445cac6d5 100644
--- a/db/migrate/20170816234252_add_theme_id_to_users.rb
+++ b/db/migrate/20170816234252_add_theme_id_to_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddThemeIdToUsers < ActiveRecord::Migration
+class AddThemeIdToUsers < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170817123339_add_verification_status_to_gpg_signatures.rb b/db/migrate/20170817123339_add_verification_status_to_gpg_signatures.rb
index 128cd109f8d69..c7d81dc005a20 100644
--- a/db/migrate/20170817123339_add_verification_status_to_gpg_signatures.rb
+++ b/db/migrate/20170817123339_add_verification_status_to_gpg_signatures.rb
@@ -1,4 +1,4 @@
-class AddVerificationStatusToGpgSignatures < ActiveRecord::Migration
+class AddVerificationStatusToGpgSignatures < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   include Gitlab::Database::MigrationHelpers
diff --git a/db/migrate/20170820100558_correct_protected_tags_foreign_keys.rb b/db/migrate/20170820100558_correct_protected_tags_foreign_keys.rb
index 229298e194636..82e05885b0ebc 100644
--- a/db/migrate/20170820100558_correct_protected_tags_foreign_keys.rb
+++ b/db/migrate/20170820100558_correct_protected_tags_foreign_keys.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CorrectProtectedTagsForeignKeys < ActiveRecord::Migration
+class CorrectProtectedTagsForeignKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170820120108_create_user_synced_attributes_metadata.rb b/db/migrate/20170820120108_create_user_synced_attributes_metadata.rb
index 79028e3498777..131dcf7ac25f8 100644
--- a/db/migrate/20170820120108_create_user_synced_attributes_metadata.rb
+++ b/db/migrate/20170820120108_create_user_synced_attributes_metadata.rb
@@ -1,4 +1,4 @@
-class CreateUserSyncedAttributesMetadata < ActiveRecord::Migration
+class CreateUserSyncedAttributesMetadata < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170824101926_add_auto_devops_enabled_to_application_settings.rb b/db/migrate/20170824101926_add_auto_devops_enabled_to_application_settings.rb
index da518d8215cb1..f7c0aeab8f965 100644
--- a/db/migrate/20170824101926_add_auto_devops_enabled_to_application_settings.rb
+++ b/db/migrate/20170824101926_add_auto_devops_enabled_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddAutoDevopsEnabledToApplicationSettings < ActiveRecord::Migration
+class AddAutoDevopsEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170824162758_allow_appearances_description_html_null.rb b/db/migrate/20170824162758_allow_appearances_description_html_null.rb
index d7f481ee89426..6efa3452796aa 100644
--- a/db/migrate/20170824162758_allow_appearances_description_html_null.rb
+++ b/db/migrate/20170824162758_allow_appearances_description_html_null.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AllowAppearancesDescriptionHtmlNull < ActiveRecord::Migration
+class AllowAppearancesDescriptionHtmlNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb b/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb
index 41bb031014f6b..be543ffc983e0 100644
--- a/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb
+++ b/db/migrate/20170825015534_add_file_store_to_lfs_objects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddFileStoreToLfsObjects < ActiveRecord::Migration
+class AddFileStoreToLfsObjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170825104051_migrate_issues_to_ghost_user.rb b/db/migrate/20170825104051_migrate_issues_to_ghost_user.rb
index c5fb5762d616e..b1adccc9c5c46 100644
--- a/db/migrate/20170825104051_migrate_issues_to_ghost_user.rb
+++ b/db/migrate/20170825104051_migrate_issues_to_ghost_user.rb
@@ -1,4 +1,4 @@
-class MigrateIssuesToGhostUser < ActiveRecord::Migration
+class MigrateIssuesToGhostUser < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/migrate/20170825154015_resolve_outdated_diff_discussions.rb b/db/migrate/20170825154015_resolve_outdated_diff_discussions.rb
index 235530bb1e64e..1aed21f10a0af 100644
--- a/db/migrate/20170825154015_resolve_outdated_diff_discussions.rb
+++ b/db/migrate/20170825154015_resolve_outdated_diff_discussions.rb
@@ -1,4 +1,4 @@
-class ResolveOutdatedDiffDiscussions < ActiveRecord::Migration
+class ResolveOutdatedDiffDiscussions < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb b/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb
index 2140ff7b05ef5..e2061b5600acf 100644
--- a/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb
+++ b/db/migrate/20170827123848_add_index_on_merge_request_diff_commit_sha.rb
@@ -1,6 +1,6 @@
 # rubocop:disable RemoveIndex
 
-class AddIndexOnMergeRequestDiffCommitSha < ActiveRecord::Migration
+class AddIndexOnMergeRequestDiffCommitSha < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170828093725_create_project_auto_dev_ops.rb b/db/migrate/20170828093725_create_project_auto_dev_ops.rb
index c1bb4f20c1dee..ea895dc14c197 100644
--- a/db/migrate/20170828093725_create_project_auto_dev_ops.rb
+++ b/db/migrate/20170828093725_create_project_auto_dev_ops.rb
@@ -1,4 +1,4 @@
-class CreateProjectAutoDevOps < ActiveRecord::Migration
+class CreateProjectAutoDevOps < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170828135939_migrate_user_external_mail_data.rb b/db/migrate/20170828135939_migrate_user_external_mail_data.rb
index f7ac87374b622..9ee4a4598bfc5 100644
--- a/db/migrate/20170828135939_migrate_user_external_mail_data.rb
+++ b/db/migrate/20170828135939_migrate_user_external_mail_data.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateUserExternalMailData < ActiveRecord::Migration
+class MigrateUserExternalMailData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170830125940_add_failure_reason_to_ci_builds.rb b/db/migrate/20170830125940_add_failure_reason_to_ci_builds.rb
index 5a7487b9227cd..44f709868cac2 100644
--- a/db/migrate/20170830125940_add_failure_reason_to_ci_builds.rb
+++ b/db/migrate/20170830125940_add_failure_reason_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddFailureReasonToCiBuilds < ActiveRecord::Migration
+class AddFailureReasonToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb b/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb
index 0dfdc4ed261bc..bcc34d56d2dc0 100644
--- a/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb
+++ b/db/migrate/20170830130119_steal_remaining_event_migration_jobs.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class StealRemainingEventMigrationJobs < ActiveRecord::Migration
+class StealRemainingEventMigrationJobs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170830131015_swap_event_migration_tables.rb b/db/migrate/20170830131015_swap_event_migration_tables.rb
index a256de4a8af9e..fb3b2472ffe2a 100644
--- a/db/migrate/20170830131015_swap_event_migration_tables.rb
+++ b/db/migrate/20170830131015_swap_event_migration_tables.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class SwapEventMigrationTables < ActiveRecord::Migration
+class SwapEventMigrationTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170831092813_add_config_source_to_pipelines.rb b/db/migrate/20170831092813_add_config_source_to_pipelines.rb
index ff51e968abd86..ba1f73f0e689b 100644
--- a/db/migrate/20170831092813_add_config_source_to_pipelines.rb
+++ b/db/migrate/20170831092813_add_config_source_to_pipelines.rb
@@ -1,4 +1,4 @@
-class AddConfigSourceToPipelines < ActiveRecord::Migration
+class AddConfigSourceToPipelines < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170901071411_add_foreign_key_to_issue_author.rb b/db/migrate/20170901071411_add_foreign_key_to_issue_author.rb
index ab6e9fb565af9..00d0b0f2c7f86 100644
--- a/db/migrate/20170901071411_add_foreign_key_to_issue_author.rb
+++ b/db/migrate/20170901071411_add_foreign_key_to_issue_author.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyToIssueAuthor < ActiveRecord::Migration
+class AddForeignKeyToIssueAuthor < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170904092148_add_email_confirmation.rb b/db/migrate/20170904092148_add_email_confirmation.rb
index 17ff424b3197c..8bfb20059363c 100644
--- a/db/migrate/20170904092148_add_email_confirmation.rb
+++ b/db/migrate/20170904092148_add_email_confirmation.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEmailConfirmation < ActiveRecord::Migration
+class AddEmailConfirmation < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170905112933_add_resolved_by_push_to_notes.rb b/db/migrate/20170905112933_add_resolved_by_push_to_notes.rb
index ceb31ffb08abe..1f27ea3c4673e 100644
--- a/db/migrate/20170905112933_add_resolved_by_push_to_notes.rb
+++ b/db/migrate/20170905112933_add_resolved_by_push_to_notes.rb
@@ -1,4 +1,4 @@
-class AddResolvedByPushToNotes < ActiveRecord::Migration
+class AddResolvedByPushToNotes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170906133745_add_runners_token_to_groups.rb b/db/migrate/20170906133745_add_runners_token_to_groups.rb
index 852f4cba67056..a02160feb8388 100644
--- a/db/migrate/20170906133745_add_runners_token_to_groups.rb
+++ b/db/migrate/20170906133745_add_runners_token_to_groups.rb
@@ -1,4 +1,4 @@
-class AddRunnersTokenToGroups < ActiveRecord::Migration
+class AddRunnersTokenToGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170909090114_add_email_confirmation_index.rb b/db/migrate/20170909090114_add_email_confirmation_index.rb
index a8c1023c48211..31c48db2bd2d5 100644
--- a/db/migrate/20170909090114_add_email_confirmation_index.rb
+++ b/db/migrate/20170909090114_add_email_confirmation_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEmailConfirmationIndex < ActiveRecord::Migration
+class AddEmailConfirmationIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170909150936_add_spent_at_to_timelogs.rb b/db/migrate/20170909150936_add_spent_at_to_timelogs.rb
index ffff719c28946..3a2c900b445b2 100644
--- a/db/migrate/20170909150936_add_spent_at_to_timelogs.rb
+++ b/db/migrate/20170909150936_add_spent_at_to_timelogs.rb
@@ -1,4 +1,4 @@
-class AddSpentAtToTimelogs < ActiveRecord::Migration
+class AddSpentAtToTimelogs < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20170912113435_clean_stages_statuses_migration.rb b/db/migrate/20170912113435_clean_stages_statuses_migration.rb
index fc091d7894ecb..f2040f819cd0b 100644
--- a/db/migrate/20170912113435_clean_stages_statuses_migration.rb
+++ b/db/migrate/20170912113435_clean_stages_statuses_migration.rb
@@ -1,4 +1,4 @@
-class CleanStagesStatusesMigration < ActiveRecord::Migration
+class CleanStagesStatusesMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170913131410_environments_project_id_not_null.rb b/db/migrate/20170913131410_environments_project_id_not_null.rb
index d5404f8ede998..ba66113945bef 100644
--- a/db/migrate/20170913131410_environments_project_id_not_null.rb
+++ b/db/migrate/20170913131410_environments_project_id_not_null.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class EnvironmentsProjectIdNotNull < ActiveRecord::Migration
+class EnvironmentsProjectIdNotNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170914135630_add_index_for_recent_push_events.rb b/db/migrate/20170914135630_add_index_for_recent_push_events.rb
index 99f593b046586..ac86185ba5026 100644
--- a/db/migrate/20170914135630_add_index_for_recent_push_events.rb
+++ b/db/migrate/20170914135630_add_index_for_recent_push_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexForRecentPushEvents < ActiveRecord::Migration
+class AddIndexForRecentPushEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170918072948_create_job_artifacts.rb b/db/migrate/20170918072948_create_job_artifacts.rb
index 95f2c6c8ce8d2..4dd24aaff9966 100644
--- a/db/migrate/20170918072948_create_job_artifacts.rb
+++ b/db/migrate/20170918072948_create_job_artifacts.rb
@@ -1,4 +1,4 @@
-class CreateJobArtifacts < ActiveRecord::Migration
+class CreateJobArtifacts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170918072949_add_file_store_job_artifacts.rb b/db/migrate/20170918072949_add_file_store_job_artifacts.rb
index b1f1bea6debd6..3eb355c930518 100644
--- a/db/migrate/20170918072949_add_file_store_job_artifacts.rb
+++ b/db/migrate/20170918072949_add_file_store_job_artifacts.rb
@@ -1,4 +1,4 @@
-class AddFileStoreJobArtifacts < ActiveRecord::Migration
+class AddFileStoreJobArtifacts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20170918111708_create_project_custom_attributes.rb b/db/migrate/20170918111708_create_project_custom_attributes.rb
index b5bc90ec02ecf..bd6064689ff49 100644
--- a/db/migrate/20170918111708_create_project_custom_attributes.rb
+++ b/db/migrate/20170918111708_create_project_custom_attributes.rb
@@ -1,4 +1,4 @@
-class CreateProjectCustomAttributes < ActiveRecord::Migration
+class CreateProjectCustomAttributes < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170918140927_create_group_custom_attributes.rb b/db/migrate/20170918140927_create_group_custom_attributes.rb
index 3879ea15eb6b9..215a0f16b6fe8 100644
--- a/db/migrate/20170918140927_create_group_custom_attributes.rb
+++ b/db/migrate/20170918140927_create_group_custom_attributes.rb
@@ -1,4 +1,4 @@
-class CreateGroupCustomAttributes < ActiveRecord::Migration
+class CreateGroupCustomAttributes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170918222253_reorganize_deployments_indexes.rb b/db/migrate/20170918222253_reorganize_deployments_indexes.rb
index 139427ed2b9be..480847ac3930f 100644
--- a/db/migrate/20170918222253_reorganize_deployments_indexes.rb
+++ b/db/migrate/20170918222253_reorganize_deployments_indexes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ReorganizeDeploymentsIndexes < ActiveRecord::Migration
+class ReorganizeDeploymentsIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170918223303_add_deployments_index_for_last_deployment.rb b/db/migrate/20170918223303_add_deployments_index_for_last_deployment.rb
index b91efb86d9820..8e165ac647d1d 100644
--- a/db/migrate/20170918223303_add_deployments_index_for_last_deployment.rb
+++ b/db/migrate/20170918223303_add_deployments_index_for_last_deployment.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddDeploymentsIndexForLastDeployment < ActiveRecord::Migration
+class AddDeploymentsIndexForLastDeployment < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170919211300_remove_temporary_ci_builds_index.rb b/db/migrate/20170919211300_remove_temporary_ci_builds_index.rb
index 8423bf13fd970..23c94a809d4d3 100644
--- a/db/migrate/20170919211300_remove_temporary_ci_builds_index.rb
+++ b/db/migrate/20170919211300_remove_temporary_ci_builds_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveTemporaryCiBuildsIndex < ActiveRecord::Migration
+class RemoveTemporaryCiBuildsIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170921115009_add_project_repository_storage_index.rb b/db/migrate/20170921115009_add_project_repository_storage_index.rb
index 1c5a8fd65e18e..9e1f5052f2877 100644
--- a/db/migrate/20170921115009_add_project_repository_storage_index.rb
+++ b/db/migrate/20170921115009_add_project_repository_storage_index.rb
@@ -1,4 +1,4 @@
-class AddProjectRepositoryStorageIndex < ActiveRecord::Migration
+class AddProjectRepositoryStorageIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170924094327_create_gcp_clusters.rb b/db/migrate/20170924094327_create_gcp_clusters.rb
index 657dddcbbc489..43201f75ad77e 100644
--- a/db/migrate/20170924094327_create_gcp_clusters.rb
+++ b/db/migrate/20170924094327_create_gcp_clusters.rb
@@ -1,4 +1,4 @@
-class CreateGcpClusters < ActiveRecord::Migration
+class CreateGcpClusters < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170925184228_add_favicon_to_appearances.rb b/db/migrate/20170925184228_add_favicon_to_appearances.rb
index 65083733afbf0..1ce750f7e8300 100644
--- a/db/migrate/20170925184228_add_favicon_to_appearances.rb
+++ b/db/migrate/20170925184228_add_favicon_to_appearances.rb
@@ -1,4 +1,4 @@
-class AddFaviconToAppearances < ActiveRecord::Migration
+class AddFaviconToAppearances < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20170927095921_add_ci_builds_index_for_jobscontroller.rb b/db/migrate/20170927095921_add_ci_builds_index_for_jobscontroller.rb
index c2cb1df2586c5..85aa78006dbd0 100644
--- a/db/migrate/20170927095921_add_ci_builds_index_for_jobscontroller.rb
+++ b/db/migrate/20170927095921_add_ci_builds_index_for_jobscontroller.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCiBuildsIndexForJobscontroller < ActiveRecord::Migration
+class AddCiBuildsIndexForJobscontroller < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170927122209_add_partial_index_for_labels_template.rb b/db/migrate/20170927122209_add_partial_index_for_labels_template.rb
index c3e5077ba2033..dd79e024df412 100644
--- a/db/migrate/20170927122209_add_partial_index_for_labels_template.rb
+++ b/db/migrate/20170927122209_add_partial_index_for_labels_template.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPartialIndexForLabelsTemplate < ActiveRecord::Migration
+class AddPartialIndexForLabelsTemplate < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170927161718_create_gpg_key_subkeys.rb b/db/migrate/20170927161718_create_gpg_key_subkeys.rb
index d9dc2404cac48..3b5d452ee12f1 100644
--- a/db/migrate/20170927161718_create_gpg_key_subkeys.rb
+++ b/db/migrate/20170927161718_create_gpg_key_subkeys.rb
@@ -1,4 +1,4 @@
-class CreateGpgKeySubkeys < ActiveRecord::Migration
+class CreateGpgKeySubkeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170928100231_add_composite_index_on_merge_requests_merge_commit_sha.rb b/db/migrate/20170928100231_add_composite_index_on_merge_requests_merge_commit_sha.rb
index 9f02daf04c1b4..cb16589e8dbce 100644
--- a/db/migrate/20170928100231_add_composite_index_on_merge_requests_merge_commit_sha.rb
+++ b/db/migrate/20170928100231_add_composite_index_on_merge_requests_merge_commit_sha.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCompositeIndexOnMergeRequestsMergeCommitSha < ActiveRecord::Migration
+class AddCompositeIndexOnMergeRequestsMergeCommitSha < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20170928124105_create_fork_networks.rb b/db/migrate/20170928124105_create_fork_networks.rb
index 89e5b871967c9..01f623117f57d 100644
--- a/db/migrate/20170928124105_create_fork_networks.rb
+++ b/db/migrate/20170928124105_create_fork_networks.rb
@@ -1,4 +1,4 @@
-class CreateForkNetworks < ActiveRecord::Migration
+class CreateForkNetworks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170928133643_create_fork_network_members.rb b/db/migrate/20170928133643_create_fork_network_members.rb
index 8c7d9ba859a24..e2a6d7b0e8aaf 100644
--- a/db/migrate/20170928133643_create_fork_network_members.rb
+++ b/db/migrate/20170928133643_create_fork_network_members.rb
@@ -1,4 +1,4 @@
-class CreateForkNetworkMembers < ActiveRecord::Migration
+class CreateForkNetworkMembers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170929080234_add_failure_reason_to_pipelines.rb b/db/migrate/20170929080234_add_failure_reason_to_pipelines.rb
index 82adddbc1ec11..e000ee27eefde 100644
--- a/db/migrate/20170929080234_add_failure_reason_to_pipelines.rb
+++ b/db/migrate/20170929080234_add_failure_reason_to_pipelines.rb
@@ -1,4 +1,4 @@
-class AddFailureReasonToPipelines < ActiveRecord::Migration
+class AddFailureReasonToPipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20170929131201_populate_fork_networks.rb b/db/migrate/20170929131201_populate_fork_networks.rb
index ddbf27e18525e..ba4f8ef253181 100644
--- a/db/migrate/20170929131201_populate_fork_networks.rb
+++ b/db/migrate/20170929131201_populate_fork_networks.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PopulateForkNetworks < ActiveRecord::Migration
+class PopulateForkNetworks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171004121444_make_sure_fast_forward_option_exists.rb b/db/migrate/20171004121444_make_sure_fast_forward_option_exists.rb
index ac266c3e22ead..9b417de1793a2 100644
--- a/db/migrate/20171004121444_make_sure_fast_forward_option_exists.rb
+++ b/db/migrate/20171004121444_make_sure_fast_forward_option_exists.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MakeSureFastForwardOptionExists < ActiveRecord::Migration
+class MakeSureFastForwardOptionExists < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171006090001_create_ci_build_trace_sections.rb b/db/migrate/20171006090001_create_ci_build_trace_sections.rb
index ab5ef3196182e..a2eca0832f27a 100644
--- a/db/migrate/20171006090001_create_ci_build_trace_sections.rb
+++ b/db/migrate/20171006090001_create_ci_build_trace_sections.rb
@@ -1,4 +1,4 @@
-class CreateCiBuildTraceSections < ActiveRecord::Migration
+class CreateCiBuildTraceSections < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171006090010_add_build_foreign_key_to_ci_build_trace_sections.rb b/db/migrate/20171006090010_add_build_foreign_key_to_ci_build_trace_sections.rb
index d279463eb4bc7..7b17763ac84d0 100644
--- a/db/migrate/20171006090010_add_build_foreign_key_to_ci_build_trace_sections.rb
+++ b/db/migrate/20171006090010_add_build_foreign_key_to_ci_build_trace_sections.rb
@@ -1,4 +1,4 @@
-class AddBuildForeignKeyToCiBuildTraceSections < ActiveRecord::Migration
+class AddBuildForeignKeyToCiBuildTraceSections < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171006090100_create_ci_build_trace_section_names.rb b/db/migrate/20171006090100_create_ci_build_trace_section_names.rb
index 88f3e60699ae7..00a38fa59c2b2 100644
--- a/db/migrate/20171006090100_create_ci_build_trace_section_names.rb
+++ b/db/migrate/20171006090100_create_ci_build_trace_section_names.rb
@@ -1,4 +1,4 @@
-class CreateCiBuildTraceSectionNames < ActiveRecord::Migration
+class CreateCiBuildTraceSectionNames < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171006091000_add_name_foreign_key_to_ci_build_trace_sections.rb b/db/migrate/20171006091000_add_name_foreign_key_to_ci_build_trace_sections.rb
index 08422885a9855..1342ff013b7e0 100644
--- a/db/migrate/20171006091000_add_name_foreign_key_to_ci_build_trace_sections.rb
+++ b/db/migrate/20171006091000_add_name_foreign_key_to_ci_build_trace_sections.rb
@@ -1,4 +1,4 @@
-class AddNameForeignKeyToCiBuildTraceSections < ActiveRecord::Migration
+class AddNameForeignKeyToCiBuildTraceSections < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171006220837_add_global_rate_limits_to_application_settings.rb b/db/migrate/20171006220837_add_global_rate_limits_to_application_settings.rb
index 55e822752af7f..96d76069b355d 100644
--- a/db/migrate/20171006220837_add_global_rate_limits_to_application_settings.rb
+++ b/db/migrate/20171006220837_add_global_rate_limits_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddGlobalRateLimitsToApplicationSettings < ActiveRecord::Migration
+class AddGlobalRateLimitsToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb b/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb
index bcf7dbd8e6415..91bba07b4d79d 100644
--- a/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb
+++ b/db/migrate/20171012101043_add_circuit_breaker_properties_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCircuitBreakerPropertiesToApplicationSettings < ActiveRecord::Migration
+class AddCircuitBreakerPropertiesToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171012125712_migrate_user_authentication_token_to_personal_access_token.rb b/db/migrate/20171012125712_migrate_user_authentication_token_to_personal_access_token.rb
index 9a909644a44a6..305c12e31f8c3 100644
--- a/db/migrate/20171012125712_migrate_user_authentication_token_to_personal_access_token.rb
+++ b/db/migrate/20171012125712_migrate_user_authentication_token_to_personal_access_token.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateUserAuthenticationTokenToPersonalAccessToken < ActiveRecord::Migration
+class MigrateUserAuthenticationTokenToPersonalAccessToken < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171013094327_create_new_clusters_architectures.rb b/db/migrate/20171013094327_create_new_clusters_architectures.rb
index dabb3e25e4802..98f91e6130faa 100644
--- a/db/migrate/20171013094327_create_new_clusters_architectures.rb
+++ b/db/migrate/20171013094327_create_new_clusters_architectures.rb
@@ -1,4 +1,4 @@
-class CreateNewClustersArchitectures < ActiveRecord::Migration
+class CreateNewClustersArchitectures < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20171017145932_add_new_circuitbreaker_settings_to_application_settings.rb b/db/migrate/20171017145932_add_new_circuitbreaker_settings_to_application_settings.rb
index 07eb25c0b0fa7..4a0cadea364ba 100644
--- a/db/migrate/20171017145932_add_new_circuitbreaker_settings_to_application_settings.rb
+++ b/db/migrate/20171017145932_add_new_circuitbreaker_settings_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddNewCircuitbreakerSettingsToApplicationSettings < ActiveRecord::Migration
+class AddNewCircuitbreakerSettingsToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171019141859_fix_dev_timezone_schema.rb b/db/migrate/20171019141859_fix_dev_timezone_schema.rb
index fb7c17dd7472f..68c8b528e17d1 100644
--- a/db/migrate/20171019141859_fix_dev_timezone_schema.rb
+++ b/db/migrate/20171019141859_fix_dev_timezone_schema.rb
@@ -1,4 +1,4 @@
-class FixDevTimezoneSchema < ActiveRecord::Migration
+class FixDevTimezoneSchema < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # The this migrations tries to help solve unwanted changes to `schema.rb`
diff --git a/db/migrate/20171025110159_add_latest_merge_request_diff_id_to_merge_requests.rb b/db/migrate/20171025110159_add_latest_merge_request_diff_id_to_merge_requests.rb
index 74a2badc13081..1af0cf7095888 100644
--- a/db/migrate/20171025110159_add_latest_merge_request_diff_id_to_merge_requests.rb
+++ b/db/migrate/20171025110159_add_latest_merge_request_diff_id_to_merge_requests.rb
@@ -1,4 +1,4 @@
-class AddLatestMergeRequestDiffIdToMergeRequests < ActiveRecord::Migration
+class AddLatestMergeRequestDiffIdToMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171031100710_create_clusters_kubernetes_helm_apps.rb b/db/migrate/20171031100710_create_clusters_kubernetes_helm_apps.rb
index a2ce37127eae9..0af05f5c94ad0 100644
--- a/db/migrate/20171031100710_create_clusters_kubernetes_helm_apps.rb
+++ b/db/migrate/20171031100710_create_clusters_kubernetes_helm_apps.rb
@@ -1,4 +1,4 @@
-class CreateClustersKubernetesHelmApps < ActiveRecord::Migration
+class CreateClustersKubernetesHelmApps < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171101130535_add_gitaly_timeout_properties_to_application_settings.rb b/db/migrate/20171101130535_add_gitaly_timeout_properties_to_application_settings.rb
index de621e7111c80..6d60fdc6132ee 100644
--- a/db/migrate/20171101130535_add_gitaly_timeout_properties_to_application_settings.rb
+++ b/db/migrate/20171101130535_add_gitaly_timeout_properties_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddGitalyTimeoutPropertiesToApplicationSettings < ActiveRecord::Migration
+class AddGitalyTimeoutPropertiesToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171103000000_set_uploads_path_size_for_mysql.rb b/db/migrate/20171103000000_set_uploads_path_size_for_mysql.rb
index 1fbe505f804b8..93cec87f99984 100644
--- a/db/migrate/20171103000000_set_uploads_path_size_for_mysql.rb
+++ b/db/migrate/20171103000000_set_uploads_path_size_for_mysql.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class SetUploadsPathSizeForMysql < ActiveRecord::Migration
+class SetUploadsPathSizeForMysql < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171106101200_create_clusters_kubernetes_ingress_apps.rb b/db/migrate/20171106101200_create_clusters_kubernetes_ingress_apps.rb
index 21f48b1d1b4b5..770cb94ee18aa 100644
--- a/db/migrate/20171106101200_create_clusters_kubernetes_ingress_apps.rb
+++ b/db/migrate/20171106101200_create_clusters_kubernetes_ingress_apps.rb
@@ -1,4 +1,4 @@
-class CreateClustersKubernetesIngressApps < ActiveRecord::Migration
+class CreateClustersKubernetesIngressApps < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171106132212_issues_confidential_not_null.rb b/db/migrate/20171106132212_issues_confidential_not_null.rb
index c959d2dd938bb..444a38c2dc53f 100644
--- a/db/migrate/20171106132212_issues_confidential_not_null.rb
+++ b/db/migrate/20171106132212_issues_confidential_not_null.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class IssuesConfidentialNotNull < ActiveRecord::Migration
+class IssuesConfidentialNotNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb b/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb
index 6d369e9336127..58762a4f85296 100644
--- a/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb
+++ b/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb
@@ -1,4 +1,4 @@
-class RenameApplicationSettingsPasswordAuthenticationEnabledToPasswordAuthenticationEnabledForWeb < ActiveRecord::Migration
+class RenameApplicationSettingsPasswordAuthenticationEnabledToPasswordAuthenticationEnabledForWeb < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb b/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb
index b8aa600864e62..1f96a0426a17f 100644
--- a/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb
+++ b/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddPasswordAuthenticationEnabledForGitToApplicationSettings < ActiveRecord::Migration
+class AddPasswordAuthenticationEnabledForGitToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171106135924_issues_milestone_id_foreign_key.rb b/db/migrate/20171106135924_issues_milestone_id_foreign_key.rb
index bfb3dcae511f4..1de7d5e768eea 100644
--- a/db/migrate/20171106135924_issues_milestone_id_foreign_key.rb
+++ b/db/migrate/20171106135924_issues_milestone_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class IssuesMilestoneIdForeignKey < ActiveRecord::Migration
+class IssuesMilestoneIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171106150657_issues_updated_by_id_foreign_key.rb b/db/migrate/20171106150657_issues_updated_by_id_foreign_key.rb
index 3b8844d7d9f57..b2992b1ff5dc6 100644
--- a/db/migrate/20171106150657_issues_updated_by_id_foreign_key.rb
+++ b/db/migrate/20171106150657_issues_updated_by_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class IssuesUpdatedByIdForeignKey < ActiveRecord::Migration
+class IssuesUpdatedByIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171106151218_issues_moved_to_id_foreign_key.rb b/db/migrate/20171106151218_issues_moved_to_id_foreign_key.rb
index 6395462384bbf..66bfb5718dce2 100644
--- a/db/migrate/20171106151218_issues_moved_to_id_foreign_key.rb
+++ b/db/migrate/20171106151218_issues_moved_to_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class IssuesMovedToIdForeignKey < ActiveRecord::Migration
+class IssuesMovedToIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171106155656_turn_issues_due_date_index_to_partial_index.rb b/db/migrate/20171106155656_turn_issues_due_date_index_to_partial_index.rb
index 08784de404365..58392de5e6b4f 100644
--- a/db/migrate/20171106155656_turn_issues_due_date_index_to_partial_index.rb
+++ b/db/migrate/20171106155656_turn_issues_due_date_index_to_partial_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class TurnIssuesDueDateIndexToPartialIndex < ActiveRecord::Migration
+class TurnIssuesDueDateIndexToPartialIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb b/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb
index 0f1e937545b39..c6edc1af6cbea 100644
--- a/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb
+++ b/db/migrate/20171106171453_add_timezone_to_issues_closed_at.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddTimezoneToIssuesClosedAt < ActiveRecord::Migration
+class AddTimezoneToIssuesClosedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171114150259_merge_requests_author_id_foreign_key.rb b/db/migrate/20171114150259_merge_requests_author_id_foreign_key.rb
index 021eaa04a0c6f..4ebb6fad0596f 100644
--- a/db/migrate/20171114150259_merge_requests_author_id_foreign_key.rb
+++ b/db/migrate/20171114150259_merge_requests_author_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsAuthorIdForeignKey < ActiveRecord::Migration
+class MergeRequestsAuthorIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171114160005_merge_requests_assignee_id_foreign_key.rb b/db/migrate/20171114160005_merge_requests_assignee_id_foreign_key.rb
index 1a242f01051da..73c177c44f9b6 100644
--- a/db/migrate/20171114160005_merge_requests_assignee_id_foreign_key.rb
+++ b/db/migrate/20171114160005_merge_requests_assignee_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsAssigneeIdForeignKey < ActiveRecord::Migration
+class MergeRequestsAssigneeIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171114160904_merge_requests_updated_by_id_foreign_key.rb b/db/migrate/20171114160904_merge_requests_updated_by_id_foreign_key.rb
index eb3872e38da9a..69f9c181c105c 100644
--- a/db/migrate/20171114160904_merge_requests_updated_by_id_foreign_key.rb
+++ b/db/migrate/20171114160904_merge_requests_updated_by_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsUpdatedByIdForeignKey < ActiveRecord::Migration
+class MergeRequestsUpdatedByIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171114161720_merge_requests_merge_user_id_foreign_key.rb b/db/migrate/20171114161720_merge_requests_merge_user_id_foreign_key.rb
index 925b3e537d7ad..ccd275d5bb423 100644
--- a/db/migrate/20171114161720_merge_requests_merge_user_id_foreign_key.rb
+++ b/db/migrate/20171114161720_merge_requests_merge_user_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsMergeUserIdForeignKey < ActiveRecord::Migration
+class MergeRequestsMergeUserIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171114161914_merge_requests_source_project_id_foreign_key.rb b/db/migrate/20171114161914_merge_requests_source_project_id_foreign_key.rb
index 99740f64fe6d5..250928a6551b5 100644
--- a/db/migrate/20171114161914_merge_requests_source_project_id_foreign_key.rb
+++ b/db/migrate/20171114161914_merge_requests_source_project_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsSourceProjectIdForeignKey < ActiveRecord::Migration
+class MergeRequestsSourceProjectIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171114162227_merge_requests_milestone_id_foreign_key.rb b/db/migrate/20171114162227_merge_requests_milestone_id_foreign_key.rb
index c005cf7d17369..cafe0ce085305 100644
--- a/db/migrate/20171114162227_merge_requests_milestone_id_foreign_key.rb
+++ b/db/migrate/20171114162227_merge_requests_milestone_id_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsMilestoneIdForeignKey < ActiveRecord::Migration
+class MergeRequestsMilestoneIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171115164540_populate_merge_requests_latest_merge_request_diff_id_take_two.rb b/db/migrate/20171115164540_populate_merge_requests_latest_merge_request_diff_id_take_two.rb
index 27b6b4ebddc23..935092ce46a4c 100644
--- a/db/migrate/20171115164540_populate_merge_requests_latest_merge_request_diff_id_take_two.rb
+++ b/db/migrate/20171115164540_populate_merge_requests_latest_merge_request_diff_id_take_two.rb
@@ -1,5 +1,5 @@
 # This is identical to the stolen background migration, which already has specs.
-class PopulateMergeRequestsLatestMergeRequestDiffIdTakeTwo < ActiveRecord::Migration
+class PopulateMergeRequestsLatestMergeRequestDiffIdTakeTwo < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171116135628_add_environment_scope_to_clusters.rb b/db/migrate/20171116135628_add_environment_scope_to_clusters.rb
index cce757095dd4c..39bb8759cc032 100644
--- a/db/migrate/20171116135628_add_environment_scope_to_clusters.rb
+++ b/db/migrate/20171116135628_add_environment_scope_to_clusters.rb
@@ -1,4 +1,4 @@
-class AddEnvironmentScopeToClusters < ActiveRecord::Migration
+class AddEnvironmentScopeToClusters < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171121135738_clean_up_from_merge_request_diffs_and_commits.rb b/db/migrate/20171121135738_clean_up_from_merge_request_diffs_and_commits.rb
index 30cf08b29fcb1..6be7b75492d4c 100644
--- a/db/migrate/20171121135738_clean_up_from_merge_request_diffs_and_commits.rb
+++ b/db/migrate/20171121135738_clean_up_from_merge_request_diffs_and_commits.rb
@@ -1,4 +1,4 @@
-class CleanUpFromMergeRequestDiffsAndCommits < ActiveRecord::Migration
+class CleanUpFromMergeRequestDiffsAndCommits < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171121144800_ci_pipelines_index_on_project_id_ref_status_id.rb b/db/migrate/20171121144800_ci_pipelines_index_on_project_id_ref_status_id.rb
index 5a8ae6e4b5712..a1dcfc70650a7 100644
--- a/db/migrate/20171121144800_ci_pipelines_index_on_project_id_ref_status_id.rb
+++ b/db/migrate/20171121144800_ci_pipelines_index_on_project_id_ref_status_id.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CiPipelinesIndexOnProjectIdRefStatusId < ActiveRecord::Migration
+class CiPipelinesIndexOnProjectIdRefStatusId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171122131600_add_new_project_guidelines_to_appearances.rb b/db/migrate/20171122131600_add_new_project_guidelines_to_appearances.rb
index 328cc65a5494c..cbcbb5d988a0f 100644
--- a/db/migrate/20171122131600_add_new_project_guidelines_to_appearances.rb
+++ b/db/migrate/20171122131600_add_new_project_guidelines_to_appearances.rb
@@ -1,4 +1,4 @@
-class AddNewProjectGuidelinesToAppearances < ActiveRecord::Migration
+class AddNewProjectGuidelinesToAppearances < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171123094802_add_circuitbreaker_check_interval_to_application_settings.rb b/db/migrate/20171123094802_add_circuitbreaker_check_interval_to_application_settings.rb
index 213d46018fcfd..94360c6492655 100644
--- a/db/migrate/20171123094802_add_circuitbreaker_check_interval_to_application_settings.rb
+++ b/db/migrate/20171123094802_add_circuitbreaker_check_interval_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddCircuitbreakerCheckIntervalToApplicationSettings < ActiveRecord::Migration
+class AddCircuitbreakerCheckIntervalToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171124125042_add_default_values_to_merge_request_states.rb b/db/migrate/20171124125042_add_default_values_to_merge_request_states.rb
index d08863c3b7863..d0d06863777f9 100644
--- a/db/migrate/20171124125042_add_default_values_to_merge_request_states.rb
+++ b/db/migrate/20171124125042_add_default_values_to_merge_request_states.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddDefaultValuesToMergeRequestStates < ActiveRecord::Migration
+class AddDefaultValuesToMergeRequestStates < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171124125748_populate_missing_merge_request_statuses.rb b/db/migrate/20171124125748_populate_missing_merge_request_statuses.rb
index 72fbab59f4ca3..67444f36e2450 100644
--- a/db/migrate/20171124125748_populate_missing_merge_request_statuses.rb
+++ b/db/migrate/20171124125748_populate_missing_merge_request_statuses.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PopulateMissingMergeRequestStatuses < ActiveRecord::Migration
+class PopulateMissingMergeRequestStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171124132536_make_merge_request_statuses_not_null.rb b/db/migrate/20171124132536_make_merge_request_statuses_not_null.rb
index 4bb091260368b..49b693c595076 100644
--- a/db/migrate/20171124132536_make_merge_request_statuses_not_null.rb
+++ b/db/migrate/20171124132536_make_merge_request_statuses_not_null.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MakeMergeRequestStatusesNotNull < ActiveRecord::Migration
+class MakeMergeRequestStatusesNotNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb b/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb
index 18af697cf8820..385de9dd73dfb 100644
--- a/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb
+++ b/db/migrate/20171127151038_add_events_related_columns_to_merge_request_metrics.rb
@@ -1,4 +1,4 @@
-class AddEventsRelatedColumnsToMergeRequestMetrics < ActiveRecord::Migration
+class AddEventsRelatedColumnsToMergeRequestMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171204204233_add_permanent_to_redirect_route.rb b/db/migrate/20171204204233_add_permanent_to_redirect_route.rb
index f3ae471201e23..bc0658035d635 100644
--- a/db/migrate/20171204204233_add_permanent_to_redirect_route.rb
+++ b/db/migrate/20171204204233_add_permanent_to_redirect_route.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPermanentToRedirectRoute < ActiveRecord::Migration
+class AddPermanentToRedirectRoute < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20171206221519_add_permanent_index_to_redirect_route.rb b/db/migrate/20171206221519_add_permanent_index_to_redirect_route.rb
index 33ce7e1aa68eb..ba924c4eeccbe 100644
--- a/db/migrate/20171206221519_add_permanent_index_to_redirect_route.rb
+++ b/db/migrate/20171206221519_add_permanent_index_to_redirect_route.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPermanentIndexToRedirectRoute < ActiveRecord::Migration
+class AddPermanentIndexToRedirectRoute < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171207185153_add_merge_request_state_index.rb b/db/migrate/20171207185153_add_merge_request_state_index.rb
index 72f846c5c38d4..167470cf7fe6f 100644
--- a/db/migrate/20171207185153_add_merge_request_state_index.rb
+++ b/db/migrate/20171207185153_add_merge_request_state_index.rb
@@ -1,4 +1,4 @@
-class AddMergeRequestStateIndex < ActiveRecord::Migration
+class AddMergeRequestStateIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171211145425_add_can_push_to_deploy_keys_projects.rb b/db/migrate/20171211145425_add_can_push_to_deploy_keys_projects.rb
index 5dc723db9f992..63e86b23aad1c 100644
--- a/db/migrate/20171211145425_add_can_push_to_deploy_keys_projects.rb
+++ b/db/migrate/20171211145425_add_can_push_to_deploy_keys_projects.rb
@@ -1,4 +1,4 @@
-class AddCanPushToDeployKeysProjects < ActiveRecord::Migration
+class AddCanPushToDeployKeysProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171212203433_create_clusters_applications_prometheus.rb b/db/migrate/20171212203433_create_clusters_applications_prometheus.rb
index dc2531d26912b..6eb9fec609ee0 100644
--- a/db/migrate/20171212203433_create_clusters_applications_prometheus.rb
+++ b/db/migrate/20171212203433_create_clusters_applications_prometheus.rb
@@ -1,4 +1,4 @@
-class CreateClustersApplicationsPrometheus < ActiveRecord::Migration
+class CreateClustersApplicationsPrometheus < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171214144320_add_store_column_to_uploads.rb b/db/migrate/20171214144320_add_store_column_to_uploads.rb
index e35798e2c4109..11b3951a3fa59 100644
--- a/db/migrate/20171214144320_add_store_column_to_uploads.rb
+++ b/db/migrate/20171214144320_add_store_column_to_uploads.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddStoreColumnToUploads < ActiveRecord::Migration
+class AddStoreColumnToUploads < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171215113714_populate_can_push_from_deploy_keys_projects.rb b/db/migrate/20171215113714_populate_can_push_from_deploy_keys_projects.rb
index 680855af94524..e2d7879b14051 100644
--- a/db/migrate/20171215113714_populate_can_push_from_deploy_keys_projects.rb
+++ b/db/migrate/20171215113714_populate_can_push_from_deploy_keys_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
+class PopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171216111734_clean_up_for_members.rb b/db/migrate/20171216111734_clean_up_for_members.rb
index 22e0997dce6d1..2fefc6c7fd1c6 100644
--- a/db/migrate/20171216111734_clean_up_for_members.rb
+++ b/db/migrate/20171216111734_clean_up_for_members.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanUpForMembers < ActiveRecord::Migration
+class CleanUpForMembers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171216112339_add_foreign_key_for_members.rb b/db/migrate/20171216112339_add_foreign_key_for_members.rb
index be17769be6a69..06c2c5068dae5 100644
--- a/db/migrate/20171216112339_add_foreign_key_for_members.rb
+++ b/db/migrate/20171216112339_add_foreign_key_for_members.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddForeignKeyForMembers < ActiveRecord::Migration
+class AddForeignKeyForMembers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171220191323_add_index_on_namespaces_lower_name.rb b/db/migrate/20171220191323_add_index_on_namespaces_lower_name.rb
index 130b24fe6f0d1..7543e43594164 100644
--- a/db/migrate/20171220191323_add_index_on_namespaces_lower_name.rb
+++ b/db/migrate/20171220191323_add_index_on_namespaces_lower_name.rb
@@ -1,4 +1,4 @@
-class AddIndexOnNamespacesLowerName < ActiveRecord::Migration
+class AddIndexOnNamespacesLowerName < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
   INDEX_NAME = 'index_on_namespaces_lower_name'
diff --git a/db/migrate/20171222115326_add_confidential_note_events_to_web_hooks.rb b/db/migrate/20171222115326_add_confidential_note_events_to_web_hooks.rb
index 900a6386922cf..788a842a3ad13 100644
--- a/db/migrate/20171222115326_add_confidential_note_events_to_web_hooks.rb
+++ b/db/migrate/20171222115326_add_confidential_note_events_to_web_hooks.rb
@@ -1,4 +1,4 @@
-class AddConfidentialNoteEventsToWebHooks < ActiveRecord::Migration
+class AddConfidentialNoteEventsToWebHooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20171222183504_add_jobs_cache_index_to_project.rb b/db/migrate/20171222183504_add_jobs_cache_index_to_project.rb
index 607e9d027d73b..78a195c351cbc 100644
--- a/db/migrate/20171222183504_add_jobs_cache_index_to_project.rb
+++ b/db/migrate/20171222183504_add_jobs_cache_index_to_project.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddJobsCacheIndexToProject < ActiveRecord::Migration
+class AddJobsCacheIndexToProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171229225929_change_user_project_limit_not_null_and_remove_default.rb b/db/migrate/20171229225929_change_user_project_limit_not_null_and_remove_default.rb
index 54fbbcf1a0d27..b9efdb8bb8f35 100644
--- a/db/migrate/20171229225929_change_user_project_limit_not_null_and_remove_default.rb
+++ b/db/migrate/20171229225929_change_user_project_limit_not_null_and_remove_default.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ChangeUserProjectLimitNotNullAndRemoveDefault < ActiveRecord::Migration
+class ChangeUserProjectLimitNotNullAndRemoveDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20171230123729_add_rebase_commit_sha_to_merge_requests_ce.rb b/db/migrate/20171230123729_add_rebase_commit_sha_to_merge_requests_ce.rb
index 94a7c1019d899..4e1107e1ff5d2 100644
--- a/db/migrate/20171230123729_add_rebase_commit_sha_to_merge_requests_ce.rb
+++ b/db/migrate/20171230123729_add_rebase_commit_sha_to_merge_requests_ce.rb
@@ -1,4 +1,4 @@
-class AddRebaseCommitShaToMergeRequestsCe < ActiveRecord::Migration
+class AddRebaseCommitShaToMergeRequestsCe < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20180101160629_create_prometheus_metrics.rb b/db/migrate/20180101160629_create_prometheus_metrics.rb
index c3be0939b1713..e3b1ed710d626 100644
--- a/db/migrate/20180101160629_create_prometheus_metrics.rb
+++ b/db/migrate/20180101160629_create_prometheus_metrics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreatePrometheusMetrics < ActiveRecord::Migration
+class CreatePrometheusMetrics < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180101160630_change_project_id_for_prometheus_metrics.rb b/db/migrate/20180101160630_change_project_id_for_prometheus_metrics.rb
index 66820f13f5445..d225899af182c 100644
--- a/db/migrate/20180101160630_change_project_id_for_prometheus_metrics.rb
+++ b/db/migrate/20180101160630_change_project_id_for_prometheus_metrics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class ChangeProjectIdForPrometheusMetrics < ActiveRecord::Migration
+class ChangeProjectIdForPrometheusMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180102220145_add_pages_https_only_to_projects.rb b/db/migrate/20180102220145_add_pages_https_only_to_projects.rb
index ef6bc6896c04c..75488f57fa9ff 100644
--- a/db/migrate/20180102220145_add_pages_https_only_to_projects.rb
+++ b/db/migrate/20180102220145_add_pages_https_only_to_projects.rb
@@ -1,4 +1,4 @@
-class AddPagesHttpsOnlyToProjects < ActiveRecord::Migration
+class AddPagesHttpsOnlyToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180103123548_add_confidential_note_events_to_services.rb b/db/migrate/20180103123548_add_confidential_note_events_to_services.rb
index b54ad88df437d..02724575e6cc0 100644
--- a/db/migrate/20180103123548_add_confidential_note_events_to_services.rb
+++ b/db/migrate/20180103123548_add_confidential_note_events_to_services.rb
@@ -1,4 +1,4 @@
-class AddConfidentialNoteEventsToServices < ActiveRecord::Migration
+class AddConfidentialNoteEventsToServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180105212544_add_commits_count_to_merge_request_diff.rb b/db/migrate/20180105212544_add_commits_count_to_merge_request_diff.rb
index f942b4c062e99..e27eecde90602 100644
--- a/db/migrate/20180105212544_add_commits_count_to_merge_request_diff.rb
+++ b/db/migrate/20180105212544_add_commits_count_to_merge_request_diff.rb
@@ -1,4 +1,4 @@
-class AddCommitsCountToMergeRequestDiff < ActiveRecord::Migration
+class AddCommitsCountToMergeRequestDiff < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180109183319_change_default_value_for_pages_https_only.rb b/db/migrate/20180109183319_change_default_value_for_pages_https_only.rb
index c242e1b0d24c1..558eb60ac3f4f 100644
--- a/db/migrate/20180109183319_change_default_value_for_pages_https_only.rb
+++ b/db/migrate/20180109183319_change_default_value_for_pages_https_only.rb
@@ -1,4 +1,4 @@
-class ChangeDefaultValueForPagesHttpsOnly < ActiveRecord::Migration
+class ChangeDefaultValueForPagesHttpsOnly < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180113220114_rework_redirect_routes_indexes.rb b/db/migrate/20180113220114_rework_redirect_routes_indexes.rb
index 53f82a31203ee..4c3bb0a26ce40 100644
--- a/db/migrate/20180113220114_rework_redirect_routes_indexes.rb
+++ b/db/migrate/20180113220114_rework_redirect_routes_indexes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ReworkRedirectRoutesIndexes < ActiveRecord::Migration
+class ReworkRedirectRoutesIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180115201419_add_index_updated_at_to_issues.rb b/db/migrate/20180115201419_add_index_updated_at_to_issues.rb
index a5a48fc97be0f..8707307eed06c 100644
--- a/db/migrate/20180115201419_add_index_updated_at_to_issues.rb
+++ b/db/migrate/20180115201419_add_index_updated_at_to_issues.rb
@@ -1,4 +1,4 @@
-class AddIndexUpdatedAtToIssues < ActiveRecord::Migration
+class AddIndexUpdatedAtToIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180116193854_create_lfs_file_locks.rb b/db/migrate/20180116193854_create_lfs_file_locks.rb
index 23b0c90484b07..2dd0e71916b42 100644
--- a/db/migrate/20180116193854_create_lfs_file_locks.rb
+++ b/db/migrate/20180116193854_create_lfs_file_locks.rb
@@ -1,4 +1,4 @@
-class CreateLfsFileLocks < ActiveRecord::Migration
+class CreateLfsFileLocks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180119135717_add_uploader_index_to_uploads.rb b/db/migrate/20180119135717_add_uploader_index_to_uploads.rb
index a678c3d049f68..7dd0a06e3bfe4 100644
--- a/db/migrate/20180119135717_add_uploader_index_to_uploads.rb
+++ b/db/migrate/20180119135717_add_uploader_index_to_uploads.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddUploaderIndexToUploads < ActiveRecord::Migration
+class AddUploaderIndexToUploads < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180119160751_optimize_ci_job_artifacts.rb b/db/migrate/20180119160751_optimize_ci_job_artifacts.rb
index 9b4340ed7b7f9..3598689d78c0a 100644
--- a/db/migrate/20180119160751_optimize_ci_job_artifacts.rb
+++ b/db/migrate/20180119160751_optimize_ci_job_artifacts.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class OptimizeCiJobArtifacts < ActiveRecord::Migration
+class OptimizeCiJobArtifacts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180122162010_add_auto_devops_domain_to_application_settings.rb b/db/migrate/20180122162010_add_auto_devops_domain_to_application_settings.rb
index 7e16cb8308721..c76dc5b3a68cd 100644
--- a/db/migrate/20180122162010_add_auto_devops_domain_to_application_settings.rb
+++ b/db/migrate/20180122162010_add_auto_devops_domain_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddAutoDevopsDomainToApplicationSettings < ActiveRecord::Migration
+class AddAutoDevopsDomainToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180125214301_create_user_callouts.rb b/db/migrate/20180125214301_create_user_callouts.rb
index 856eff36ae02b..6eb2f932ccc9b 100644
--- a/db/migrate/20180125214301_create_user_callouts.rb
+++ b/db/migrate/20180125214301_create_user_callouts.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreateUserCallouts < ActiveRecord::Migration
+class CreateUserCallouts < ActiveRecord::Migration[4.2]
   # Set this constant to true if this migration requires downtime.
   DOWNTIME = false
 
diff --git a/db/migrate/20180129193323_add_uploads_builder_context.rb b/db/migrate/20180129193323_add_uploads_builder_context.rb
index b3909a770ca12..c7227bf0f1ebc 100644
--- a/db/migrate/20180129193323_add_uploads_builder_context.rb
+++ b/db/migrate/20180129193323_add_uploads_builder_context.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddUploadsBuilderContext < ActiveRecord::Migration
+class AddUploadsBuilderContext < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180201102129_add_unique_constraint_to_trending_projects_project_id.rb b/db/migrate/20180201102129_add_unique_constraint_to_trending_projects_project_id.rb
index 02e53b8fa8acd..1f2a79d36a5da 100644
--- a/db/migrate/20180201102129_add_unique_constraint_to_trending_projects_project_id.rb
+++ b/db/migrate/20180201102129_add_unique_constraint_to_trending_projects_project_id.rb
@@ -1,4 +1,4 @@
-class AddUniqueConstraintToTrendingProjectsProjectId < ActiveRecord::Migration
+class AddUniqueConstraintToTrendingProjectsProjectId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180201110056_add_foreign_keys_to_todos.rb b/db/migrate/20180201110056_add_foreign_keys_to_todos.rb
index 020b055032109..6b217632a520b 100644
--- a/db/migrate/20180201110056_add_foreign_keys_to_todos.rb
+++ b/db/migrate/20180201110056_add_foreign_keys_to_todos.rb
@@ -1,4 +1,4 @@
-class AddForeignKeysToTodos < ActiveRecord::Migration
+class AddForeignKeysToTodos < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class Todo < ActiveRecord::Base
diff --git a/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb b/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb
index 36a85b6196869..d398909f25bd9 100644
--- a/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb
+++ b/db/migrate/20180201145907_migrate_remaining_issues_closed_at.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateRemainingIssuesClosedAt < ActiveRecord::Migration
+class MigrateRemainingIssuesClosedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180206200543_reset_events_primary_key_sequence.rb b/db/migrate/20180206200543_reset_events_primary_key_sequence.rb
index eb5c4a6a1e72d..d395c5725e4f8 100644
--- a/db/migrate/20180206200543_reset_events_primary_key_sequence.rb
+++ b/db/migrate/20180206200543_reset_events_primary_key_sequence.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ResetEventsPrimaryKeySequence < ActiveRecord::Migration
+class ResetEventsPrimaryKeySequence < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180208183958_schedule_populate_untracked_uploads_if_needed.rb b/db/migrate/20180208183958_schedule_populate_untracked_uploads_if_needed.rb
index e46e793d9d210..b69ac8f94c19d 100644
--- a/db/migrate/20180208183958_schedule_populate_untracked_uploads_if_needed.rb
+++ b/db/migrate/20180208183958_schedule_populate_untracked_uploads_if_needed.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class SchedulePopulateUntrackedUploadsIfNeeded < ActiveRecord::Migration
+class SchedulePopulateUntrackedUploadsIfNeeded < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180209165249_add_closed_by_to_issues.rb b/db/migrate/20180209165249_add_closed_by_to_issues.rb
index e251afd7b4989..91a1e021ab96a 100644
--- a/db/migrate/20180209165249_add_closed_by_to_issues.rb
+++ b/db/migrate/20180209165249_add_closed_by_to_issues.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddClosedByToIssues < ActiveRecord::Migration
+class AddClosedByToIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20180212030105_add_external_ip_to_clusters_applications_ingress.rb b/db/migrate/20180212030105_add_external_ip_to_clusters_applications_ingress.rb
index dbe09a43aa7ec..e2a9a68b1adbf 100644
--- a/db/migrate/20180212030105_add_external_ip_to_clusters_applications_ingress.rb
+++ b/db/migrate/20180212030105_add_external_ip_to_clusters_applications_ingress.rb
@@ -1,4 +1,4 @@
-class AddExternalIpToClustersApplicationsIngress < ActiveRecord::Migration
+class AddExternalIpToClustersApplicationsIngress < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180213131630_add_partial_index_to_projects_for_index_only_scans.rb b/db/migrate/20180213131630_add_partial_index_to_projects_for_index_only_scans.rb
index cedf2510dda1a..905915d923923 100644
--- a/db/migrate/20180213131630_add_partial_index_to_projects_for_index_only_scans.rb
+++ b/db/migrate/20180213131630_add_partial_index_to_projects_for_index_only_scans.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectsForIndexOnlyScans < ActiveRecord::Migration
+class AddPartialIndexToProjectsForIndexOnlyScans < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180214093516_create_badges.rb b/db/migrate/20180214093516_create_badges.rb
index a1d77328f778e..66e017b115ad2 100644
--- a/db/migrate/20180214093516_create_badges.rb
+++ b/db/migrate/20180214093516_create_badges.rb
@@ -1,4 +1,4 @@
-class CreateBadges < ActiveRecord::Migration
+class CreateBadges < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180214155405_create_clusters_applications_runners.rb b/db/migrate/20180214155405_create_clusters_applications_runners.rb
index fc4c088133896..ce594c9189020 100644
--- a/db/migrate/20180214155405_create_clusters_applications_runners.rb
+++ b/db/migrate/20180214155405_create_clusters_applications_runners.rb
@@ -1,4 +1,4 @@
-class CreateClustersApplicationsRunners < ActiveRecord::Migration
+class CreateClustersApplicationsRunners < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180215181245_users_name_lower_index.rb b/db/migrate/20180215181245_users_name_lower_index.rb
index d3f68cb7d45f0..3b80601a7271b 100644
--- a/db/migrate/20180215181245_users_name_lower_index.rb
+++ b/db/migrate/20180215181245_users_name_lower_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class UsersNameLowerIndex < ActiveRecord::Migration
+class UsersNameLowerIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180216120000_add_pages_domain_verification.rb b/db/migrate/20180216120000_add_pages_domain_verification.rb
index 8b7cae922854d..f709f5a5809db 100644
--- a/db/migrate/20180216120000_add_pages_domain_verification.rb
+++ b/db/migrate/20180216120000_add_pages_domain_verification.rb
@@ -1,4 +1,4 @@
-class AddPagesDomainVerification < ActiveRecord::Migration
+class AddPagesDomainVerification < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180216120010_add_pages_domain_verified_at_index.rb b/db/migrate/20180216120010_add_pages_domain_verified_at_index.rb
index 825dfb52dce4d..6e7cb89c7657f 100644
--- a/db/migrate/20180216120010_add_pages_domain_verified_at_index.rb
+++ b/db/migrate/20180216120010_add_pages_domain_verified_at_index.rb
@@ -1,4 +1,4 @@
-class AddPagesDomainVerifiedAtIndex < ActiveRecord::Migration
+class AddPagesDomainVerifiedAtIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180216120020_allow_domain_verification_to_be_disabled.rb b/db/migrate/20180216120020_allow_domain_verification_to_be_disabled.rb
index 06d458028b351..18e4f534105fc 100644
--- a/db/migrate/20180216120020_allow_domain_verification_to_be_disabled.rb
+++ b/db/migrate/20180216120020_allow_domain_verification_to_be_disabled.rb
@@ -1,4 +1,4 @@
-class AllowDomainVerificationToBeDisabled < ActiveRecord::Migration
+class AllowDomainVerificationToBeDisabled < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180216120030_add_pages_domain_enabled_until.rb b/db/migrate/20180216120030_add_pages_domain_enabled_until.rb
index b40653044dd5b..3347bb6deaab0 100644
--- a/db/migrate/20180216120030_add_pages_domain_enabled_until.rb
+++ b/db/migrate/20180216120030_add_pages_domain_enabled_until.rb
@@ -1,4 +1,4 @@
-class AddPagesDomainEnabledUntil < ActiveRecord::Migration
+class AddPagesDomainEnabledUntil < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180216120040_add_pages_domain_enabled_until_index.rb b/db/migrate/20180216120040_add_pages_domain_enabled_until_index.rb
index 00f6e4979da43..3880a8ea139e1 100644
--- a/db/migrate/20180216120040_add_pages_domain_enabled_until_index.rb
+++ b/db/migrate/20180216120040_add_pages_domain_enabled_until_index.rb
@@ -1,4 +1,4 @@
-class AddPagesDomainEnabledUntilIndex < ActiveRecord::Migration
+class AddPagesDomainEnabledUntilIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180216120050_pages_domains_verification_grace_period.rb b/db/migrate/20180216120050_pages_domains_verification_grace_period.rb
index d7f8634b5369d..e51cff68b5004 100644
--- a/db/migrate/20180216120050_pages_domains_verification_grace_period.rb
+++ b/db/migrate/20180216120050_pages_domains_verification_grace_period.rb
@@ -1,4 +1,4 @@
-class PagesDomainsVerificationGracePeriod < ActiveRecord::Migration
+class PagesDomainsVerificationGracePeriod < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   class PagesDomain < ActiveRecord::Base
diff --git a/db/migrate/20180219153455_add_maximum_timeout_to_ci_runners.rb b/db/migrate/20180219153455_add_maximum_timeout_to_ci_runners.rb
index 072e696a43e5b..68578c2320773 100644
--- a/db/migrate/20180219153455_add_maximum_timeout_to_ci_runners.rb
+++ b/db/migrate/20180219153455_add_maximum_timeout_to_ci_runners.rb
@@ -1,4 +1,4 @@
-class AddMaximumTimeoutToCiRunners < ActiveRecord::Migration
+class AddMaximumTimeoutToCiRunners < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180221151752_add_allow_maintainer_to_push_to_merge_requests.rb b/db/migrate/20180221151752_add_allow_maintainer_to_push_to_merge_requests.rb
index 81acfbc365578..71f6bc46a8808 100644
--- a/db/migrate/20180221151752_add_allow_maintainer_to_push_to_merge_requests.rb
+++ b/db/migrate/20180221151752_add_allow_maintainer_to_push_to_merge_requests.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddAllowMaintainerToPushToMergeRequests < ActiveRecord::Migration
+class AddAllowMaintainerToPushToMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180222043024_add_ip_address_to_runner.rb b/db/migrate/20180222043024_add_ip_address_to_runner.rb
index bf00560b5a86e..b52366c0be10a 100644
--- a/db/migrate/20180222043024_add_ip_address_to_runner.rb
+++ b/db/migrate/20180222043024_add_ip_address_to_runner.rb
@@ -1,4 +1,4 @@
-class AddIpAddressToRunner < ActiveRecord::Migration
+class AddIpAddressToRunner < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180223120443_create_user_interacted_projects_table.rb b/db/migrate/20180223120443_create_user_interacted_projects_table.rb
index 8da8cf6808821..185a690ad3d17 100644
--- a/db/migrate/20180223120443_create_user_interacted_projects_table.rb
+++ b/db/migrate/20180223120443_create_user_interacted_projects_table.rb
@@ -1,4 +1,4 @@
-class CreateUserInteractedProjectsTable < ActiveRecord::Migration
+class CreateUserInteractedProjectsTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180223144945_add_allow_local_requests_from_hooks_and_services_to_application_settings.rb b/db/migrate/20180223144945_add_allow_local_requests_from_hooks_and_services_to_application_settings.rb
index c994a54698b15..3bd7d6fd827a2 100644
--- a/db/migrate/20180223144945_add_allow_local_requests_from_hooks_and_services_to_application_settings.rb
+++ b/db/migrate/20180223144945_add_allow_local_requests_from_hooks_and_services_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddAllowLocalRequestsFromHooksAndServicesToApplicationSettings < ActiveRecord::Migration
+class AddAllowLocalRequestsFromHooksAndServicesToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180226050030_add_checksum_to_ci_job_artifacts.rb b/db/migrate/20180226050030_add_checksum_to_ci_job_artifacts.rb
index 54e6e35449e49..bccb7ac26eca2 100644
--- a/db/migrate/20180226050030_add_checksum_to_ci_job_artifacts.rb
+++ b/db/migrate/20180226050030_add_checksum_to_ci_job_artifacts.rb
@@ -1,4 +1,4 @@
-class AddChecksumToCiJobArtifacts < ActiveRecord::Migration
+class AddChecksumToCiJobArtifacts < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180227182112_add_group_id_to_boards_ce.rb b/db/migrate/20180227182112_add_group_id_to_boards_ce.rb
index 5b2691b3a00ac..b887be0cc556e 100644
--- a/db/migrate/20180227182112_add_group_id_to_boards_ce.rb
+++ b/db/migrate/20180227182112_add_group_id_to_boards_ce.rb
@@ -1,4 +1,4 @@
-class AddGroupIdToBoardsCe < ActiveRecord::Migration
+class AddGroupIdToBoardsCe < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/migrate/20180228172924_add_include_private_contributions_to_users.rb b/db/migrate/20180228172924_add_include_private_contributions_to_users.rb
index ea3ebdd83d1b9..7921d3a14b63b 100644
--- a/db/migrate/20180228172924_add_include_private_contributions_to_users.rb
+++ b/db/migrate/20180228172924_add_include_private_contributions_to_users.rb
@@ -1,4 +1,4 @@
-class AddIncludePrivateContributionsToUsers < ActiveRecord::Migration
+class AddIncludePrivateContributionsToUsers < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180301010859_create_ci_builds_metadata_table.rb b/db/migrate/20180301010859_create_ci_builds_metadata_table.rb
index ce73744409233..29652c675e116 100644
--- a/db/migrate/20180301010859_create_ci_builds_metadata_table.rb
+++ b/db/migrate/20180301010859_create_ci_builds_metadata_table.rb
@@ -1,4 +1,4 @@
-class CreateCiBuildsMetadataTable < ActiveRecord::Migration
+class CreateCiBuildsMetadataTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb b/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb
index e6cec39e61f9e..d660c7cfd2d47 100644
--- a/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb
+++ b/db/migrate/20180302152117_ensure_foreign_keys_on_clusters_applications.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class EnsureForeignKeysOnClustersApplications < ActiveRecord::Migration
+class EnsureForeignKeysOnClustersApplications < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180305095250_create_internal_ids_table.rb b/db/migrate/20180305095250_create_internal_ids_table.rb
index 432086fe98b8d..8565f5d848b33 100644
--- a/db/migrate/20180305095250_create_internal_ids_table.rb
+++ b/db/migrate/20180305095250_create_internal_ids_table.rb
@@ -1,4 +1,4 @@
-class CreateInternalIdsTable < ActiveRecord::Migration
+class CreateInternalIdsTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180305144721_add_privileged_to_runner.rb b/db/migrate/20180305144721_add_privileged_to_runner.rb
index 32e73dba8d54b..359498bf9b0dd 100644
--- a/db/migrate/20180305144721_add_privileged_to_runner.rb
+++ b/db/migrate/20180305144721_add_privileged_to_runner.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPrivilegedToRunner < ActiveRecord::Migration
+class AddPrivilegedToRunner < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180306134842_add_missing_indexes_acts_as_taggable_on_engine.rb b/db/migrate/20180306134842_add_missing_indexes_acts_as_taggable_on_engine.rb
index 06e402adcd71c..b400ff94dbebf 100644
--- a/db/migrate/20180306134842_add_missing_indexes_acts_as_taggable_on_engine.rb
+++ b/db/migrate/20180306134842_add_missing_indexes_acts_as_taggable_on_engine.rb
@@ -2,7 +2,7 @@
 #
 # It has been modified to handle no-downtime GitLab migrations. Several
 # indexes have been removed since they are not needed for GitLab.
-class AddMissingIndexesActsAsTaggableOnEngine < ActiveRecord::Migration
+class AddMissingIndexesActsAsTaggableOnEngine < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180308052825_add_section_name_id_index_on_ci_build_trace_sections.rb b/db/migrate/20180308052825_add_section_name_id_index_on_ci_build_trace_sections.rb
index b616cc2fd30aa..4d2ab7d757fe8 100644
--- a/db/migrate/20180308052825_add_section_name_id_index_on_ci_build_trace_sections.rb
+++ b/db/migrate/20180308052825_add_section_name_id_index_on_ci_build_trace_sections.rb
@@ -1,4 +1,4 @@
-class AddSectionNameIdIndexOnCiBuildTraceSections < ActiveRecord::Migration
+class AddSectionNameIdIndexOnCiBuildTraceSections < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180308125206_add_user_internal_regex_to_application_setting.rb b/db/migrate/20180308125206_add_user_internal_regex_to_application_setting.rb
index fe50e909563e5..5e4bf96f86f2d 100644
--- a/db/migrate/20180308125206_add_user_internal_regex_to_application_setting.rb
+++ b/db/migrate/20180308125206_add_user_internal_regex_to_application_setting.rb
@@ -1,4 +1,4 @@
-class AddUserInternalRegexToApplicationSetting < ActiveRecord::Migration
+class AddUserInternalRegexToApplicationSetting < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180309121820_reschedule_commits_count_for_merge_request_diff.rb b/db/migrate/20180309121820_reschedule_commits_count_for_merge_request_diff.rb
index 990759104b011..ecb06dd43121c 100644
--- a/db/migrate/20180309121820_reschedule_commits_count_for_merge_request_diff.rb
+++ b/db/migrate/20180309121820_reschedule_commits_count_for_merge_request_diff.rb
@@ -1,4 +1,4 @@
-class RescheduleCommitsCountForMergeRequestDiff < ActiveRecord::Migration
+class RescheduleCommitsCountForMergeRequestDiff < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180309160427_add_partial_indexes_on_todos.rb b/db/migrate/20180309160427_add_partial_indexes_on_todos.rb
index 671fa743cec88..c22ed0a5177fe 100644
--- a/db/migrate/20180309160427_add_partial_indexes_on_todos.rb
+++ b/db/migrate/20180309160427_add_partial_indexes_on_todos.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPartialIndexesOnTodos < ActiveRecord::Migration
+class AddPartialIndexesOnTodos < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180319190020_create_deploy_tokens.rb b/db/migrate/20180319190020_create_deploy_tokens.rb
index d129459ea0ac5..a4d797679c505 100644
--- a/db/migrate/20180319190020_create_deploy_tokens.rb
+++ b/db/migrate/20180319190020_create_deploy_tokens.rb
@@ -1,4 +1,4 @@
-class CreateDeployTokens < ActiveRecord::Migration
+class CreateDeployTokens < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb b/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
index 824bbb3ac05a2..a15e1d68a958c 100644
--- a/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
+++ b/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
@@ -1,4 +1,4 @@
-class AddIndexesForUserActivityQueries < ActiveRecord::Migration
+class AddIndexesForUserActivityQueries < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180323150945_add_push_to_merge_request_to_notification_settings.rb b/db/migrate/20180323150945_add_push_to_merge_request_to_notification_settings.rb
index 12b8875d8dcd6..3b38d21a8aa82 100644
--- a/db/migrate/20180323150945_add_push_to_merge_request_to_notification_settings.rb
+++ b/db/migrate/20180323150945_add_push_to_merge_request_to_notification_settings.rb
@@ -1,4 +1,4 @@
-class AddPushToMergeRequestToNotificationSettings < ActiveRecord::Migration
+class AddPushToMergeRequestToNotificationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180326202229_create_ci_build_trace_chunks.rb b/db/migrate/20180326202229_create_ci_build_trace_chunks.rb
index fb3f5786e856c..45a64ec23d1f4 100644
--- a/db/migrate/20180326202229_create_ci_build_trace_chunks.rb
+++ b/db/migrate/20180326202229_create_ci_build_trace_chunks.rb
@@ -1,4 +1,4 @@
-class CreateCiBuildTraceChunks < ActiveRecord::Migration
+class CreateCiBuildTraceChunks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180327101207_remove_index_from_events_table.rb b/db/migrate/20180327101207_remove_index_from_events_table.rb
index 172441da65b58..0583a2641ecb8 100644
--- a/db/migrate/20180327101207_remove_index_from_events_table.rb
+++ b/db/migrate/20180327101207_remove_index_from_events_table.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveIndexFromEventsTable < ActiveRecord::Migration
+class RemoveIndexFromEventsTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb b/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb
index c64a481fcf08e..2d9ca0028721e 100644
--- a/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb
+++ b/db/migrate/20180330121048_add_issue_due_to_notification_settings.rb
@@ -1,4 +1,4 @@
-class AddIssueDueToNotificationSettings < ActiveRecord::Migration
+class AddIssueDueToNotificationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180403035759_create_project_ci_cd_settings.rb b/db/migrate/20180403035759_create_project_ci_cd_settings.rb
index 173e662cffc78..000286897791f 100644
--- a/db/migrate/20180403035759_create_project_ci_cd_settings.rb
+++ b/db/migrate/20180403035759_create_project_ci_cd_settings.rb
@@ -1,4 +1,4 @@
-class CreateProjectCiCdSettings < ActiveRecord::Migration
+class CreateProjectCiCdSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180405142733_create_project_deploy_tokens.rb b/db/migrate/20180405142733_create_project_deploy_tokens.rb
index 9d8f89243a82f..ba0004922478c 100644
--- a/db/migrate/20180405142733_create_project_deploy_tokens.rb
+++ b/db/migrate/20180405142733_create_project_deploy_tokens.rb
@@ -1,4 +1,4 @@
-class CreateProjectDeployTokens < ActiveRecord::Migration
+class CreateProjectDeployTokens < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb b/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb
index 0f2734853e6b6..0b541e943538c 100644
--- a/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb
+++ b/db/migrate/20180406204716_add_limits_ci_build_trace_chunks_raw_data_for_mysql.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 require Rails.root.join('db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql')
 
-class AddLimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration
+class AddLimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb b/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb
index e852d50b25ed0..4b8844a134de8 100644
--- a/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb
+++ b/db/migrate/20180408143354_rename_users_rss_token_to_feed_token.rb
@@ -1,4 +1,4 @@
-class RenameUsersRssTokenToFeedToken < ActiveRecord::Migration
+class RenameUsersRssTokenToFeedToken < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb b/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb
index b7b346cb10ea1..90d869a8c10e3 100644
--- a/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb
+++ b/db/migrate/20180413022611_create_missing_namespace_for_internal_users.rb
@@ -1,4 +1,4 @@
-class CreateMissingNamespaceForInternalUsers < ActiveRecord::Migration
+class CreateMissingNamespaceForInternalUsers < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20180416155103_add_further_scope_columns_to_internal_id_table.rb b/db/migrate/20180416155103_add_further_scope_columns_to_internal_id_table.rb
index 37e2d19e022a6..7c28cbb67957a 100644
--- a/db/migrate/20180416155103_add_further_scope_columns_to_internal_id_table.rb
+++ b/db/migrate/20180416155103_add_further_scope_columns_to_internal_id_table.rb
@@ -1,4 +1,4 @@
-class AddFurtherScopeColumnsToInternalIdTable < ActiveRecord::Migration
+class AddFurtherScopeColumnsToInternalIdTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb b/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb
index 58de795472ab6..ac6bb1a8cab0d 100644
--- a/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb
+++ b/db/migrate/20180417090132_add_index_constraints_to_internal_id_table.rb
@@ -1,4 +1,4 @@
-class AddIndexConstraintsToInternalIdTable < ActiveRecord::Migration
+class AddIndexConstraintsToInternalIdTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb b/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb
index ee82c70ecf879..ce4708849992a 100644
--- a/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb
+++ b/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb
@@ -1,4 +1,4 @@
-class AddTmpStagePriorityIndexToCiBuilds < ActiveRecord::Migration
+class AddTmpStagePriorityIndexToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180417101940_add_index_to_ci_stage.rb b/db/migrate/20180417101940_add_index_to_ci_stage.rb
index 9dac78db7746d..97a8f5efce06e 100644
--- a/db/migrate/20180417101940_add_index_to_ci_stage.rb
+++ b/db/migrate/20180417101940_add_index_to_ci_stage.rb
@@ -1,4 +1,4 @@
-class AddIndexToCiStage < ActiveRecord::Migration
+class AddIndexToCiStage < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb b/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
index ac91624c3d54e..4b574923483e0 100644
--- a/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
+++ b/db/migrate/20180418053107_add_index_to_ci_job_artifacts_file_store.rb
@@ -1,4 +1,4 @@
-class AddIndexToCiJobArtifactsFileStore < ActiveRecord::Migration
+class AddIndexToCiJobArtifactsFileStore < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb b/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb
index 6fabe07bc9c86..90a908feaee7e 100644
--- a/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb
+++ b/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddPipelineBuildForeignKey < ActiveRecord::Migration
+class AddPipelineBuildForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180420010616_cleanup_build_stage_migration.rb b/db/migrate/20180420010616_cleanup_build_stage_migration.rb
index 5e9fe756efda7..30c0d97781dca 100644
--- a/db/migrate/20180420010616_cleanup_build_stage_migration.rb
+++ b/db/migrate/20180420010616_cleanup_build_stage_migration.rb
@@ -1,4 +1,4 @@
-class CleanupBuildStageMigration < ActiveRecord::Migration
+class CleanupBuildStageMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180423204600_add_pages_access_level_to_project_feature.rb b/db/migrate/20180423204600_add_pages_access_level_to_project_feature.rb
index 1d2f8cf9c7681..0c536f917ce5c 100644
--- a/db/migrate/20180423204600_add_pages_access_level_to_project_feature.rb
+++ b/db/migrate/20180423204600_add_pages_access_level_to_project_feature.rb
@@ -1,4 +1,4 @@
-class AddPagesAccessLevelToProjectFeature < ActiveRecord::Migration
+class AddPagesAccessLevelToProjectFeature < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb b/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb
index f5afdb0e4e6dd..b8fd71002a1b4 100644
--- a/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb
+++ b/db/migrate/20180424090541_add_enforce_terms_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddEnforceTermsToApplicationSettings < ActiveRecord::Migration
+class AddEnforceTermsToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180424134533_create_application_setting_terms.rb b/db/migrate/20180424134533_create_application_setting_terms.rb
index f29335cfc519c..8741f20daebb0 100644
--- a/db/migrate/20180424134533_create_application_setting_terms.rb
+++ b/db/migrate/20180424134533_create_application_setting_terms.rb
@@ -1,4 +1,4 @@
-class CreateApplicationSettingTerms < ActiveRecord::Migration
+class CreateApplicationSettingTerms < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb b/db/migrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb
index e8f0c91d612a8..550b5a2c149f3 100644
--- a/db/migrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb
+++ b/db/migrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb
@@ -1,4 +1,4 @@
-class AddPipelineIidToCiPipelines < ActiveRecord::Migration
+class AddPipelineIidToCiPipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180425075446_create_term_agreements.rb b/db/migrate/20180425075446_create_term_agreements.rb
index 1fa2c8dd3befb..25182215841ae 100644
--- a/db/migrate/20180425075446_create_term_agreements.rb
+++ b/db/migrate/20180425075446_create_term_agreements.rb
@@ -1,4 +1,4 @@
-class CreateTermAgreements < ActiveRecord::Migration
+class CreateTermAgreements < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180425131009_assure_commits_count_for_merge_request_diff.rb b/db/migrate/20180425131009_assure_commits_count_for_merge_request_diff.rb
index 0e991c23bfa6f..7d38a15b850d1 100644
--- a/db/migrate/20180425131009_assure_commits_count_for_merge_request_diff.rb
+++ b/db/migrate/20180425131009_assure_commits_count_for_merge_request_diff.rb
@@ -1,4 +1,4 @@
-class AssureCommitsCountForMergeRequestDiff < ActiveRecord::Migration
+class AssureCommitsCountForMergeRequestDiff < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180425205249_add_index_constraints_to_pipeline_iid.rb b/db/migrate/20180425205249_add_index_constraints_to_pipeline_iid.rb
index 3fa59b44d5d79..8a0cb7ae4e405 100644
--- a/db/migrate/20180425205249_add_index_constraints_to_pipeline_iid.rb
+++ b/db/migrate/20180425205249_add_index_constraints_to_pipeline_iid.rb
@@ -1,4 +1,4 @@
-class AddIndexConstraintsToPipelineIid < ActiveRecord::Migration
+class AddIndexConstraintsToPipelineIid < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180426102016_add_accepted_term_to_users.rb b/db/migrate/20180426102016_add_accepted_term_to_users.rb
index 3d446f662146f..3c6665b426437 100644
--- a/db/migrate/20180426102016_add_accepted_term_to_users.rb
+++ b/db/migrate/20180426102016_add_accepted_term_to_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddAcceptedTermToUsers < ActiveRecord::Migration
+class AddAcceptedTermToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb b/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb
index 42409349b755d..a74231e0f44a0 100644
--- a/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb
+++ b/db/migrate/20180430101916_add_runner_type_to_ci_runners.rb
@@ -1,4 +1,4 @@
-class AddRunnerTypeToCiRunners < ActiveRecord::Migration
+class AddRunnerTypeToCiRunners < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180502122856_create_project_mirror_data.rb b/db/migrate/20180502122856_create_project_mirror_data.rb
index 8554c74190462..9781815a97b46 100644
--- a/db/migrate/20180502122856_create_project_mirror_data.rb
+++ b/db/migrate/20180502122856_create_project_mirror_data.rb
@@ -1,4 +1,4 @@
-class CreateProjectMirrorData < ActiveRecord::Migration
+class CreateProjectMirrorData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503131624_create_remote_mirrors.rb b/db/migrate/20180503131624_create_remote_mirrors.rb
index 601c184ed7691..288ae365f0fd0 100644
--- a/db/migrate/20180503131624_create_remote_mirrors.rb
+++ b/db/migrate/20180503131624_create_remote_mirrors.rb
@@ -1,4 +1,4 @@
-class CreateRemoteMirrors < ActiveRecord::Migration
+class CreateRemoteMirrors < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503141722_add_remote_mirror_available_overridden_to_projects.rb b/db/migrate/20180503141722_add_remote_mirror_available_overridden_to_projects.rb
index cc21f3c4fd345..1d99d46b7d6ac 100644
--- a/db/migrate/20180503141722_add_remote_mirror_available_overridden_to_projects.rb
+++ b/db/migrate/20180503141722_add_remote_mirror_available_overridden_to_projects.rb
@@ -1,4 +1,4 @@
-class AddRemoteMirrorAvailableOverriddenToProjects < ActiveRecord::Migration
+class AddRemoteMirrorAvailableOverriddenToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb
index 9e55690bd33c6..899e4a05cbdc5 100644
--- a/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb
+++ b/db/migrate/20180503150427_add_index_to_namespaces_runners_token.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexToNamespacesRunnersToken < ActiveRecord::Migration
+class AddIndexToNamespacesRunnersToken < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb b/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb
index 970a53d68d07c..3775b3a08c9d7 100644
--- a/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb
+++ b/db/migrate/20180503175053_ensure_missing_columns_to_project_mirror_data.rb
@@ -1,4 +1,4 @@
-class EnsureMissingColumnsToProjectMirrorData < ActiveRecord::Migration
+class EnsureMissingColumnsToProjectMirrorData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb b/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb
index b59b941c815d3..15a188594b0fd 100644
--- a/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb
+++ b/db/migrate/20180503175054_add_indexes_to_project_mirror_data.rb
@@ -1,4 +1,4 @@
-class AddIndexesToProjectMirrorData < ActiveRecord::Migration
+class AddIndexesToProjectMirrorData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb b/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
index aeec5e8555457..19bed8d0500b7 100644
--- a/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
+++ b/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
@@ -1,4 +1,4 @@
-class AddIndexesToRemoteMirror < ActiveRecord::Migration
+class AddIndexesToRemoteMirror < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503193953_add_mirror_available_to_application_settings.rb b/db/migrate/20180503193953_add_mirror_available_to_application_settings.rb
index b67b1aa648cf3..d6a04035d4817 100644
--- a/db/migrate/20180503193953_add_mirror_available_to_application_settings.rb
+++ b/db/migrate/20180503193953_add_mirror_available_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddMirrorAvailableToApplicationSettings < ActiveRecord::Migration
+class AddMirrorAvailableToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180503200320_enable_prometheus_metrics_by_default.rb b/db/migrate/20180503200320_enable_prometheus_metrics_by_default.rb
index 2c8f86ff0f48d..bab3b1787135b 100644
--- a/db/migrate/20180503200320_enable_prometheus_metrics_by_default.rb
+++ b/db/migrate/20180503200320_enable_prometheus_metrics_by_default.rb
@@ -1,4 +1,4 @@
-class EnablePrometheusMetricsByDefault < ActiveRecord::Migration
+class EnablePrometheusMetricsByDefault < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20180504195842_project_name_lower_index.rb b/db/migrate/20180504195842_project_name_lower_index.rb
index 74f3673bb03b5..3fe90c3fbb1e5 100644
--- a/db/migrate/20180504195842_project_name_lower_index.rb
+++ b/db/migrate/20180504195842_project_name_lower_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ProjectNameLowerIndex < ActiveRecord::Migration
+class ProjectNameLowerIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180508055821_make_remote_mirrors_disabled_by_default.rb b/db/migrate/20180508055821_make_remote_mirrors_disabled_by_default.rb
index 0d8a8357a1eff..81aa18c8b863e 100644
--- a/db/migrate/20180508055821_make_remote_mirrors_disabled_by_default.rb
+++ b/db/migrate/20180508055821_make_remote_mirrors_disabled_by_default.rb
@@ -1,4 +1,4 @@
-class MakeRemoteMirrorsDisabledByDefault < ActiveRecord::Migration
+class MakeRemoteMirrorsDisabledByDefault < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/20180508100222_add_not_null_constraint_to_project_mirror_data_foreign_key.rb b/db/migrate/20180508100222_add_not_null_constraint_to_project_mirror_data_foreign_key.rb
index 82087d15ccbe1..dba5d20f276ab 100644
--- a/db/migrate/20180508100222_add_not_null_constraint_to_project_mirror_data_foreign_key.rb
+++ b/db/migrate/20180508100222_add_not_null_constraint_to_project_mirror_data_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddNotNullConstraintToProjectMirrorDataForeignKey < ActiveRecord::Migration
+class AddNotNullConstraintToProjectMirrorDataForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180508102840_add_unique_constraint_to_project_mirror_data_project_id_index.rb b/db/migrate/20180508102840_add_unique_constraint_to_project_mirror_data_project_id_index.rb
index acb976b52fa3b..b225354ca43fb 100644
--- a/db/migrate/20180508102840_add_unique_constraint_to_project_mirror_data_project_id_index.rb
+++ b/db/migrate/20180508102840_add_unique_constraint_to_project_mirror_data_project_id_index.rb
@@ -1,4 +1,4 @@
-class AddUniqueConstraintToProjectMirrorDataProjectIdIndex < ActiveRecord::Migration
+class AddUniqueConstraintToProjectMirrorDataProjectIdIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180508135515_set_runner_type_not_null.rb b/db/migrate/20180508135515_set_runner_type_not_null.rb
index dd043ec7179d3..00c546c8f47b8 100644
--- a/db/migrate/20180508135515_set_runner_type_not_null.rb
+++ b/db/migrate/20180508135515_set_runner_type_not_null.rb
@@ -1,4 +1,4 @@
-class SetRunnerTypeNotNull < ActiveRecord::Migration
+class SetRunnerTypeNotNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb b/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb
index f3ed20fd243dd..4913b8602c9f2 100644
--- a/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb
+++ b/db/migrate/20180511090724_add_index_on_ci_runners_runner_type.rb
@@ -1,4 +1,4 @@
-class AddIndexOnCiRunnersRunnerType < ActiveRecord::Migration
+class AddIndexOnCiRunnersRunnerType < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180511131058_create_clusters_applications_jupyter.rb b/db/migrate/20180511131058_create_clusters_applications_jupyter.rb
index f3923884e37d4..749aeeb4792cc 100644
--- a/db/migrate/20180511131058_create_clusters_applications_jupyter.rb
+++ b/db/migrate/20180511131058_create_clusters_applications_jupyter.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreateClustersApplicationsJupyter < ActiveRecord::Migration
+class CreateClustersApplicationsJupyter < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180515005612_add_squash_to_merge_requests.rb b/db/migrate/20180515005612_add_squash_to_merge_requests.rb
index fd85e968acd49..14636d6fd8ef7 100644
--- a/db/migrate/20180515005612_add_squash_to_merge_requests.rb
+++ b/db/migrate/20180515005612_add_squash_to_merge_requests.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddSquashToMergeRequests < ActiveRecord::Migration
+class AddSquashToMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/migrate/20180515121227_create_notes_diff_files.rb b/db/migrate/20180515121227_create_notes_diff_files.rb
index efcd3bb9c7e70..e50324d8599b8 100644
--- a/db/migrate/20180515121227_create_notes_diff_files.rb
+++ b/db/migrate/20180515121227_create_notes_diff_files.rb
@@ -1,4 +1,4 @@
-class CreateNotesDiffFiles < ActiveRecord::Migration
+class CreateNotesDiffFiles < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/db/migrate/20180517082340_add_not_null_constraints_to_project_authorizations.rb b/db/migrate/20180517082340_add_not_null_constraints_to_project_authorizations.rb
index 3b7b877232bc6..36f4770ff3297 100644
--- a/db/migrate/20180517082340_add_not_null_constraints_to_project_authorizations.rb
+++ b/db/migrate/20180517082340_add_not_null_constraints_to_project_authorizations.rb
@@ -1,4 +1,4 @@
-class AddNotNullConstraintsToProjectAuthorizations < ActiveRecord::Migration
+class AddNotNullConstraintsToProjectAuthorizations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
index 41bc7b71694d7..131dca1fbc293 100644
--- a/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
+++ b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
@@ -1,4 +1,4 @@
-class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration
+class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180524132016_merge_requests_target_id_iid_state_partial_index.rb b/db/migrate/20180524132016_merge_requests_target_id_iid_state_partial_index.rb
index cee576b91c85c..bff4690427ed6 100644
--- a/db/migrate/20180524132016_merge_requests_target_id_iid_state_partial_index.rb
+++ b/db/migrate/20180524132016_merge_requests_target_id_iid_state_partial_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeRequestsTargetIdIidStatePartialIndex < ActiveRecord::Migration
+class MergeRequestsTargetIdIidStatePartialIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180529093006_ensure_remote_mirror_columns.rb b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb
index 22e9482cb1d76..207e1f089fbde 100644
--- a/db/migrate/20180529093006_ensure_remote_mirror_columns.rb
+++ b/db/migrate/20180529093006_ensure_remote_mirror_columns.rb
@@ -1,4 +1,4 @@
-class EnsureRemoteMirrorColumns < ActiveRecord::Migration
+class EnsureRemoteMirrorColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180530135500_add_index_to_stages_position.rb b/db/migrate/20180530135500_add_index_to_stages_position.rb
index 61150f33a2562..eabf94ab8ec83 100644
--- a/db/migrate/20180530135500_add_index_to_stages_position.rb
+++ b/db/migrate/20180530135500_add_index_to_stages_position.rb
@@ -1,4 +1,4 @@
-class AddIndexToStagesPosition < ActiveRecord::Migration
+class AddIndexToStagesPosition < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180531185349_add_repository_languages.rb b/db/migrate/20180531185349_add_repository_languages.rb
index bfcfb618c87fc..26a01c3bb26ce 100644
--- a/db/migrate/20180531185349_add_repository_languages.rb
+++ b/db/migrate/20180531185349_add_repository_languages.rb
@@ -1,4 +1,4 @@
-class AddRepositoryLanguages < ActiveRecord::Migration
+class AddRepositoryLanguages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
index dbbbcd1f62265..cf621c46f2b4f 100644
--- a/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
+++ b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
@@ -1,4 +1,4 @@
-class ChangeDefaultValueForDsaKeyRestriction < ActiveRecord::Migration
+class ChangeDefaultValueForDsaKeyRestriction < ActiveRecord::Migration[4.2]
   # Set this constant to true if this migration requires downtime.
   DOWNTIME = false
 
diff --git a/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb b/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb
index 6f50d428965ef..78a3617ec9336 100644
--- a/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb
+++ b/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration
+class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180607071808_add_push_events_branch_filter_to_web_hooks.rb b/db/migrate/20180607071808_add_push_events_branch_filter_to_web_hooks.rb
index 6a69460e611ec..e6a1daaffc2cc 100644
--- a/db/migrate/20180607071808_add_push_events_branch_filter_to_web_hooks.rb
+++ b/db/migrate/20180607071808_add_push_events_branch_filter_to_web_hooks.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPushEventsBranchFilterToWebHooks < ActiveRecord::Migration
+class AddPushEventsBranchFilterToWebHooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180608091413_add_group_to_todos.rb b/db/migrate/20180608091413_add_group_to_todos.rb
index 20ba48490571c..7f8efd78c5917 100644
--- a/db/migrate/20180608091413_add_group_to_todos.rb
+++ b/db/migrate/20180608091413_add_group_to_todos.rb
@@ -1,4 +1,4 @@
-class AddGroupToTodos < ActiveRecord::Migration
+class AddGroupToTodos < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
index 36f2a593fbe85..0f2d5ba3a5eb3 100644
--- a/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
+++ b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameMergeRequestsAllowCollaboration < ActiveRecord::Migration
+class RenameMergeRequestsAllowCollaboration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180612103626_add_columns_for_helm_tiller_certificates.rb b/db/migrate/20180612103626_add_columns_for_helm_tiller_certificates.rb
index 57cea18abcd7d..d7273dff48ef6 100644
--- a/db/migrate/20180612103626_add_columns_for_helm_tiller_certificates.rb
+++ b/db/migrate/20180612103626_add_columns_for_helm_tiller_certificates.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddColumnsForHelmTillerCertificates < ActiveRecord::Migration
+class AddColumnsForHelmTillerCertificates < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180613081317_create_ci_builds_runner_session.rb b/db/migrate/20180613081317_create_ci_builds_runner_session.rb
index e550c07b9ab10..eb41f76b10567 100644
--- a/db/migrate/20180613081317_create_ci_builds_runner_session.rb
+++ b/db/migrate/20180613081317_create_ci_builds_runner_session.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreateCiBuildsRunnerSession < ActiveRecord::Migration
+class CreateCiBuildsRunnerSession < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180625113853_create_import_export_uploads.rb b/db/migrate/20180625113853_create_import_export_uploads.rb
index be42304b0ae01..d76b3e8cc1525 100644
--- a/db/migrate/20180625113853_create_import_export_uploads.rb
+++ b/db/migrate/20180625113853_create_import_export_uploads.rb
@@ -1,4 +1,4 @@
-class CreateImportExportUploads < ActiveRecord::Migration
+class CreateImportExportUploads < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180626125654_add_index_on_deployable_for_deployments.rb b/db/migrate/20180626125654_add_index_on_deployable_for_deployments.rb
index a0e3a228f6c8e..0fc14b43fae22 100644
--- a/db/migrate/20180626125654_add_index_on_deployable_for_deployments.rb
+++ b/db/migrate/20180626125654_add_index_on_deployable_for_deployments.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexOnDeployableForDeployments < ActiveRecord::Migration
+class AddIndexOnDeployableForDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180628124813_alter_web_hook_logs_indexes.rb b/db/migrate/20180628124813_alter_web_hook_logs_indexes.rb
index 289c87b30d26c..64ef165c5e6f9 100644
--- a/db/migrate/20180628124813_alter_web_hook_logs_indexes.rb
+++ b/db/migrate/20180628124813_alter_web_hook_logs_indexes.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AlterWebHookLogsIndexes < ActiveRecord::Migration
+class AlterWebHookLogsIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180629153018_create_site_statistics.rb b/db/migrate/20180629153018_create_site_statistics.rb
index 085ce1ba64b27..60a32b3b2a7b0 100644
--- a/db/migrate/20180629153018_create_site_statistics.rb
+++ b/db/migrate/20180629153018_create_site_statistics.rb
@@ -1,4 +1,4 @@
-class CreateSiteStatistics < ActiveRecord::Migration
+class CreateSiteStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180702124358_remove_orphaned_routes.rb b/db/migrate/20180702124358_remove_orphaned_routes.rb
index 4068e479b6c29..62c15f9cd00cf 100644
--- a/db/migrate/20180702124358_remove_orphaned_routes.rb
+++ b/db/migrate/20180702124358_remove_orphaned_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveOrphanedRoutes < ActiveRecord::Migration
+class RemoveOrphanedRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180702134423_generate_missing_routes.rb b/db/migrate/20180702134423_generate_missing_routes.rb
index 994725f9bd1a4..a440bc3179c3d 100644
--- a/db/migrate/20180702134423_generate_missing_routes.rb
+++ b/db/migrate/20180702134423_generate_missing_routes.rb
@@ -7,7 +7,7 @@
 # On GitLab.com this would insert 611 project routes, and 0 namespace routes.
 # The exact number could vary per instance, so we take care of both just in
 # case.
-class GenerateMissingRoutes < ActiveRecord::Migration
+class GenerateMissingRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180704204006_add_hide_third_party_offers_to_application_settings.rb b/db/migrate/20180704204006_add_hide_third_party_offers_to_application_settings.rb
index 6631c5d1b6c03..03afbe217b57f 100644
--- a/db/migrate/20180704204006_add_hide_third_party_offers_to_application_settings.rb
+++ b/db/migrate/20180704204006_add_hide_third_party_offers_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddHideThirdPartyOffersToApplicationSettings < ActiveRecord::Migration
+class AddHideThirdPartyOffersToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180705160945_add_file_format_to_ci_job_artifacts.rb b/db/migrate/20180705160945_add_file_format_to_ci_job_artifacts.rb
index 63c188693f35f..938438841a541 100644
--- a/db/migrate/20180705160945_add_file_format_to_ci_job_artifacts.rb
+++ b/db/migrate/20180705160945_add_file_format_to_ci_job_artifacts.rb
@@ -1,4 +1,4 @@
-class AddFileFormatToCiJobArtifacts < ActiveRecord::Migration
+class AddFileFormatToCiJobArtifacts < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180710162338_add_foreign_key_from_notification_settings_to_users.rb b/db/migrate/20180710162338_add_foreign_key_from_notification_settings_to_users.rb
index 91656f194e5f2..79691f2b24cd1 100644
--- a/db/migrate/20180710162338_add_foreign_key_from_notification_settings_to_users.rb
+++ b/db/migrate/20180710162338_add_foreign_key_from_notification_settings_to_users.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyFromNotificationSettingsToUsers < ActiveRecord::Migration
+class AddForeignKeyFromNotificationSettingsToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class NotificationSetting < ActiveRecord::Base
diff --git a/db/migrate/20180711103851_drop_duplicate_protected_tags.rb b/db/migrate/20180711103851_drop_duplicate_protected_tags.rb
index 8fa2137551e27..6166aa65f1fb8 100644
--- a/db/migrate/20180711103851_drop_duplicate_protected_tags.rb
+++ b/db/migrate/20180711103851_drop_duplicate_protected_tags.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class DropDuplicateProtectedTags < ActiveRecord::Migration
+class DropDuplicateProtectedTags < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/db/migrate/20180711103922_add_protected_tags_index.rb b/db/migrate/20180711103922_add_protected_tags_index.rb
index 7ed2258ebaf7e..ef81ca633c3f9 100644
--- a/db/migrate/20180711103922_add_protected_tags_index.rb
+++ b/db/migrate/20180711103922_add_protected_tags_index.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddProtectedTagsIndex < ActiveRecord::Migration
+class AddProtectedTagsIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180713092803_create_user_statuses.rb b/db/migrate/20180713092803_create_user_statuses.rb
index cbe21b89ad9c5..43b96805c1ef3 100644
--- a/db/migrate/20180713092803_create_user_statuses.rb
+++ b/db/migrate/20180713092803_create_user_statuses.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateUserStatuses < ActiveRecord::Migration
+class CreateUserStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180717125853_remove_restricted_todos.rb b/db/migrate/20180717125853_remove_restricted_todos.rb
index fdf43921a7371..1d4bbf6571ece 100644
--- a/db/migrate/20180717125853_remove_restricted_todos.rb
+++ b/db/migrate/20180717125853_remove_restricted_todos.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 # frozen_string_literal: true
 
-class RemoveRestrictedTodos < ActiveRecord::Migration
+class RemoveRestrictedTodos < ActiveRecord::Migration[4.2]
   DOWNTIME = false
   disable_ddl_transaction!
 
diff --git a/db/migrate/20180718005113_add_instance_statistics_visibility_to_application_setting.rb b/db/migrate/20180718005113_add_instance_statistics_visibility_to_application_setting.rb
index 4b6c1f74346fb..ed5fa58b481d7 100644
--- a/db/migrate/20180718005113_add_instance_statistics_visibility_to_application_setting.rb
+++ b/db/migrate/20180718005113_add_instance_statistics_visibility_to_application_setting.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddInstanceStatisticsVisibilityToApplicationSetting < ActiveRecord::Migration
+class AddInstanceStatisticsVisibilityToApplicationSetting < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180720023512_add_receive_max_input_size_to_application_settings.rb b/db/migrate/20180720023512_add_receive_max_input_size_to_application_settings.rb
index 4ed851a078060..0cf3c78507e9d 100644
--- a/db/migrate/20180720023512_add_receive_max_input_size_to_application_settings.rb
+++ b/db/migrate/20180720023512_add_receive_max_input_size_to_application_settings.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddReceiveMaxInputSizeToApplicationSettings < ActiveRecord::Migration
+class AddReceiveMaxInputSizeToApplicationSettings < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180722103201_add_private_profile_to_users.rb b/db/migrate/20180722103201_add_private_profile_to_users.rb
index 4f7ef1322d8cf..c8d917065bb40 100644
--- a/db/migrate/20180722103201_add_private_profile_to_users.rb
+++ b/db/migrate/20180722103201_add_private_profile_to_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPrivateProfileToUsers < ActiveRecord::Migration
+class AddPrivateProfileToUsers < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180723135214_add_web_ide_client_side_preview_enabled_to_application_settings.rb b/db/migrate/20180723135214_add_web_ide_client_side_preview_enabled_to_application_settings.rb
index 1ebb91da00c0d..23b8e04674a38 100644
--- a/db/migrate/20180723135214_add_web_ide_client_side_preview_enabled_to_application_settings.rb
+++ b/db/migrate/20180723135214_add_web_ide_client_side_preview_enabled_to_application_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddWebIdeClientSidePreviewEnabledToApplicationSettings < ActiveRecord::Migration
+class AddWebIdeClientSidePreviewEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180726172057_create_resource_label_events.rb b/db/migrate/20180726172057_create_resource_label_events.rb
index 9f7a3192c68bb..699215b1b467c 100644
--- a/db/migrate/20180726172057_create_resource_label_events.rb
+++ b/db/migrate/20180726172057_create_resource_label_events.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateResourceLabelEvents < ActiveRecord::Migration
+class CreateResourceLabelEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb b/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb
index f4f7cb6f8ca79..c957fc2f6fcf8 100644
--- a/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb
+++ b/db/migrate/20180807153545_remove_redundant_status_index_on_ci_builds.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class RemoveRedundantStatusIndexOnCiBuilds < ActiveRecord::Migration
+class RemoveRedundantStatusIndexOnCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180808162000_add_user_show_add_ssh_key_message_to_application_settings.rb b/db/migrate/20180808162000_add_user_show_add_ssh_key_message_to_application_settings.rb
index e3019af2cc9ba..946d99a4c5f33 100644
--- a/db/migrate/20180808162000_add_user_show_add_ssh_key_message_to_application_settings.rb
+++ b/db/migrate/20180808162000_add_user_show_add_ssh_key_message_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddUserShowAddSshKeyMessageToApplicationSettings < ActiveRecord::Migration
+class AddUserShowAddSshKeyMessageToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180813101999_change_default_of_auto_devops_instance_wide.rb b/db/migrate/20180813101999_change_default_of_auto_devops_instance_wide.rb
index 05d1124f5c453..da101bc76e32a 100644
--- a/db/migrate/20180813101999_change_default_of_auto_devops_instance_wide.rb
+++ b/db/migrate/20180813101999_change_default_of_auto_devops_instance_wide.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class ChangeDefaultOfAutoDevopsInstanceWide < ActiveRecord::Migration
+class ChangeDefaultOfAutoDevopsInstanceWide < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180813102000_enable_auto_devops_instance_wide_for_everyone.rb b/db/migrate/20180813102000_enable_auto_devops_instance_wide_for_everyone.rb
index 21fb62806b37c..1531fad2c6ce0 100644
--- a/db/migrate/20180813102000_enable_auto_devops_instance_wide_for_everyone.rb
+++ b/db/migrate/20180813102000_enable_auto_devops_instance_wide_for_everyone.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class EnableAutoDevopsInstanceWideForEveryone < ActiveRecord::Migration
+class EnableAutoDevopsInstanceWideForEveryone < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180814153625_add_commit_email_to_users.rb b/db/migrate/20180814153625_add_commit_email_to_users.rb
index 5c87d73688e16..4d9217ea50495 100644
--- a/db/migrate/20180814153625_add_commit_email_to_users.rb
+++ b/db/migrate/20180814153625_add_commit_email_to_users.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCommitEmailToUsers < ActiveRecord::Migration
+class AddCommitEmailToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180815040323_add_authorization_type_to_cluster_platforms_kubernetes.rb b/db/migrate/20180815040323_add_authorization_type_to_cluster_platforms_kubernetes.rb
index 6397d6dd99f41..44125b4696a6c 100644
--- a/db/migrate/20180815040323_add_authorization_type_to_cluster_platforms_kubernetes.rb
+++ b/db/migrate/20180815040323_add_authorization_type_to_cluster_platforms_kubernetes.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddAuthorizationTypeToClusterPlatformsKubernetes < ActiveRecord::Migration
+class AddAuthorizationTypeToClusterPlatformsKubernetes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180815160409_add_file_location_to_ci_job_artifacts.rb b/db/migrate/20180815160409_add_file_location_to_ci_job_artifacts.rb
index 620342005fe3f..389101902d06e 100644
--- a/db/migrate/20180815160409_add_file_location_to_ci_job_artifacts.rb
+++ b/db/migrate/20180815160409_add_file_location_to_ci_job_artifacts.rb
@@ -1,4 +1,4 @@
-class AddFileLocationToCiJobArtifacts < ActiveRecord::Migration
+class AddFileLocationToCiJobArtifacts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180815170510_add_partial_index_to_ci_builds_artifacts_file.rb b/db/migrate/20180815170510_add_partial_index_to_ci_builds_artifacts_file.rb
index 5e041ea6559de..237e6ba45594e 100644
--- a/db/migrate/20180815170510_add_partial_index_to_ci_builds_artifacts_file.rb
+++ b/db/migrate/20180815170510_add_partial_index_to_ci_builds_artifacts_file.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToCiBuildsArtifactsFile < ActiveRecord::Migration
+class AddPartialIndexToCiBuildsArtifactsFile < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180815175440_add_index_on_list_type.rb b/db/migrate/20180815175440_add_index_on_list_type.rb
index aad805e436e18..3fe0f6b8de5d6 100644
--- a/db/migrate/20180815175440_add_index_on_list_type.rb
+++ b/db/migrate/20180815175440_add_index_on_list_type.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddIndexOnListType < ActiveRecord::Migration
+class AddIndexOnListType < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb b/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb
index 28c92e7c7acf6..80c4d11a38ea2 100644
--- a/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb
+++ b/db/migrate/20180831164904_fix_prometheus_metric_query_limits.rb
@@ -4,7 +4,7 @@
 # for more information on how to write migrations for GitLab.
 require Rails.root.join('db/migrate/prometheus_metrics_limits_to_mysql')
 
-class FixPrometheusMetricQueryLimits < ActiveRecord::Migration
+class FixPrometheusMetricQueryLimits < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180831164905_add_common_to_prometheus_metrics.rb b/db/migrate/20180831164905_add_common_to_prometheus_metrics.rb
index e21c156fff6c6..5eb77d0480d48 100644
--- a/db/migrate/20180831164905_add_common_to_prometheus_metrics.rb
+++ b/db/migrate/20180831164905_add_common_to_prometheus_metrics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddCommonToPrometheusMetrics < ActiveRecord::Migration
+class AddCommonToPrometheusMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180831164907_add_index_on_common_for_prometheus_metrics.rb b/db/migrate/20180831164907_add_index_on_common_for_prometheus_metrics.rb
index fdbaaf67b87a1..5758321891a67 100644
--- a/db/migrate/20180831164907_add_index_on_common_for_prometheus_metrics.rb
+++ b/db/migrate/20180831164907_add_index_on_common_for_prometheus_metrics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexOnCommonForPrometheusMetrics < ActiveRecord::Migration
+class AddIndexOnCommonForPrometheusMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180831164908_add_identifier_to_prometheus_metric.rb b/db/migrate/20180831164908_add_identifier_to_prometheus_metric.rb
index 67de990757e15..7aa5950249c1f 100644
--- a/db/migrate/20180831164908_add_identifier_to_prometheus_metric.rb
+++ b/db/migrate/20180831164908_add_identifier_to_prometheus_metric.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIdentifierToPrometheusMetric < ActiveRecord::Migration
+class AddIdentifierToPrometheusMetric < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180831164909_add_index_for_identifier_to_prometheus_metric.rb b/db/migrate/20180831164909_add_index_for_identifier_to_prometheus_metric.rb
index b30c24ccafe61..1f6cfc181f4a9 100644
--- a/db/migrate/20180831164909_add_index_for_identifier_to_prometheus_metric.rb
+++ b/db/migrate/20180831164909_add_index_for_identifier_to_prometheus_metric.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexForIdentifierToPrometheusMetric < ActiveRecord::Migration
+class AddIndexForIdentifierToPrometheusMetric < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180831164910_import_common_metrics.rb b/db/migrate/20180831164910_import_common_metrics.rb
index 72658c09b8e93..f67d5f40aaddc 100644
--- a/db/migrate/20180831164910_import_common_metrics.rb
+++ b/db/migrate/20180831164910_import_common_metrics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class ImportCommonMetrics < ActiveRecord::Migration
+class ImportCommonMetrics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   require Rails.root.join('db/importers/common_metrics_importer.rb')
diff --git a/db/migrate/20180901171833_add_project_config_source_status_index_to_pipeline.rb b/db/migrate/20180901171833_add_project_config_source_status_index_to_pipeline.rb
index 99dfcc94b124d..f2136657d9561 100644
--- a/db/migrate/20180901171833_add_project_config_source_status_index_to_pipeline.rb
+++ b/db/migrate/20180901171833_add_project_config_source_status_index_to_pipeline.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddProjectConfigSourceStatusIndexToPipeline < ActiveRecord::Migration
+class AddProjectConfigSourceStatusIndexToPipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180901200537_add_resource_label_event_reference_fields.rb b/db/migrate/20180901200537_add_resource_label_event_reference_fields.rb
index 264970ceed8eb..c8875e16914a9 100644
--- a/db/migrate/20180901200537_add_resource_label_event_reference_fields.rb
+++ b/db/migrate/20180901200537_add_resource_label_event_reference_fields.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddResourceLabelEventReferenceFields < ActiveRecord::Migration
+class AddResourceLabelEventReferenceFields < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb b/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb
index 5d0e67d264894..334efa12e7bdf 100644
--- a/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb
+++ b/db/migrate/20180906101639_add_user_ping_consent_to_application_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddUserPingConsentToApplicationSettings < ActiveRecord::Migration
+class AddUserPingConsentToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb b/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb
index 933047e32de22..c57611a0f7db4 100644
--- a/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb
+++ b/db/migrate/20180907015926_add_legacy_abac_to_cluster_providers_gcp.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddLegacyAbacToClusterProvidersGcp < ActiveRecord::Migration
+class AddLegacyAbacToClusterProvidersGcp < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180910115836_add_attr_encrypted_columns_to_web_hook.rb b/db/migrate/20180910115836_add_attr_encrypted_columns_to_web_hook.rb
index 72f5c8d653b26..ca8dbdba2bb16 100644
--- a/db/migrate/20180910115836_add_attr_encrypted_columns_to_web_hook.rb
+++ b/db/migrate/20180910115836_add_attr_encrypted_columns_to_web_hook.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddAttrEncryptedColumnsToWebHook < ActiveRecord::Migration
+class AddAttrEncryptedColumnsToWebHook < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180910153412_add_token_digest_to_personal_access_tokens.rb b/db/migrate/20180910153412_add_token_digest_to_personal_access_tokens.rb
index 203fcfe8eae9d..142e454832ff6 100644
--- a/db/migrate/20180910153412_add_token_digest_to_personal_access_tokens.rb
+++ b/db/migrate/20180910153412_add_token_digest_to_personal_access_tokens.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddTokenDigestToPersonalAccessTokens < ActiveRecord::Migration
+class AddTokenDigestToPersonalAccessTokens < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180910153413_add_index_to_token_digest_on_personal_access_tokens.rb b/db/migrate/20180910153413_add_index_to_token_digest_on_personal_access_tokens.rb
index 4300cd13a45f0..d501b07614ad6 100644
--- a/db/migrate/20180910153413_add_index_to_token_digest_on_personal_access_tokens.rb
+++ b/db/migrate/20180910153413_add_index_to_token_digest_on_personal_access_tokens.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToTokenDigestOnPersonalAccessTokens < ActiveRecord::Migration
+class AddIndexToTokenDigestOnPersonalAccessTokens < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180912111628_add_knative_application.rb b/db/migrate/20180912111628_add_knative_application.rb
index bfda6a945a7fe..86d9100d2e7b7 100644
--- a/db/migrate/20180912111628_add_knative_application.rb
+++ b/db/migrate/20180912111628_add_knative_application.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddKnativeApplication < ActiveRecord::Migration
+class AddKnativeApplication < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180916011959_add_index_pipelines_project_id_source.rb b/db/migrate/20180916011959_add_index_pipelines_project_id_source.rb
index b9bebf30cf0ff..5b71c79ac86d0 100644
--- a/db/migrate/20180916011959_add_index_pipelines_project_id_source.rb
+++ b/db/migrate/20180916011959_add_index_pipelines_project_id_source.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexPipelinesProjectIdSource < ActiveRecord::Migration
+class AddIndexPipelinesProjectIdSource < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb b/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb
index 084dfc65ce553..5dac5f0d100fa 100644
--- a/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb
+++ b/db/migrate/20180924141949_add_diff_max_patch_bytes_to_application_settings.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddDiffMaxPatchBytesToApplicationSettings < ActiveRecord::Migration
+class AddDiffMaxPatchBytesToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb b/db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb
index c163fbb1fd604..cd2f8b59d41bd 100644
--- a/db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb
+++ b/db/migrate/20180924190739_add_scheduled_at_to_ci_builds.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddScheduledAtToCiBuilds < ActiveRecord::Migration
+class AddScheduledAtToCiBuilds < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb b/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
index 81bf0d94e1129..378fc4e5feabc 100644
--- a/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
+++ b/db/migrate/20180924201039_add_partial_index_to_scheduled_at.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddPartialIndexToScheduledAt < ActiveRecord::Migration
+class AddPartialIndexToScheduledAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20180925200829_create_user_preferences.rb b/db/migrate/20180925200829_create_user_preferences.rb
index 755cabdabde62..b46df8157a6c7 100644
--- a/db/migrate/20180925200829_create_user_preferences.rb
+++ b/db/migrate/20180925200829_create_user_preferences.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateUserPreferences < ActiveRecord::Migration
+class CreateUserPreferences < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   class UserPreference < ActiveRecord::Base
diff --git a/db/migrate/20180927073410_add_index_to_project_deploy_tokens_deploy_token_id.rb b/db/migrate/20180927073410_add_index_to_project_deploy_tokens_deploy_token_id.rb
index 61d32fe16ebec..80577c52a01c3 100644
--- a/db/migrate/20180927073410_add_index_to_project_deploy_tokens_deploy_token_id.rb
+++ b/db/migrate/20180927073410_add_index_to_project_deploy_tokens_deploy_token_id.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToProjectDeployTokensDeployTokenId < ActiveRecord::Migration
+class AddIndexToProjectDeployTokensDeployTokenId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181002172433_remove_restricted_todos_with_cte.rb b/db/migrate/20181002172433_remove_restricted_todos_with_cte.rb
index 0a8f4a1226651..7826c8d802efb 100644
--- a/db/migrate/20181002172433_remove_restricted_todos_with_cte.rb
+++ b/db/migrate/20181002172433_remove_restricted_todos_with_cte.rb
@@ -3,7 +3,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rescheduling of the revised RemoveRestrictedTodos background migration
-class RemoveRestrictedTodosWithCte < ActiveRecord::Migration
+class RemoveRestrictedTodosWithCte < ActiveRecord::Migration[4.2]
   DOWNTIME = false
   disable_ddl_transaction!
 
diff --git a/db/migrate/20181005110927_add_index_to_lfs_objects_file_store.rb b/db/migrate/20181005110927_add_index_to_lfs_objects_file_store.rb
index d09543aa4cc19..ff17a0a567dac 100644
--- a/db/migrate/20181005110927_add_index_to_lfs_objects_file_store.rb
+++ b/db/migrate/20181005110927_add_index_to_lfs_objects_file_store.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToLfsObjectsFileStore < ActiveRecord::Migration
+class AddIndexToLfsObjectsFileStore < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181005125926_add_index_to_uploads_store.rb b/db/migrate/20181005125926_add_index_to_uploads_store.rb
index d32ca05e980b7..d9e31225b6f8b 100644
--- a/db/migrate/20181005125926_add_index_to_uploads_store.rb
+++ b/db/migrate/20181005125926_add_index_to_uploads_store.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToUploadsStore < ActiveRecord::Migration
+class AddIndexToUploadsStore < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181009190428_create_clusters_kubernetes_namespaces.rb b/db/migrate/20181009190428_create_clusters_kubernetes_namespaces.rb
index a58c190e1d6dc..62ad6c63d0a9e 100644
--- a/db/migrate/20181009190428_create_clusters_kubernetes_namespaces.rb
+++ b/db/migrate/20181009190428_create_clusters_kubernetes_namespaces.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateClustersKubernetesNamespaces < ActiveRecord::Migration
+class CreateClustersKubernetesNamespaces < ActiveRecord::Migration[4.2]
   DOWNTIME = false
   INDEX_NAME = 'kubernetes_namespaces_cluster_and_namespace'
 
diff --git a/db/migrate/20181010235606_create_board_project_recent_visits.rb b/db/migrate/20181010235606_create_board_project_recent_visits.rb
index 426f41e202a3e..07bfbdda26bea 100644
--- a/db/migrate/20181010235606_create_board_project_recent_visits.rb
+++ b/db/migrate/20181010235606_create_board_project_recent_visits.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateBoardProjectRecentVisits < ActiveRecord::Migration
+class CreateBoardProjectRecentVisits < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181014203236_create_cluster_groups.rb b/db/migrate/20181014203236_create_cluster_groups.rb
index 69382d5c8513e..33ae9a4a478af 100644
--- a/db/migrate/20181014203236_create_cluster_groups.rb
+++ b/db/migrate/20181014203236_create_cluster_groups.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateClusterGroups < ActiveRecord::Migration
+class CreateClusterGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181015155839_add_finished_at_to_deployments.rb b/db/migrate/20181015155839_add_finished_at_to_deployments.rb
index 1a061bb0f5f3b..bb8d6cdcf2c56 100644
--- a/db/migrate/20181015155839_add_finished_at_to_deployments.rb
+++ b/db/migrate/20181015155839_add_finished_at_to_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddFinishedAtToDeployments < ActiveRecord::Migration
+class AddFinishedAtToDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181016141739_add_status_to_deployments.rb b/db/migrate/20181016141739_add_status_to_deployments.rb
index 321172696b4d6..2ff778448b4cd 100644
--- a/db/migrate/20181016141739_add_status_to_deployments.rb
+++ b/db/migrate/20181016141739_add_status_to_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddStatusToDeployments < ActiveRecord::Migration
+class AddStatusToDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DEPLOYMENT_STATUS_SUCCESS = 2 # Equivalent to Deployment.state_machine.states['success'].value
diff --git a/db/migrate/20181016152238_create_board_group_recent_visits.rb b/db/migrate/20181016152238_create_board_group_recent_visits.rb
index 1e55dc8658e88..9e240a5f97fa8 100644
--- a/db/migrate/20181016152238_create_board_group_recent_visits.rb
+++ b/db/migrate/20181016152238_create_board_group_recent_visits.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateBoardGroupRecentVisits < ActiveRecord::Migration
+class CreateBoardGroupRecentVisits < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181017001059_add_cluster_type_to_clusters.rb b/db/migrate/20181017001059_add_cluster_type_to_clusters.rb
index 191e7eb4fb3d4..d032afe1a43a4 100644
--- a/db/migrate/20181017001059_add_cluster_type_to_clusters.rb
+++ b/db/migrate/20181017001059_add_cluster_type_to_clusters.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddClusterTypeToClusters < ActiveRecord::Migration
+class AddClusterTypeToClusters < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181019032400_add_shards_table.rb b/db/migrate/20181019032400_add_shards_table.rb
index 5e0a6960548dd..e31af97cc94aa 100644
--- a/db/migrate/20181019032400_add_shards_table.rb
+++ b/db/migrate/20181019032400_add_shards_table.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddShardsTable < ActiveRecord::Migration
+class AddShardsTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20181019032408_add_repositories_table.rb b/db/migrate/20181019032408_add_repositories_table.rb
index 077f264d3cec7..2153c1c9fc68a 100644
--- a/db/migrate/20181019032408_add_repositories_table.rb
+++ b/db/migrate/20181019032408_add_repositories_table.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddRepositoriesTable < ActiveRecord::Migration
+class AddRepositoriesTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/migrate/20181019105553_add_projects_pool_repository_id_foreign_key.rb b/db/migrate/20181019105553_add_projects_pool_repository_id_foreign_key.rb
index 059988de38a48..dddf44ce488be 100644
--- a/db/migrate/20181019105553_add_projects_pool_repository_id_foreign_key.rb
+++ b/db/migrate/20181019105553_add_projects_pool_repository_id_foreign_key.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddProjectsPoolRepositoryIdForeignKey < ActiveRecord::Migration
+class AddProjectsPoolRepositoryIdForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181022135539_add_index_on_status_to_deployments.rb b/db/migrate/20181022135539_add_index_on_status_to_deployments.rb
index 2eed20aa855cf..9c7a722c626ee 100644
--- a/db/migrate/20181022135539_add_index_on_status_to_deployments.rb
+++ b/db/migrate/20181022135539_add_index_on_status_to_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexOnStatusToDeployments < ActiveRecord::Migration
+class AddIndexOnStatusToDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181023104858_add_archive_builds_duration_to_application_settings.rb b/db/migrate/20181023104858_add_archive_builds_duration_to_application_settings.rb
index 744748b3fadd1..5d7a21fc5b59d 100644
--- a/db/migrate/20181023104858_add_archive_builds_duration_to_application_settings.rb
+++ b/db/migrate/20181023104858_add_archive_builds_duration_to_application_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddArchiveBuildsDurationToApplicationSettings < ActiveRecord::Migration
+class AddArchiveBuildsDurationToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181023144439_add_partial_index_for_legacy_successful_deployments.rb b/db/migrate/20181023144439_add_partial_index_for_legacy_successful_deployments.rb
index 5896102af1cbf..e90e59b57a98a 100644
--- a/db/migrate/20181023144439_add_partial_index_for_legacy_successful_deployments.rb
+++ b/db/migrate/20181023144439_add_partial_index_for_legacy_successful_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddPartialIndexForLegacySuccessfulDeployments < ActiveRecord::Migration
+class AddPartialIndexForLegacySuccessfulDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181025115728_add_private_commit_email_hostname_to_application_settings.rb b/db/migrate/20181025115728_add_private_commit_email_hostname_to_application_settings.rb
index 89ddaf2ae2b34..052a344f1823f 100644
--- a/db/migrate/20181025115728_add_private_commit_email_hostname_to_application_settings.rb
+++ b/db/migrate/20181025115728_add_private_commit_email_hostname_to_application_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddPrivateCommitEmailHostnameToApplicationSettings < ActiveRecord::Migration
+class AddPrivateCommitEmailHostnameToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181026143227_migrate_snippets_access_level_default_value.rb b/db/migrate/20181026143227_migrate_snippets_access_level_default_value.rb
index ede0ee27b8a3f..2f4ef33b25310 100644
--- a/db/migrate/20181026143227_migrate_snippets_access_level_default_value.rb
+++ b/db/migrate/20181026143227_migrate_snippets_access_level_default_value.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateSnippetsAccessLevelDefaultValue < ActiveRecord::Migration
+class MigrateSnippetsAccessLevelDefaultValue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb b/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb
index 176d55565d807..2b5cd45e92c9e 100644
--- a/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb
+++ b/db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddMissingIndexesForForeignKeys < ActiveRecord::Migration
+class AddMissingIndexesForForeignKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181031190558_drop_fk_gcp_clusters_table.rb b/db/migrate/20181031190558_drop_fk_gcp_clusters_table.rb
index a7106111f46df..2c1dea05808f9 100644
--- a/db/migrate/20181031190558_drop_fk_gcp_clusters_table.rb
+++ b/db/migrate/20181031190558_drop_fk_gcp_clusters_table.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class DropFkGcpClustersTable < ActiveRecord::Migration
+class DropFkGcpClustersTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181031190559_drop_gcp_clusters_table.rb b/db/migrate/20181031190559_drop_gcp_clusters_table.rb
index 808d474b4fc44..597fe49f4c8c1 100644
--- a/db/migrate/20181031190559_drop_gcp_clusters_table.rb
+++ b/db/migrate/20181031190559_drop_gcp_clusters_table.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class DropGcpClustersTable < ActiveRecord::Migration
+class DropGcpClustersTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181101144347_add_index_for_stuck_mr_query.rb b/db/migrate/20181101144347_add_index_for_stuck_mr_query.rb
index 5d3ace54e5c5c..569eaa8b22c04 100644
--- a/db/migrate/20181101144347_add_index_for_stuck_mr_query.rb
+++ b/db/migrate/20181101144347_add_index_for_stuck_mr_query.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddIndexForStuckMrQuery < ActiveRecord::Migration
+class AddIndexForStuckMrQuery < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181106135939_add_index_to_deployments.rb b/db/migrate/20181106135939_add_index_to_deployments.rb
index 5f988a4723c94..e8181e61d22e7 100644
--- a/db/migrate/20181106135939_add_index_to_deployments.rb
+++ b/db/migrate/20181106135939_add_index_to_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToDeployments < ActiveRecord::Migration
+class AddIndexToDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb b/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb
index a480c15e66b87..59d6d2f29ff3d 100644
--- a/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb
+++ b/db/migrate/20181112103239_drop_default_value_on_status_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class DropDefaultValueOnStatusDeployments < ActiveRecord::Migration
+class DropDefaultValueOnStatusDeployments < ActiveRecord::Migration[4.2]
   DOWNTIME = false
   DEPLOYMENT_STATUS_SUCCESS = 2 # Equivalent to Deployment.state_machine.states['success'].value
 
diff --git a/db/migrate/gpg_keys_limits_to_mysql.rb b/db/migrate/gpg_keys_limits_to_mysql.rb
index 38729320d8cb8..2cd347a0463bf 100644
--- a/db/migrate/gpg_keys_limits_to_mysql.rb
+++ b/db/migrate/gpg_keys_limits_to_mysql.rb
@@ -1,4 +1,4 @@
-class IncreaseMysqlTextLimitForGpgKeys < ActiveRecord::Migration
+class IncreaseMysqlTextLimitForGpgKeys < ActiveRecord::Migration[4.2]
   # Set this constant to true if this migration requires downtime.
   DOWNTIME = false
 
diff --git a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
index 9fd23aae1e592..92402cf387bc3 100644
--- a/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
+++ b/db/migrate/limits_ci_build_trace_chunks_raw_data_for_mysql.rb
@@ -1,4 +1,4 @@
-class LimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration
+class LimitsCiBuildTraceChunksRawDataForMysql < ActiveRecord::Migration[4.2]
   def up
     return unless Gitlab::Database.mysql?
 
diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb
index 7507a4bb43165..87992b541b1b1 100644
--- a/db/migrate/limits_to_mysql.rb
+++ b/db/migrate/limits_to_mysql.rb
@@ -1,4 +1,4 @@
-class LimitsToMysql < ActiveRecord::Migration
+class LimitsToMysql < ActiveRecord::Migration[4.2]
   def up
     return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
 
diff --git a/db/migrate/markdown_cache_limits_to_mysql.rb b/db/migrate/markdown_cache_limits_to_mysql.rb
index f6686db3dc057..f99d500a1376b 100644
--- a/db/migrate/markdown_cache_limits_to_mysql.rb
+++ b/db/migrate/markdown_cache_limits_to_mysql.rb
@@ -1,4 +1,4 @@
-class MarkdownCacheLimitsToMysql < ActiveRecord::Migration
+class MarkdownCacheLimitsToMysql < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/merge_request_diff_file_limits_to_mysql.rb b/db/migrate/merge_request_diff_file_limits_to_mysql.rb
index ca3bc7d6be92a..65dd0b5b7f757 100644
--- a/db/migrate/merge_request_diff_file_limits_to_mysql.rb
+++ b/db/migrate/merge_request_diff_file_limits_to_mysql.rb
@@ -1,4 +1,4 @@
-class MergeRequestDiffFileLimitsToMysql < ActiveRecord::Migration
+class MergeRequestDiffFileLimitsToMysql < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/migrate/prometheus_metrics_limits_to_mysql.rb b/db/migrate/prometheus_metrics_limits_to_mysql.rb
index 79f4ab9b64b0d..f7a2fcba8c202 100644
--- a/db/migrate/prometheus_metrics_limits_to_mysql.rb
+++ b/db/migrate/prometheus_metrics_limits_to_mysql.rb
@@ -1,4 +1,4 @@
-class PrometheusMetricsLimitsToMysql < ActiveRecord::Migration
+class PrometheusMetricsLimitsToMysql < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/optional_migrations/composite_primary_keys.rb b/db/optional_migrations/composite_primary_keys.rb
index b330da13d4386..e0bb0312a350b 100644
--- a/db/optional_migrations/composite_primary_keys.rb
+++ b/db/optional_migrations/composite_primary_keys.rb
@@ -7,7 +7,7 @@
 # which requires all tables to have a primary key constraint.
 #
 # In that sense, the migration is optional and not strictly needed.
-class CompositePrimaryKeysMigration < ActiveRecord::Migration
+class CompositePrimaryKeysMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20160824121037_change_personal_access_tokens_default_back_to_empty_array.rb b/db/post_migrate/20160824121037_change_personal_access_tokens_default_back_to_empty_array.rb
index 7df561d82dd4c..099814d755635 100644
--- a/db/post_migrate/20160824121037_change_personal_access_tokens_default_back_to_empty_array.rb
+++ b/db/post_migrate/20160824121037_change_personal_access_tokens_default_back_to_empty_array.rb
@@ -4,7 +4,7 @@
 #
 # Details: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5951#note_19721973
 
-class ChangePersonalAccessTokensDefaultBackToEmptyArray < ActiveRecord::Migration
+class ChangePersonalAccessTokensDefaultBackToEmptyArray < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb b/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
index 319d86ac1591e..bf3aee9941803 100644
--- a/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
+++ b/db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
@@ -1,4 +1,4 @@
-class RemoveInactiveJiraServiceProperties < ActiveRecord::Migration
+class RemoveInactiveJiraServiceProperties < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb b/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
index f058e85c1ece5..d77a22bfb694b 100644
--- a/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
+++ b/db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
@@ -1,4 +1,4 @@
-class FixProjectRecordsWithInvalidVisibility < ActiveRecord::Migration
+class FixProjectRecordsWithInvalidVisibility < ActiveRecord::Migration[4.2]
   include Gitlab::Database::ArelMethods
   include Gitlab::Database::MigrationHelpers
 
diff --git a/db/post_migrate/20161128170531_drop_user_activities_table.rb b/db/post_migrate/20161128170531_drop_user_activities_table.rb
index 09cfacba5ca14..d8b1e0731f3af 100644
--- a/db/post_migrate/20161128170531_drop_user_activities_table.rb
+++ b/db/post_migrate/20161128170531_drop_user_activities_table.rb
@@ -1,6 +1,6 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
-class DropUserActivitiesTable < ActiveRecord::Migration
+class DropUserActivitiesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20161221140236_remove_unneeded_services.rb b/db/post_migrate/20161221140236_remove_unneeded_services.rb
index 6b7e94c864124..31f2426387784 100644
--- a/db/post_migrate/20161221140236_remove_unneeded_services.rb
+++ b/db/post_migrate/20161221140236_remove_unneeded_services.rb
@@ -1,4 +1,4 @@
-class RemoveUnneededServices < ActiveRecord::Migration
+class RemoveUnneededServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20161221153951_rename_reserved_project_names.rb b/db/post_migrate/20161221153951_rename_reserved_project_names.rb
index 678876e886cb4..b7665e9849071 100644
--- a/db/post_migrate/20161221153951_rename_reserved_project_names.rb
+++ b/db/post_migrate/20161221153951_rename_reserved_project_names.rb
@@ -1,4 +1,4 @@
-class RenameReservedProjectNames < ActiveRecord::Migration
+class RenameReservedProjectNames < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   include Gitlab::ShellAdapter
 
diff --git a/db/post_migrate/20170104150317_requeue_pending_delete_projects.rb b/db/post_migrate/20170104150317_requeue_pending_delete_projects.rb
index d7be004d47f90..f567accb051bb 100644
--- a/db/post_migrate/20170104150317_requeue_pending_delete_projects.rb
+++ b/db/post_migrate/20170104150317_requeue_pending_delete_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RequeuePendingDeleteProjects < ActiveRecord::Migration
+class RequeuePendingDeleteProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170106142508_fill_authorized_projects.rb b/db/post_migrate/20170106142508_fill_authorized_projects.rb
index 0ca20587981c1..1f1dd0f47f050 100644
--- a/db/post_migrate/20170106142508_fill_authorized_projects.rb
+++ b/db/post_migrate/20170106142508_fill_authorized_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class FillAuthorizedProjects < ActiveRecord::Migration
+class FillAuthorizedProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class User < ActiveRecord::Base
diff --git a/db/post_migrate/20170106172224_remove_project_authorizations_id_column.rb b/db/post_migrate/20170106172224_remove_project_authorizations_id_column.rb
index 7c78816002290..893af23465a05 100644
--- a/db/post_migrate/20170106172224_remove_project_authorizations_id_column.rb
+++ b/db/post_migrate/20170106172224_remove_project_authorizations_id_column.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveProjectAuthorizationsIdColumn < ActiveRecord::Migration
+class RemoveProjectAuthorizationsIdColumn < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170131214021_reset_users_authorized_projects_populated.rb b/db/post_migrate/20170131214021_reset_users_authorized_projects_populated.rb
index f1f81691f8164..055a14ad729ab 100644
--- a/db/post_migrate/20170131214021_reset_users_authorized_projects_populated.rb
+++ b/db/post_migrate/20170131214021_reset_users_authorized_projects_populated.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/UpdateColumnInBatches
-class ResetUsersAuthorizedProjectsPopulated < ActiveRecord::Migration
+class ResetUsersAuthorizedProjectsPopulated < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb b/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
index a8e63e8bc7dc9..f221dac8e208e 100644
--- a/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
+++ b/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
@@ -1,4 +1,4 @@
-class RemoveInactiveDefaultEmailServices < ActiveRecord::Migration
+class RemoveInactiveDefaultEmailServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170206101007_remove_trackable_columns_from_timelogs.rb b/db/post_migrate/20170206101007_remove_trackable_columns_from_timelogs.rb
index aee0c1b624516..14f5d0d4adde3 100644
--- a/db/post_migrate/20170206101007_remove_trackable_columns_from_timelogs.rb
+++ b/db/post_migrate/20170206101007_remove_trackable_columns_from_timelogs.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveTrackableColumnsFromTimelogs < ActiveRecord::Migration
+class RemoveTrackableColumnsFromTimelogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170206101030_validate_foreign_keys_on_timelogs.rb b/db/post_migrate/20170206101030_validate_foreign_keys_on_timelogs.rb
index f397ef919ccf4..b5a5c0f06c735 100644
--- a/db/post_migrate/20170206101030_validate_foreign_keys_on_timelogs.rb
+++ b/db/post_migrate/20170206101030_validate_foreign_keys_on_timelogs.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ValidateForeignKeysOnTimelogs < ActiveRecord::Migration
+class ValidateForeignKeysOnTimelogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170209140523_validate_foreign_keys_on_oauth_openid_requests.rb b/db/post_migrate/20170209140523_validate_foreign_keys_on_oauth_openid_requests.rb
index e206f9af63601..81ac4cf137332 100644
--- a/db/post_migrate/20170209140523_validate_foreign_keys_on_oauth_openid_requests.rb
+++ b/db/post_migrate/20170209140523_validate_foreign_keys_on_oauth_openid_requests.rb
@@ -1,4 +1,4 @@
-class ValidateForeignKeysOnOauthOpenidRequests < ActiveRecord::Migration
+class ValidateForeignKeysOnOauthOpenidRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170211073944_disable_invalid_service_templates.rb b/db/post_migrate/20170211073944_disable_invalid_service_templates.rb
index 603efc43782f4..31234e5b086eb 100644
--- a/db/post_migrate/20170211073944_disable_invalid_service_templates.rb
+++ b/db/post_migrate/20170211073944_disable_invalid_service_templates.rb
@@ -1,4 +1,4 @@
-class DisableInvalidServiceTemplates < ActiveRecord::Migration
+class DisableInvalidServiceTemplates < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   class Service < ActiveRecord::Base
diff --git a/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb b/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb
index 09a827d22b06c..c273060f8b0a5 100644
--- a/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb
+++ b/db/post_migrate/20170214111112_delete_deprecated_gitlab_ci_service.rb
@@ -1,4 +1,4 @@
-class DeleteDeprecatedGitlabCiService < ActiveRecord::Migration
+class DeleteDeprecatedGitlabCiService < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170215200045_remove_theme_id_from_users.rb b/db/post_migrate/20170215200045_remove_theme_id_from_users.rb
index c51646fbe52b6..937fe3f57af2a 100644
--- a/db/post_migrate/20170215200045_remove_theme_id_from_users.rb
+++ b/db/post_migrate/20170215200045_remove_theme_id_from_users.rb
@@ -1,4 +1,4 @@
-class RemoveThemeIdFromUsers < ActiveRecord::Migration
+class RemoveThemeIdFromUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb b/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb
index 04bf89c968700..c2d28d794919c 100644
--- a/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb
+++ b/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb
@@ -1,4 +1,4 @@
-class MigrateBuildEventsToPipelineEvents < ActiveRecord::Migration
+class MigrateBuildEventsToPipelineEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb b/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb
index ec6e8cdfc456a..aa12e8ac3da71 100644
--- a/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb
+++ b/db/post_migrate/20170306170512_migrate_legacy_manual_actions.rb
@@ -1,4 +1,4 @@
-class MigrateLegacyManualActions < ActiveRecord::Migration
+class MigrateLegacyManualActions < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb b/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
index 49fd46b0262a6..2cf4cf61d8f90 100644
--- a/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
+++ b/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/UpdateColumnInBatches
-class ResetRelativePositionForIssue < ActiveRecord::Migration
+class ResetRelativePositionForIssue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb b/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
index 26a67b0f8147b..cac3fd713eb58 100644
--- a/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
+++ b/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb
@@ -1,4 +1,4 @@
-class RenameMoreReservedProjectNames < ActiveRecord::Migration
+class RenameMoreReservedProjectNames < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   include Gitlab::ShellAdapter
 
diff --git a/db/post_migrate/20170317162059_update_upload_paths_to_system.rb b/db/post_migrate/20170317162059_update_upload_paths_to_system.rb
index 92e33848bf0b0..a5a6f043e1062 100644
--- a/db/post_migrate/20170317162059_update_upload_paths_to_system.rb
+++ b/db/post_migrate/20170317162059_update_upload_paths_to_system.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class UpdateUploadPathsToSystem < ActiveRecord::Migration
+class UpdateUploadPathsToSystem < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170324160416_migrate_user_activities_to_users_last_activity_on.rb b/db/post_migrate/20170324160416_migrate_user_activities_to_users_last_activity_on.rb
index 392fa00b1ba41..73989339ad947 100644
--- a/db/post_migrate/20170324160416_migrate_user_activities_to_users_last_activity_on.rb
+++ b/db/post_migrate/20170324160416_migrate_user_activities_to_users_last_activity_on.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class MigrateUserActivitiesToUsersLastActivityOn < ActiveRecord::Migration
+class MigrateUserActivitiesToUsersLastActivityOn < ActiveRecord::Migration[4.2]
   include Gitlab::Database::ArelMethods
   include Gitlab::Database::MigrationHelpers
 
diff --git a/db/post_migrate/20170404170532_remove_notes_original_discussion_id.rb b/db/post_migrate/20170404170532_remove_notes_original_discussion_id.rb
index 0c3b3bd5eb34d..334742f04e4d3 100644
--- a/db/post_migrate/20170404170532_remove_notes_original_discussion_id.rb
+++ b/db/post_migrate/20170404170532_remove_notes_original_discussion_id.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveNotesOriginalDiscussionId < ActiveRecord::Migration
+class RemoveNotesOriginalDiscussionId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170406111121_clean_upload_symlinks.rb b/db/post_migrate/20170406111121_clean_upload_symlinks.rb
index 0ab3d61730db4..5fec00aa1987f 100644
--- a/db/post_migrate/20170406111121_clean_upload_symlinks.rb
+++ b/db/post_migrate/20170406111121_clean_upload_symlinks.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanUploadSymlinks < ActiveRecord::Migration
+class CleanUploadSymlinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/post_migrate/20170406142253_migrate_user_project_view.rb b/db/post_migrate/20170406142253_migrate_user_project_view.rb
index d6061dd416d94..3601baba78795 100644
--- a/db/post_migrate/20170406142253_migrate_user_project_view.rb
+++ b/db/post_migrate/20170406142253_migrate_user_project_view.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateUserProjectView < ActiveRecord::Migration
+class MigrateUserProjectView < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20170408033905_remove_old_cache_directories.rb b/db/post_migrate/20170408033905_remove_old_cache_directories.rb
index b23b52896b90f..22bc5b9db7b2b 100644
--- a/db/post_migrate/20170408033905_remove_old_cache_directories.rb
+++ b/db/post_migrate/20170408033905_remove_old_cache_directories.rb
@@ -4,7 +4,7 @@
 # Remove all files from old custom carrierwave's cache directories.
 # See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9466
 
-class RemoveOldCacheDirectories < ActiveRecord::Migration
+class RemoveOldCacheDirectories < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170412174900_rename_reserved_dynamic_paths.rb b/db/post_migrate/20170412174900_rename_reserved_dynamic_paths.rb
index 08cf366f0a197..c9ff91b0401e4 100644
--- a/db/post_migrate/20170412174900_rename_reserved_dynamic_paths.rb
+++ b/db/post_migrate/20170412174900_rename_reserved_dynamic_paths.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameReservedDynamicPaths < ActiveRecord::Migration
+class RenameReservedDynamicPaths < ActiveRecord::Migration[4.2]
   include Gitlab::Database::RenameReservedPathsMigration::V1
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170425121605_migrate_trigger_schedules_to_pipeline_schedules.rb b/db/post_migrate/20170425121605_migrate_trigger_schedules_to_pipeline_schedules.rb
index dae9750558ff8..99ded277277a2 100644
--- a/db/post_migrate/20170425121605_migrate_trigger_schedules_to_pipeline_schedules.rb
+++ b/db/post_migrate/20170425121605_migrate_trigger_schedules_to_pipeline_schedules.rb
@@ -1,4 +1,4 @@
-class MigrateTriggerSchedulesToPipelineSchedules < ActiveRecord::Migration
+class MigrateTriggerSchedulesToPipelineSchedules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb b/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb
index 24750c58ef008..9d515aca8b4fa 100644
--- a/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb
+++ b/db/post_migrate/20170425130047_drop_ci_trigger_schedules_table.rb
@@ -1,4 +1,4 @@
-class DropCiTriggerSchedulesTable < ActiveRecord::Migration
+class DropCiTriggerSchedulesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb b/db/post_migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb
index 845c6f0557f8c..4d091d7f2757f 100644
--- a/db/post_migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb
+++ b/db/post_migrate/20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/UpdateColumnInBatches
-class EnableAutoCancelPendingPipelinesForAll < ActiveRecord::Migration
+class EnableAutoCancelPendingPipelinesForAll < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/post_migrate/20170502101023_cleanup_namespaceless_pending_delete_projects.rb b/db/post_migrate/20170502101023_cleanup_namespaceless_pending_delete_projects.rb
index 5238a2ba1b7c5..c018d30c17531 100644
--- a/db/post_migrate/20170502101023_cleanup_namespaceless_pending_delete_projects.rb
+++ b/db/post_migrate/20170502101023_cleanup_namespaceless_pending_delete_projects.rb
@@ -1,6 +1,6 @@
 # This is the counterpart of RequeuePendingDeleteProjects and cleans all
 # projects with `pending_delete = true` and that do not have a namespace.
-class CleanupNamespacelessPendingDeleteProjects < ActiveRecord::Migration
+class CleanupNamespacelessPendingDeleteProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170503004427_update_retried_for_ci_build.rb b/db/post_migrate/20170503004427_update_retried_for_ci_build.rb
index 079f0e7511f76..596f859330804 100644
--- a/db/post_migrate/20170503004427_update_retried_for_ci_build.rb
+++ b/db/post_migrate/20170503004427_update_retried_for_ci_build.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class UpdateRetriedForCiBuild < ActiveRecord::Migration
+class UpdateRetriedForCiBuild < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170503120310_remove_users_authorized_projects_populated.rb b/db/post_migrate/20170503120310_remove_users_authorized_projects_populated.rb
index 1b44334395f90..891ce44f60ae7 100644
--- a/db/post_migrate/20170503120310_remove_users_authorized_projects_populated.rb
+++ b/db/post_migrate/20170503120310_remove_users_authorized_projects_populated.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveUsersAuthorizedProjectsPopulated < ActiveRecord::Migration
+class RemoveUsersAuthorizedProjectsPopulated < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20170508170547_add_head_pipeline_for_each_merge_request.rb b/db/post_migrate/20170508170547_add_head_pipeline_for_each_merge_request.rb
index 5df3ab71648d6..6e7365f4c565f 100644
--- a/db/post_migrate/20170508170547_add_head_pipeline_for_each_merge_request.rb
+++ b/db/post_migrate/20170508170547_add_head_pipeline_for_each_merge_request.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddHeadPipelineForEachMergeRequest < ActiveRecord::Migration
+class AddHeadPipelineForEachMergeRequest < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170510101043_add_foreign_key_on_pipeline_schedule_owner.rb b/db/post_migrate/20170510101043_add_foreign_key_on_pipeline_schedule_owner.rb
index 6a870f08e8900..85586aecd54d3 100644
--- a/db/post_migrate/20170510101043_add_foreign_key_on_pipeline_schedule_owner.rb
+++ b/db/post_migrate/20170510101043_add_foreign_key_on_pipeline_schedule_owner.rb
@@ -1,4 +1,4 @@
-class AddForeignKeyOnPipelineScheduleOwner < ActiveRecord::Migration
+class AddForeignKeyOnPipelineScheduleOwner < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170511100900_cleanup_rename_web_hooks_build_events_to_job_events.rb b/db/post_migrate/20170511100900_cleanup_rename_web_hooks_build_events_to_job_events.rb
index 281be90163a5b..b4a3db6560716 100644
--- a/db/post_migrate/20170511100900_cleanup_rename_web_hooks_build_events_to_job_events.rb
+++ b/db/post_migrate/20170511100900_cleanup_rename_web_hooks_build_events_to_job_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupRenameWebHooksBuildEventsToJobEvents < ActiveRecord::Migration
+class CleanupRenameWebHooksBuildEventsToJobEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170511101000_cleanup_rename_services_build_events_to_job_events.rb b/db/post_migrate/20170511101000_cleanup_rename_services_build_events_to_job_events.rb
index 5d26df5688f05..65342747321de 100644
--- a/db/post_migrate/20170511101000_cleanup_rename_services_build_events_to_job_events.rb
+++ b/db/post_migrate/20170511101000_cleanup_rename_services_build_events_to_job_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupRenameServicesBuildEventsToJobEvents < ActiveRecord::Migration
+class CleanupRenameServicesBuildEventsToJobEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170516165238_cleanup_trigger_for_issues.rb b/db/post_migrate/20170516165238_cleanup_trigger_for_issues.rb
index 378fe5603c3c8..affeba522500c 100644
--- a/db/post_migrate/20170516165238_cleanup_trigger_for_issues.rb
+++ b/db/post_migrate/20170516165238_cleanup_trigger_for_issues.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupTriggerForIssues < ActiveRecord::Migration
+class CleanupTriggerForIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20170516181025_add_constraints_to_issue_assignees_table.rb b/db/post_migrate/20170516181025_add_constraints_to_issue_assignees_table.rb
index 6fa573c5b49f4..03456a31b0d7d 100644
--- a/db/post_migrate/20170516181025_add_constraints_to_issue_assignees_table.rb
+++ b/db/post_migrate/20170516181025_add_constraints_to_issue_assignees_table.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddConstraintsToIssueAssigneesTable < ActiveRecord::Migration
+class AddConstraintsToIssueAssigneesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20170518200835_rename_users_with_renamed_namespace.rb b/db/post_migrate/20170518200835_rename_users_with_renamed_namespace.rb
index 17ad7de065d1b..4ba78727cc395 100644
--- a/db/post_migrate/20170518200835_rename_users_with_renamed_namespace.rb
+++ b/db/post_migrate/20170518200835_rename_users_with_renamed_namespace.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameUsersWithRenamedNamespace < ActiveRecord::Migration
+class RenameUsersWithRenamedNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170518231126_fix_wrongly_renamed_routes.rb b/db/post_migrate/20170518231126_fix_wrongly_renamed_routes.rb
index 3e9529808663c..28a2a2e01bfb8 100644
--- a/db/post_migrate/20170518231126_fix_wrongly_renamed_routes.rb
+++ b/db/post_migrate/20170518231126_fix_wrongly_renamed_routes.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class FixWronglyRenamedRoutes < ActiveRecord::Migration
+class FixWronglyRenamedRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::RenameReservedPathsMigration::V1
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb b/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
index 006d17b4d6226..d75bbb2f612d8 100644
--- a/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
+++ b/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveAssigneeIdFromIssue < ActiveRecord::Migration
+class RemoveAssigneeIdFromIssue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20170523083112_migrate_old_artifacts.rb b/db/post_migrate/20170523083112_migrate_old_artifacts.rb
index 3a77b9751d3b7..55e155c761974 100644
--- a/db/post_migrate/20170523083112_migrate_old_artifacts.rb
+++ b/db/post_migrate/20170523083112_migrate_old_artifacts.rb
@@ -1,4 +1,4 @@
-class MigrateOldArtifacts < ActiveRecord::Migration
+class MigrateOldArtifacts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170525140254_rename_all_reserved_paths_again.rb b/db/post_migrate/20170525140254_rename_all_reserved_paths_again.rb
index c996ddbec84a6..59b8daaffdff7 100644
--- a/db/post_migrate/20170525140254_rename_all_reserved_paths_again.rb
+++ b/db/post_migrate/20170525140254_rename_all_reserved_paths_again.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameAllReservedPathsAgain < ActiveRecord::Migration
+class RenameAllReservedPathsAgain < ActiveRecord::Migration[4.2]
   include Gitlab::Database::RenameReservedPathsMigration::V1
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170526185842_migrate_pipeline_stages.rb b/db/post_migrate/20170526185842_migrate_pipeline_stages.rb
index 736aff77f02de..53743fc16e675 100644
--- a/db/post_migrate/20170526185842_migrate_pipeline_stages.rb
+++ b/db/post_migrate/20170526185842_migrate_pipeline_stages.rb
@@ -1,4 +1,4 @@
-class MigratePipelineStages < ActiveRecord::Migration
+class MigratePipelineStages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170526185858_create_index_in_pipeline_stages.rb b/db/post_migrate/20170526185858_create_index_in_pipeline_stages.rb
index ec9ff33b6b7ab..dc7b1d6d026ec 100644
--- a/db/post_migrate/20170526185858_create_index_in_pipeline_stages.rb
+++ b/db/post_migrate/20170526185858_create_index_in_pipeline_stages.rb
@@ -1,4 +1,4 @@
-class CreateIndexInPipelineStages < ActiveRecord::Migration
+class CreateIndexInPipelineStages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170526185901_remove_stage_id_index_from_builds.rb b/db/post_migrate/20170526185901_remove_stage_id_index_from_builds.rb
index 3879cf9133bee..de473e7bb9169 100644
--- a/db/post_migrate/20170526185901_remove_stage_id_index_from_builds.rb
+++ b/db/post_migrate/20170526185901_remove_stage_id_index_from_builds.rb
@@ -1,4 +1,4 @@
-class RemoveStageIdIndexFromBuilds < ActiveRecord::Migration
+class RemoveStageIdIndexFromBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170526185921_migrate_build_stage_reference.rb b/db/post_migrate/20170526185921_migrate_build_stage_reference.rb
index 98c32d8284c7b..a9b392314fab5 100644
--- a/db/post_migrate/20170526185921_migrate_build_stage_reference.rb
+++ b/db/post_migrate/20170526185921_migrate_build_stage_reference.rb
@@ -1,4 +1,4 @@
-class MigrateBuildStageReference < ActiveRecord::Migration
+class MigrateBuildStageReference < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb b/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb
index a7bfba0ab2b3c..01b6cf3a15895 100644
--- a/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb
+++ b/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class MigrateBuildStageReferenceAgain < ActiveRecord::Migration
+class MigrateBuildStageReferenceAgain < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb b/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb
index a70e39850054f..3d75c7e3eaf35 100644
--- a/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb
+++ b/db/post_migrate/20170531203055_cleanup_users_ldap_email_rename.rb
@@ -1,4 +1,4 @@
-class CleanupUsersLdapEmailRename < ActiveRecord::Migration
+class CleanupUsersLdapEmailRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170606202615_move_appearance_to_system_dir.rb b/db/post_migrate/20170606202615_move_appearance_to_system_dir.rb
index 07935ab8a5278..fb9ac8d6daf5f 100644
--- a/db/post_migrate/20170606202615_move_appearance_to_system_dir.rb
+++ b/db/post_migrate/20170606202615_move_appearance_to_system_dir.rb
@@ -1,4 +1,4 @@
-class MoveAppearanceToSystemDir < ActiveRecord::Migration
+class MoveAppearanceToSystemDir < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/post_migrate/20170607121233_convert_custom_notification_settings_to_columns.rb b/db/post_migrate/20170607121233_convert_custom_notification_settings_to_columns.rb
index 9abda6a1d73ce..8ff26130cba03 100644
--- a/db/post_migrate/20170607121233_convert_custom_notification_settings_to_columns.rb
+++ b/db/post_migrate/20170607121233_convert_custom_notification_settings_to_columns.rb
@@ -1,4 +1,4 @@
-class ConvertCustomNotificationSettingsToColumns < ActiveRecord::Migration
+class ConvertCustomNotificationSettingsToColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170609183112_remove_position_from_issuables.rb b/db/post_migrate/20170609183112_remove_position_from_issuables.rb
index 4caaa2e83e8f4..edad0a502b40a 100644
--- a/db/post_migrate/20170609183112_remove_position_from_issuables.rb
+++ b/db/post_migrate/20170609183112_remove_position_from_issuables.rb
@@ -1,4 +1,4 @@
-class RemovePositionFromIssuables < ActiveRecord::Migration
+class RemovePositionFromIssuables < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/db/post_migrate/20170612071012_move_personal_snippets_files.rb b/db/post_migrate/20170612071012_move_personal_snippets_files.rb
index c735dc67f4435..d32d92637fa4c 100644
--- a/db/post_migrate/20170612071012_move_personal_snippets_files.rb
+++ b/db/post_migrate/20170612071012_move_personal_snippets_files.rb
@@ -1,6 +1,6 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
-class MovePersonalSnippetsFiles < ActiveRecord::Migration
+class MovePersonalSnippetsFiles < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/post_migrate/20170613111224_clean_appearance_symlinks.rb b/db/post_migrate/20170613111224_clean_appearance_symlinks.rb
index 17849b78cebc3..14511bff3db59 100644
--- a/db/post_migrate/20170613111224_clean_appearance_symlinks.rb
+++ b/db/post_migrate/20170613111224_clean_appearance_symlinks.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanAppearanceSymlinks < ActiveRecord::Migration
+class CleanAppearanceSymlinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/post_migrate/20170621102400_add_stage_id_index_to_builds.rb b/db/post_migrate/20170621102400_add_stage_id_index_to_builds.rb
index ac61b5c84a838..cca9b488547d8 100644
--- a/db/post_migrate/20170621102400_add_stage_id_index_to_builds.rb
+++ b/db/post_migrate/20170621102400_add_stage_id_index_to_builds.rb
@@ -1,4 +1,4 @@
-class AddStageIdIndexToBuilds < ActiveRecord::Migration
+class AddStageIdIndexToBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170627101016_schedule_event_migrations.rb b/db/post_migrate/20170627101016_schedule_event_migrations.rb
index 1e020d05f7875..f026a86bc0f14 100644
--- a/db/post_migrate/20170627101016_schedule_event_migrations.rb
+++ b/db/post_migrate/20170627101016_schedule_event_migrations.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ScheduleEventMigrations < ActiveRecord::Migration
+class ScheduleEventMigrations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb b/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb
index f31015d77a307..36aac3df071f3 100644
--- a/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb
+++ b/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb
@@ -1,4 +1,4 @@
-class MigrateStageIdReferenceInBackground < ActiveRecord::Migration
+class MigrateStageIdReferenceInBackground < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170629180131_cleanup_application_settings_signin_enabled_rename.rb b/db/post_migrate/20170629180131_cleanup_application_settings_signin_enabled_rename.rb
index 52a773ddfee3f..87268fb4b31ba 100644
--- a/db/post_migrate/20170629180131_cleanup_application_settings_signin_enabled_rename.rb
+++ b/db/post_migrate/20170629180131_cleanup_application_settings_signin_enabled_rename.rb
@@ -1,4 +1,4 @@
-class CleanupApplicationSettingsSigninEnabledRename < ActiveRecord::Migration
+class CleanupApplicationSettingsSigninEnabledRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170703130158_schedule_merge_request_diff_migrations.rb b/db/post_migrate/20170703130158_schedule_merge_request_diff_migrations.rb
index 17a9dc293f1f1..fd4b2859f7fb7 100644
--- a/db/post_migrate/20170703130158_schedule_merge_request_diff_migrations.rb
+++ b/db/post_migrate/20170703130158_schedule_merge_request_diff_migrations.rb
@@ -1,4 +1,4 @@
-class ScheduleMergeRequestDiffMigrations < ActiveRecord::Migration
+class ScheduleMergeRequestDiffMigrations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170711145558_migrate_stages_statuses.rb b/db/post_migrate/20170711145558_migrate_stages_statuses.rb
index 265f7317b9b0c..8ba69ea4dcec0 100644
--- a/db/post_migrate/20170711145558_migrate_stages_statuses.rb
+++ b/db/post_migrate/20170711145558_migrate_stages_statuses.rb
@@ -1,4 +1,4 @@
-class MigrateStagesStatuses < ActiveRecord::Migration
+class MigrateStagesStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170717111152_cleanup_move_system_upload_folder_symlink.rb b/db/post_migrate/20170717111152_cleanup_move_system_upload_folder_symlink.rb
index 3ae4406ff961a..392c4f71532d3 100644
--- a/db/post_migrate/20170717111152_cleanup_move_system_upload_folder_symlink.rb
+++ b/db/post_migrate/20170717111152_cleanup_move_system_upload_folder_symlink.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupMoveSystemUploadFolderSymlink < ActiveRecord::Migration
+class CleanupMoveSystemUploadFolderSymlink < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170717150329_enqueue_migrate_system_uploads_to_new_folder.rb b/db/post_migrate/20170717150329_enqueue_migrate_system_uploads_to_new_folder.rb
index 87069dce0062d..fdd990ae2e5d7 100644
--- a/db/post_migrate/20170717150329_enqueue_migrate_system_uploads_to_new_folder.rb
+++ b/db/post_migrate/20170717150329_enqueue_migrate_system_uploads_to_new_folder.rb
@@ -1,4 +1,4 @@
-class EnqueueMigrateSystemUploadsToNewFolder < ActiveRecord::Migration
+class EnqueueMigrateSystemUploadsToNewFolder < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170719150301_merge_issuable_reopened_into_opened_state.rb b/db/post_migrate/20170719150301_merge_issuable_reopened_into_opened_state.rb
index acc0fc7a0ac99..7af1d04f0cc71 100644
--- a/db/post_migrate/20170719150301_merge_issuable_reopened_into_opened_state.rb
+++ b/db/post_migrate/20170719150301_merge_issuable_reopened_into_opened_state.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MergeIssuableReopenedIntoOpenedState < ActiveRecord::Migration
+class MergeIssuableReopenedIntoOpenedState < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170728101014_remove_events_from_notification_settings.rb b/db/post_migrate/20170728101014_remove_events_from_notification_settings.rb
index cd533391d8dd5..f1b0a1daec5ab 100644
--- a/db/post_migrate/20170728101014_remove_events_from_notification_settings.rb
+++ b/db/post_migrate/20170728101014_remove_events_from_notification_settings.rb
@@ -1,4 +1,4 @@
-class RemoveEventsFromNotificationSettings < ActiveRecord::Migration
+class RemoveEventsFromNotificationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170803090603_calculate_conv_dev_index_percentages.rb b/db/post_migrate/20170803090603_calculate_conv_dev_index_percentages.rb
index 9af76c94bf305..a148586ca8921 100644
--- a/db/post_migrate/20170803090603_calculate_conv_dev_index_percentages.rb
+++ b/db/post_migrate/20170803090603_calculate_conv_dev_index_percentages.rb
@@ -1,4 +1,4 @@
-class CalculateConvDevIndexPercentages < ActiveRecord::Migration
+class CalculateConvDevIndexPercentages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/post_migrate/20170807160457_remove_locked_at_column_from_merge_requests.rb b/db/post_migrate/20170807160457_remove_locked_at_column_from_merge_requests.rb
index ea3d1fb3e0290..6dc49211e5a69 100644
--- a/db/post_migrate/20170807160457_remove_locked_at_column_from_merge_requests.rb
+++ b/db/post_migrate/20170807160457_remove_locked_at_column_from_merge_requests.rb
@@ -1,4 +1,4 @@
-class RemoveLockedAtColumnFromMergeRequests < ActiveRecord::Migration
+class RemoveLockedAtColumnFromMergeRequests < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/post_migrate/20170807190736_move_personal_snippet_files_into_correct_folder.rb b/db/post_migrate/20170807190736_move_personal_snippet_files_into_correct_folder.rb
index e3d2446b89787..8341ac39c25db 100644
--- a/db/post_migrate/20170807190736_move_personal_snippet_files_into_correct_folder.rb
+++ b/db/post_migrate/20170807190736_move_personal_snippet_files_into_correct_folder.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MovePersonalSnippetFilesIntoCorrectFolder < ActiveRecord::Migration
+class MovePersonalSnippetFilesIntoCorrectFolder < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/db/post_migrate/20170815060945_remove_duplicate_mr_events.rb b/db/post_migrate/20170815060945_remove_duplicate_mr_events.rb
index 6132b553177c1..fdc126b8fd6e5 100644
--- a/db/post_migrate/20170815060945_remove_duplicate_mr_events.rb
+++ b/db/post_migrate/20170815060945_remove_duplicate_mr_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveDuplicateMrEvents < ActiveRecord::Migration
+class RemoveDuplicateMrEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   DOWNTIME = false
 
diff --git a/db/post_migrate/20170816102555_cleanup_nonexisting_namespace_pending_delete_projects.rb b/db/post_migrate/20170816102555_cleanup_nonexisting_namespace_pending_delete_projects.rb
index 3f085c1713318..27656fd926d0a 100644
--- a/db/post_migrate/20170816102555_cleanup_nonexisting_namespace_pending_delete_projects.rb
+++ b/db/post_migrate/20170816102555_cleanup_nonexisting_namespace_pending_delete_projects.rb
@@ -1,7 +1,7 @@
 # Follow up of CleanupNamespacelessPendingDeleteProjects and it cleans
 # all projects with `pending_delete = true` and for which the
 # namespace no longer exists.
-class CleanupNonexistingNamespacePendingDeleteProjects < ActiveRecord::Migration
+class CleanupNonexistingNamespacePendingDeleteProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb b/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb
index 8441cfe796891..825bc9250bd8c 100644
--- a/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb
+++ b/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb
@@ -1,4 +1,4 @@
-class MigratePipelineSidekiqQueues < ActiveRecord::Migration
+class MigratePipelineSidekiqQueues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170828170502_post_deploy_migrate_user_external_mail_data.rb b/db/post_migrate/20170828170502_post_deploy_migrate_user_external_mail_data.rb
index fd1437b07f518..533155aeb7a9c 100644
--- a/db/post_migrate/20170828170502_post_deploy_migrate_user_external_mail_data.rb
+++ b/db/post_migrate/20170828170502_post_deploy_migrate_user_external_mail_data.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PostDeployMigrateUserExternalMailData < ActiveRecord::Migration
+class PostDeployMigrateUserExternalMailData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170828170513_remove_user_email_provider_column.rb b/db/post_migrate/20170828170513_remove_user_email_provider_column.rb
index 570f2b3772a40..bfc8aede540b1 100644
--- a/db/post_migrate/20170828170513_remove_user_email_provider_column.rb
+++ b/db/post_migrate/20170828170513_remove_user_email_provider_column.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveUserEmailProviderColumn < ActiveRecord::Migration
+class RemoveUserEmailProviderColumn < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170828170516_remove_user_external_mail_columns.rb b/db/post_migrate/20170828170516_remove_user_external_mail_columns.rb
index bb81dc682b307..0104955e5c848 100644
--- a/db/post_migrate/20170828170516_remove_user_external_mail_columns.rb
+++ b/db/post_migrate/20170828170516_remove_user_external_mail_columns.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveUserExternalMailColumns < ActiveRecord::Migration
+class RemoveUserExternalMailColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170830084744_destroy_gpg_signatures.rb b/db/post_migrate/20170830084744_destroy_gpg_signatures.rb
index b04d36f653715..2945eb9fde643 100644
--- a/db/post_migrate/20170830084744_destroy_gpg_signatures.rb
+++ b/db/post_migrate/20170830084744_destroy_gpg_signatures.rb
@@ -1,4 +1,4 @@
-class DestroyGpgSignatures < ActiveRecord::Migration
+class DestroyGpgSignatures < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/post_migrate/20170830150306_drop_events_for_migration_table.rb b/db/post_migrate/20170830150306_drop_events_for_migration_table.rb
index 69a612ead40e5..3538b52b00436 100644
--- a/db/post_migrate/20170830150306_drop_events_for_migration_table.rb
+++ b/db/post_migrate/20170830150306_drop_events_for_migration_table.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class DropEventsForMigrationTable < ActiveRecord::Migration
+class DropEventsForMigrationTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170831195038_remove_valid_signature_from_gpg_signatures.rb b/db/post_migrate/20170831195038_remove_valid_signature_from_gpg_signatures.rb
index 9b6745e33d954..8e264c1ab41b0 100644
--- a/db/post_migrate/20170831195038_remove_valid_signature_from_gpg_signatures.rb
+++ b/db/post_migrate/20170831195038_remove_valid_signature_from_gpg_signatures.rb
@@ -1,4 +1,4 @@
-class RemoveValidSignatureFromGpgSignatures < ActiveRecord::Migration
+class RemoveValidSignatureFromGpgSignatures < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb b/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb
index 033019c398ec1..95abf2474ddb2 100644
--- a/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb
+++ b/db/post_migrate/20170907170235_delete_conflicting_redirect_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class DeleteConflictingRedirectRoutes < ActiveRecord::Migration
+class DeleteConflictingRedirectRoutes < ActiveRecord::Migration[4.2]
   def up
     # No-op.
     # See https://gitlab.com/gitlab-com/infrastructure/issues/3460#note_53223252
diff --git a/db/post_migrate/20170913180600_fix_projects_without_project_feature.rb b/db/post_migrate/20170913180600_fix_projects_without_project_feature.rb
index bfa9ad80c7df9..bbc624ac7c0e6 100644
--- a/db/post_migrate/20170913180600_fix_projects_without_project_feature.rb
+++ b/db/post_migrate/20170913180600_fix_projects_without_project_feature.rb
@@ -1,4 +1,4 @@
-class FixProjectsWithoutProjectFeature < ActiveRecord::Migration
+class FixProjectsWithoutProjectFeature < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb b/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
index 2230bb0e53c37..9080acee1d661 100644
--- a/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
+++ b/db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class NormalizeLdapExternUids < ActiveRecord::Migration
+class NormalizeLdapExternUids < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170926150348_schedule_merge_request_diff_migrations_take_two.rb b/db/post_migrate/20170926150348_schedule_merge_request_diff_migrations_take_two.rb
index 5732cb85ea5cf..9b675a51725b4 100644
--- a/db/post_migrate/20170926150348_schedule_merge_request_diff_migrations_take_two.rb
+++ b/db/post_migrate/20170926150348_schedule_merge_request_diff_migrations_take_two.rb
@@ -1,4 +1,4 @@
-class ScheduleMergeRequestDiffMigrationsTakeTwo < ActiveRecord::Migration
+class ScheduleMergeRequestDiffMigrationsTakeTwo < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb b/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
index b040c81b31647..83c21c203e048 100644
--- a/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
+++ b/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class UpdateLegacyDiffNotesTypeForImport < ActiveRecord::Migration
+class UpdateLegacyDiffNotesTypeForImport < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20170927112319_update_notes_type_for_import.rb b/db/post_migrate/20170927112319_update_notes_type_for_import.rb
index 5a400c71b0213..8c691de3192f0 100644
--- a/db/post_migrate/20170927112319_update_notes_type_for_import.rb
+++ b/db/post_migrate/20170927112319_update_notes_type_for_import.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class UpdateNotesTypeForImport < ActiveRecord::Migration
+class UpdateNotesTypeForImport < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb b/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb
index 467c584c2e00d..e49a70f902c4f 100644
--- a/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb
+++ b/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ScheduleCreateGpgKeySubkeysFromGpgKeys < ActiveRecord::Migration
+class ScheduleCreateGpgKeySubkeysFromGpgKeys < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171012150314_remove_user_authentication_token.rb b/db/post_migrate/20171012150314_remove_user_authentication_token.rb
index d0f3aa06e9827..9313986ce8505 100644
--- a/db/post_migrate/20171012150314_remove_user_authentication_token.rb
+++ b/db/post_migrate/20171012150314_remove_user_authentication_token.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveUserAuthenticationToken < ActiveRecord::Migration
+class RemoveUserAuthenticationToken < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb b/db/post_migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb
index 28cd0f70cc25d..9c90aa611a478 100644
--- a/db/post_migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb
+++ b/db/post_migrate/20171013104327_migrate_gcp_clusters_to_new_clusters_architectures.rb
@@ -1,4 +1,4 @@
-class MigrateGcpClustersToNewClustersArchitectures < ActiveRecord::Migration
+class MigrateGcpClustersToNewClustersArchitectures < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   class GcpCluster < ActiveRecord::Base
diff --git a/db/post_migrate/20171026082505_schedule_merge_request_latest_merge_request_diff_id_migrations.rb b/db/post_migrate/20171026082505_schedule_merge_request_latest_merge_request_diff_id_migrations.rb
index 7a63382cc6d06..764561de997f6 100644
--- a/db/post_migrate/20171026082505_schedule_merge_request_latest_merge_request_diff_id_migrations.rb
+++ b/db/post_migrate/20171026082505_schedule_merge_request_latest_merge_request_diff_id_migrations.rb
@@ -1,4 +1,4 @@
-class ScheduleMergeRequestLatestMergeRequestDiffIdMigrations < ActiveRecord::Migration
+class ScheduleMergeRequestLatestMergeRequestDiffIdMigrations < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171101134435_remove_ref_fetched_from_merge_requests.rb b/db/post_migrate/20171101134435_remove_ref_fetched_from_merge_requests.rb
index 4e8f495d65d59..e6a5ffc8649aa 100644
--- a/db/post_migrate/20171101134435_remove_ref_fetched_from_merge_requests.rb
+++ b/db/post_migrate/20171101134435_remove_ref_fetched_from_merge_requests.rb
@@ -1,4 +1,4 @@
-class RemoveRefFetchedFromMergeRequests < ActiveRecord::Migration
+class RemoveRefFetchedFromMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20171103140253_track_untracked_uploads.rb b/db/post_migrate/20171103140253_track_untracked_uploads.rb
index 548a94d2d381d..6891ef5ba12eb 100644
--- a/db/post_migrate/20171103140253_track_untracked_uploads.rb
+++ b/db/post_migrate/20171103140253_track_untracked_uploads.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class TrackUntrackedUploads < ActiveRecord::Migration
+class TrackUntrackedUploads < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb b/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb
index d54ff3d5f5e75..4a01bf75f50c0 100644
--- a/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb
+++ b/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb
@@ -1,4 +1,4 @@
-class CleanupApplicationSettingsPasswordAuthenticationEnabledRename < ActiveRecord::Migration
+class CleanupApplicationSettingsPasswordAuthenticationEnabledRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171106154015_remove_issues_branch_name.rb b/db/post_migrate/20171106154015_remove_issues_branch_name.rb
index 3d08225c96de9..4e71aa2f1639c 100644
--- a/db/post_migrate/20171106154015_remove_issues_branch_name.rb
+++ b/db/post_migrate/20171106154015_remove_issues_branch_name.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveIssuesBranchName < ActiveRecord::Migration
+class RemoveIssuesBranchName < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb b/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb
index 53f376f216b64..8187d3971fcc3 100644
--- a/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb
+++ b/db/post_migrate/20171106180641_cleanup_add_timezone_to_issues_closed_at.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupAddTimezoneToIssuesClosedAt < ActiveRecord::Migration
+class CleanupAddTimezoneToIssuesClosedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171114104051_remove_empty_fork_networks.rb b/db/post_migrate/20171114104051_remove_empty_fork_networks.rb
index 2fe99a1b9c17a..76862cccf60f4 100644
--- a/db/post_migrate/20171114104051_remove_empty_fork_networks.rb
+++ b/db/post_migrate/20171114104051_remove_empty_fork_networks.rb
@@ -1,4 +1,4 @@
-class RemoveEmptyForkNetworks < ActiveRecord::Migration
+class RemoveEmptyForkNetworks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171121160421_remove_merge_request_diff_st_commits_and_st_diffs.rb b/db/post_migrate/20171121160421_remove_merge_request_diff_st_commits_and_st_diffs.rb
index 3a7b2a7fac041..93a97993f1fc4 100644
--- a/db/post_migrate/20171121160421_remove_merge_request_diff_st_commits_and_st_diffs.rb
+++ b/db/post_migrate/20171121160421_remove_merge_request_diff_st_commits_and_st_diffs.rb
@@ -1,4 +1,4 @@
-class RemoveMergeRequestDiffStCommitsAndStDiffs < ActiveRecord::Migration
+class RemoveMergeRequestDiffStCommitsAndStDiffs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171123101020_update_circuitbreaker_defaults.rb b/db/post_migrate/20171123101020_update_circuitbreaker_defaults.rb
index 8e1c9e6d6bb63..ae95428929190 100644
--- a/db/post_migrate/20171123101020_update_circuitbreaker_defaults.rb
+++ b/db/post_migrate/20171123101020_update_circuitbreaker_defaults.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class UpdateCircuitbreakerDefaults < ActiveRecord::Migration
+class UpdateCircuitbreakerDefaults < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171123101046_remove_old_circuitbreaker_config.rb b/db/post_migrate/20171123101046_remove_old_circuitbreaker_config.rb
index e646d4d3224ec..3f2c1b2170af8 100644
--- a/db/post_migrate/20171123101046_remove_old_circuitbreaker_config.rb
+++ b/db/post_migrate/20171123101046_remove_old_circuitbreaker_config.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveOldCircuitbreakerConfig < ActiveRecord::Migration
+class RemoveOldCircuitbreakerConfig < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171124095655_add_index_on_merge_request_diffs_merge_request_id_and_id.rb b/db/post_migrate/20171124095655_add_index_on_merge_request_diffs_merge_request_id_and_id.rb
index 698df712c11b3..2c65a4ae4f5e3 100644
--- a/db/post_migrate/20171124095655_add_index_on_merge_request_diffs_merge_request_id_and_id.rb
+++ b/db/post_migrate/20171124095655_add_index_on_merge_request_diffs_merge_request_id_and_id.rb
@@ -1,4 +1,4 @@
-class AddIndexOnMergeRequestDiffsMergeRequestIdAndId < ActiveRecord::Migration
+class AddIndexOnMergeRequestDiffsMergeRequestIdAndId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171124100152_remove_index_on_merge_request_diffs_merge_request_diff_id.rb b/db/post_migrate/20171124100152_remove_index_on_merge_request_diffs_merge_request_diff_id.rb
index 038e4807000c2..efd3714d66869 100644
--- a/db/post_migrate/20171124100152_remove_index_on_merge_request_diffs_merge_request_diff_id.rb
+++ b/db/post_migrate/20171124100152_remove_index_on_merge_request_diffs_merge_request_diff_id.rb
@@ -1,4 +1,4 @@
-class RemoveIndexOnMergeRequestDiffsMergeRequestDiffId < ActiveRecord::Migration
+class RemoveIndexOnMergeRequestDiffsMergeRequestDiffId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
index a957f10740544..58ceefe3c9744 100644
--- a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
+++ b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb
@@ -1,4 +1,4 @@
-class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migration
+class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171124150326_reschedule_fork_network_creation.rb b/db/post_migrate/20171124150326_reschedule_fork_network_creation.rb
index 26f917d5a1e8d..8e320ea9e8d91 100644
--- a/db/post_migrate/20171124150326_reschedule_fork_network_creation.rb
+++ b/db/post_migrate/20171124150326_reschedule_fork_network_creation.rb
@@ -1,4 +1,4 @@
-class RescheduleForkNetworkCreation < ActiveRecord::Migration
+class RescheduleForkNetworkCreation < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb b/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb
index 980f76e7d57d0..51441a36e4bae 100644
--- a/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb
+++ b/db/post_migrate/20171128214150_schedule_populate_merge_request_metrics_with_events_data.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class SchedulePopulateMergeRequestMetricsWithEventsData < ActiveRecord::Migration
+class SchedulePopulateMergeRequestMetricsWithEventsData < ActiveRecord::Migration[4.2]
   DOWNTIME = false
   BATCH_SIZE = 10_000
   MIGRATION = 'PopulateMergeRequestMetricsWithEventsData'
diff --git a/db/post_migrate/20171205190711_reschedule_fork_network_creation_caller.rb b/db/post_migrate/20171205190711_reschedule_fork_network_creation_caller.rb
index 30ff517319222..058f3a40817e5 100644
--- a/db/post_migrate/20171205190711_reschedule_fork_network_creation_caller.rb
+++ b/db/post_migrate/20171205190711_reschedule_fork_network_creation_caller.rb
@@ -1,4 +1,4 @@
-class RescheduleForkNetworkCreationCaller < ActiveRecord::Migration
+class RescheduleForkNetworkCreationCaller < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171207150300_remove_project_labels_group_id_copy.rb b/db/post_migrate/20171207150300_remove_project_labels_group_id_copy.rb
index 2f339172eeb36..44273cebc9d63 100644
--- a/db/post_migrate/20171207150300_remove_project_labels_group_id_copy.rb
+++ b/db/post_migrate/20171207150300_remove_project_labels_group_id_copy.rb
@@ -1,7 +1,7 @@
 # Copy of 20180202111106 - this one should run before 20171207150343 to fix issues related to
 # the removal of groups with labels.
 
-class RemoveProjectLabelsGroupIdCopy < ActiveRecord::Migration
+class RemoveProjectLabelsGroupIdCopy < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171207150343_remove_soft_removed_objects.rb b/db/post_migrate/20171207150343_remove_soft_removed_objects.rb
index 3109b6dbf8ea4..53707c67d3699 100644
--- a/db/post_migrate/20171207150343_remove_soft_removed_objects.rb
+++ b/db/post_migrate/20171207150343_remove_soft_removed_objects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveSoftRemovedObjects < ActiveRecord::Migration
+class RemoveSoftRemovedObjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20171207150344_remove_deleted_at_columns.rb b/db/post_migrate/20171207150344_remove_deleted_at_columns.rb
index 154d7a1b92666..5f1c70a27977f 100644
--- a/db/post_migrate/20171207150344_remove_deleted_at_columns.rb
+++ b/db/post_migrate/20171207150344_remove_deleted_at_columns.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveDeletedAtColumns < ActiveRecord::Migration
+class RemoveDeletedAtColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171213160445_migrate_github_importer_advance_stage_sidekiq_queue.rb b/db/post_migrate/20171213160445_migrate_github_importer_advance_stage_sidekiq_queue.rb
index 149c28f194653..088c4b5d46ba0 100644
--- a/db/post_migrate/20171213160445_migrate_github_importer_advance_stage_sidekiq_queue.rb
+++ b/db/post_migrate/20171213160445_migrate_github_importer_advance_stage_sidekiq_queue.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateGithubImporterAdvanceStageSidekiqQueue < ActiveRecord::Migration
+class MigrateGithubImporterAdvanceStageSidekiqQueue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171215121205_post_populate_can_push_from_deploy_keys_projects.rb b/db/post_migrate/20171215121205_post_populate_can_push_from_deploy_keys_projects.rb
index 3a5850df3db8c..1c81e56db559d 100644
--- a/db/post_migrate/20171215121205_post_populate_can_push_from_deploy_keys_projects.rb
+++ b/db/post_migrate/20171215121205_post_populate_can_push_from_deploy_keys_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PostPopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration
+class PostPopulateCanPushFromDeployKeysProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171215121259_remove_can_push_from_keys.rb b/db/post_migrate/20171215121259_remove_can_push_from_keys.rb
index 0599811d9869d..fc4045a383d1f 100644
--- a/db/post_migrate/20171215121259_remove_can_push_from_keys.rb
+++ b/db/post_migrate/20171215121259_remove_can_push_from_keys.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveCanPushFromKeys < ActiveRecord::Migration
+class RemoveCanPushFromKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171219121201_normalize_extern_uid_from_identities.rb b/db/post_migrate/20171219121201_normalize_extern_uid_from_identities.rb
index 286721a0894a7..45ef75fdb98ce 100644
--- a/db/post_migrate/20171219121201_normalize_extern_uid_from_identities.rb
+++ b/db/post_migrate/20171219121201_normalize_extern_uid_from_identities.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class NormalizeExternUidFromIdentities < ActiveRecord::Migration
+class NormalizeExternUidFromIdentities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20171221140220_schedule_issues_closed_at_type_change.rb b/db/post_migrate/20171221140220_schedule_issues_closed_at_type_change.rb
index eeecc7b1de0d7..6b5e620268884 100644
--- a/db/post_migrate/20171221140220_schedule_issues_closed_at_type_change.rb
+++ b/db/post_migrate/20171221140220_schedule_issues_closed_at_type_change.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 # rubocop:disable Migration/Datetime
-class ScheduleIssuesClosedAtTypeChange < ActiveRecord::Migration
+class ScheduleIssuesClosedAtTypeChange < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180104131052_schedule_set_confidential_note_events_on_webhooks.rb b/db/post_migrate/20180104131052_schedule_set_confidential_note_events_on_webhooks.rb
index fa51ac8361907..0822aebc2c6d1 100644
--- a/db/post_migrate/20180104131052_schedule_set_confidential_note_events_on_webhooks.rb
+++ b/db/post_migrate/20180104131052_schedule_set_confidential_note_events_on_webhooks.rb
@@ -1,4 +1,4 @@
-class ScheduleSetConfidentialNoteEventsOnWebhooks < ActiveRecord::Migration
+class ScheduleSetConfidentialNoteEventsOnWebhooks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180119121225_remove_redundant_pipeline_stages.rb b/db/post_migrate/20180119121225_remove_redundant_pipeline_stages.rb
index 269f1287f9124..0a2ea7bfb7b31 100644
--- a/db/post_migrate/20180119121225_remove_redundant_pipeline_stages.rb
+++ b/db/post_migrate/20180119121225_remove_redundant_pipeline_stages.rb
@@ -1,4 +1,4 @@
-class RemoveRedundantPipelineStages < ActiveRecord::Migration
+class RemoveRedundantPipelineStages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb b/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
index a3ff9f1719eeb..98bbb34dda1b1 100644
--- a/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
+++ b/db/post_migrate/20180122154930_schedule_set_confidential_note_events_on_services.rb
@@ -1,4 +1,4 @@
-class ScheduleSetConfidentialNoteEventsOnServices < ActiveRecord::Migration
+class ScheduleSetConfidentialNoteEventsOnServices < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180202111106_remove_project_labels_group_id.rb b/db/post_migrate/20180202111106_remove_project_labels_group_id.rb
index db7fd0d167df0..31ec84f0d6acd 100644
--- a/db/post_migrate/20180202111106_remove_project_labels_group_id.rb
+++ b/db/post_migrate/20180202111106_remove_project_labels_group_id.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveProjectLabelsGroupId < ActiveRecord::Migration
+class RemoveProjectLabelsGroupId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180204200836_change_author_id_to_not_null_in_todos.rb b/db/post_migrate/20180204200836_change_author_id_to_not_null_in_todos.rb
index 92c32feebf77b..54b8a91fa4723 100644
--- a/db/post_migrate/20180204200836_change_author_id_to_not_null_in_todos.rb
+++ b/db/post_migrate/20180204200836_change_author_id_to_not_null_in_todos.rb
@@ -1,4 +1,4 @@
-class ChangeAuthorIdToNotNullInTodos < ActiveRecord::Migration
+class ChangeAuthorIdToNotNullInTodos < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class Todo < ActiveRecord::Base
diff --git a/db/post_migrate/20180212101828_add_tmp_partial_null_index_to_builds.rb b/db/post_migrate/20180212101828_add_tmp_partial_null_index_to_builds.rb
index e55e2e6f88861..f8badcac990e7 100644
--- a/db/post_migrate/20180212101828_add_tmp_partial_null_index_to_builds.rb
+++ b/db/post_migrate/20180212101828_add_tmp_partial_null_index_to_builds.rb
@@ -1,4 +1,4 @@
-class AddTmpPartialNullIndexToBuilds < ActiveRecord::Migration
+class AddTmpPartialNullIndexToBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/post_migrate/20180212101928_schedule_build_stage_migration.rb b/db/post_migrate/20180212101928_schedule_build_stage_migration.rb
index 0f61fa8183238..2445ab1a1303e 100644
--- a/db/post_migrate/20180212101928_schedule_build_stage_migration.rb
+++ b/db/post_migrate/20180212101928_schedule_build_stage_migration.rb
@@ -1,4 +1,4 @@
-class ScheduleBuildStageMigration < ActiveRecord::Migration
+class ScheduleBuildStageMigration < ActiveRecord::Migration[4.2]
   ##
   # This migration has been rescheduled to run again, see
   # `20180405101928_reschedule_builds_stages_migration.rb`
diff --git a/db/post_migrate/20180212102028_remove_tmp_partial_null_index_from_builds.rb b/db/post_migrate/20180212102028_remove_tmp_partial_null_index_from_builds.rb
index ed7b1fc72f46f..2444df881b844 100644
--- a/db/post_migrate/20180212102028_remove_tmp_partial_null_index_from_builds.rb
+++ b/db/post_migrate/20180212102028_remove_tmp_partial_null_index_from_builds.rb
@@ -1,4 +1,4 @@
-class RemoveTmpPartialNullIndexFromBuilds < ActiveRecord::Migration
+class RemoveTmpPartialNullIndexFromBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/post_migrate/20180216121020_fill_pages_domain_verification_code.rb b/db/post_migrate/20180216121020_fill_pages_domain_verification_code.rb
index d423673d2a57b..dae43ee14df1e 100644
--- a/db/post_migrate/20180216121020_fill_pages_domain_verification_code.rb
+++ b/db/post_migrate/20180216121020_fill_pages_domain_verification_code.rb
@@ -1,4 +1,4 @@
-class FillPagesDomainVerificationCode < ActiveRecord::Migration
+class FillPagesDomainVerificationCode < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   class PagesDomain < ActiveRecord::Base
diff --git a/db/post_migrate/20180216121030_enqueue_verify_pages_domain_workers.rb b/db/post_migrate/20180216121030_enqueue_verify_pages_domain_workers.rb
index bf9bf4e660f7c..d776fb85f00f9 100644
--- a/db/post_migrate/20180216121030_enqueue_verify_pages_domain_workers.rb
+++ b/db/post_migrate/20180216121030_enqueue_verify_pages_domain_workers.rb
@@ -1,4 +1,4 @@
-class EnqueueVerifyPagesDomainWorkers < ActiveRecord::Migration
+class EnqueueVerifyPagesDomainWorkers < ActiveRecord::Migration[4.2]
   class PagesDomain < ActiveRecord::Base
     include EachBatch
   end
diff --git a/db/post_migrate/20180220150310_remove_empty_extern_uid_auth0_identities.rb b/db/post_migrate/20180220150310_remove_empty_extern_uid_auth0_identities.rb
index 2d5a8617169c5..86ef333685ede 100644
--- a/db/post_migrate/20180220150310_remove_empty_extern_uid_auth0_identities.rb
+++ b/db/post_migrate/20180220150310_remove_empty_extern_uid_auth0_identities.rb
@@ -1,4 +1,4 @@
-class RemoveEmptyExternUidAuth0Identities < ActiveRecord::Migration
+class RemoveEmptyExternUidAuth0Identities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb b/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb
index 8c8dbb1a04340..fa332fd5c708d 100644
--- a/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb
+++ b/db/post_migrate/20180223124427_build_user_interacted_projects_table.rb
@@ -1,7 +1,7 @@
 require_relative '../migrate/20180223120443_create_user_interacted_projects_table.rb'
 # rubocop:disable AddIndex
 # rubocop:disable AddConcurrentForeignKey
-class BuildUserInteractedProjectsTable < ActiveRecord::Migration
+class BuildUserInteractedProjectsTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
@@ -43,7 +43,7 @@ def down
     end
   end
 
-  class PostgresStrategy < ActiveRecord::Migration
+  class PostgresStrategy < ActiveRecord::Migration[4.2]
     include Gitlab::Database::MigrationHelpers
 
     BATCH_SIZE = 100_000
@@ -141,7 +141,7 @@ def with_index(*args)
     end
   end
 
-  class MysqlStrategy < ActiveRecord::Migration
+  class MysqlStrategy < ActiveRecord::Migration[4.2]
     include Gitlab::Database::MigrationHelpers
 
     def up
diff --git a/db/post_migrate/20180301084653_change_project_namespace_id_not_null.rb b/db/post_migrate/20180301084653_change_project_namespace_id_not_null.rb
index 0342372cbed15..62a239b0e7c74 100644
--- a/db/post_migrate/20180301084653_change_project_namespace_id_not_null.rb
+++ b/db/post_migrate/20180301084653_change_project_namespace_id_not_null.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class ChangeProjectNamespaceIdNotNull < ActiveRecord::Migration
+class ChangeProjectNamespaceIdNotNull < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class Project < ActiveRecord::Base
diff --git a/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb b/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb
index aa19732ca1c71..15c052da99be1 100644
--- a/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb
+++ b/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemovePermanentFromRedirectRoutes < ActiveRecord::Migration
+class RemovePermanentFromRedirectRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180306074045_migrate_create_trace_artifact_sidekiq_queue.rb b/db/post_migrate/20180306074045_migrate_create_trace_artifact_sidekiq_queue.rb
index 0af1c3bc0a5d4..fc74f6f171253 100644
--- a/db/post_migrate/20180306074045_migrate_create_trace_artifact_sidekiq_queue.rb
+++ b/db/post_migrate/20180306074045_migrate_create_trace_artifact_sidekiq_queue.rb
@@ -1,4 +1,4 @@
-class MigrateCreateTraceArtifactSidekiqQueue < ActiveRecord::Migration
+class MigrateCreateTraceArtifactSidekiqQueue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb b/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
index ca9212fae27ed..53918250b4cb3 100644
--- a/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
+++ b/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPathIndexToRedirectRoutes < ActiveRecord::Migration
+class AddPathIndexToRedirectRoutes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20180307012445_migrate_update_head_pipeline_for_merge_request_sidekiq_queue.rb b/db/post_migrate/20180307012445_migrate_update_head_pipeline_for_merge_request_sidekiq_queue.rb
index 9728df6d409f5..372c04429c7da 100644
--- a/db/post_migrate/20180307012445_migrate_update_head_pipeline_for_merge_request_sidekiq_queue.rb
+++ b/db/post_migrate/20180307012445_migrate_update_head_pipeline_for_merge_request_sidekiq_queue.rb
@@ -1,4 +1,4 @@
-class MigrateUpdateHeadPipelineForMergeRequestSidekiqQueue < ActiveRecord::Migration
+class MigrateUpdateHeadPipelineForMergeRequestSidekiqQueue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180405101928_reschedule_builds_stages_migration.rb b/db/post_migrate/20180405101928_reschedule_builds_stages_migration.rb
index c32123454f95c..213d97b71f7c7 100644
--- a/db/post_migrate/20180405101928_reschedule_builds_stages_migration.rb
+++ b/db/post_migrate/20180405101928_reschedule_builds_stages_migration.rb
@@ -1,4 +1,4 @@
-class RescheduleBuildsStagesMigration < ActiveRecord::Migration
+class RescheduleBuildsStagesMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   ##
diff --git a/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb b/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb
index 3d77ff921c7d3..813603cb3addc 100644
--- a/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb
+++ b/db/post_migrate/20180408143355_cleanup_users_rss_token_rename.rb
@@ -1,4 +1,4 @@
-class CleanupUsersRssTokenRename < ActiveRecord::Migration
+class CleanupUsersRssTokenRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/db/post_migrate/20180409170809_populate_missing_project_ci_cd_settings.rb b/db/post_migrate/20180409170809_populate_missing_project_ci_cd_settings.rb
index 3b0fdb3aeea75..0cda3d76a3d39 100644
--- a/db/post_migrate/20180409170809_populate_missing_project_ci_cd_settings.rb
+++ b/db/post_migrate/20180409170809_populate_missing_project_ci_cd_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PopulateMissingProjectCiCdSettings < ActiveRecord::Migration
+class PopulateMissingProjectCiCdSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180420080616_schedule_stages_index_migration.rb b/db/post_migrate/20180420080616_schedule_stages_index_migration.rb
index eb82f098639fc..2d72e75393f4e 100644
--- a/db/post_migrate/20180420080616_schedule_stages_index_migration.rb
+++ b/db/post_migrate/20180420080616_schedule_stages_index_migration.rb
@@ -1,4 +1,4 @@
-class ScheduleStagesIndexMigration < ActiveRecord::Migration
+class ScheduleStagesIndexMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180424151928_fill_file_store.rb b/db/post_migrate/20180424151928_fill_file_store.rb
index 03d54dab250bd..45fa10c955007 100644
--- a/db/post_migrate/20180424151928_fill_file_store.rb
+++ b/db/post_migrate/20180424151928_fill_file_store.rb
@@ -1,4 +1,4 @@
-class FillFileStore < ActiveRecord::Migration
+class FillFileStore < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb b/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
index 0e6ec46e5f07a..ba1023866c56b 100644
--- a/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
+++ b/db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
@@ -1,4 +1,4 @@
-class BackfillRunnerTypeForCiRunnersPostMigrate < ActiveRecord::Migration
+class BackfillRunnerTypeForCiRunnersPostMigrate < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb b/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb
index 08d7d64a2c551..b82ee3569c9b5 100644
--- a/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb
+++ b/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb
@@ -1,4 +1,4 @@
-class MigrateImportAttributesDataFromProjectsToProjectMirrorData < ActiveRecord::Migration
+class MigrateImportAttributesDataFromProjectsToProjectMirrorData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
index fb9616f0c078b..34edbb08bcf12 100644
--- a/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
+++ b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
@@ -1,4 +1,4 @@
-class SetMinimalProjectBuildTimeout < ActiveRecord::Migration
+class SetMinimalProjectBuildTimeout < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180511174224_add_unique_constraint_to_project_features_project_id.rb b/db/post_migrate/20180511174224_add_unique_constraint_to_project_features_project_id.rb
index 88a9f5f825662..a526001a91e60 100644
--- a/db/post_migrate/20180511174224_add_unique_constraint_to_project_features_project_id.rb
+++ b/db/post_migrate/20180511174224_add_unique_constraint_to_project_features_project_id.rb
@@ -1,4 +1,4 @@
-class AddUniqueConstraintToProjectFeaturesProjectId < ActiveRecord::Migration
+class AddUniqueConstraintToProjectFeaturesProjectId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180512061621_add_not_null_constraint_to_project_features_project_id.rb b/db/post_migrate/20180512061621_add_not_null_constraint_to_project_features_project_id.rb
index 5a6d6ff4a1091..e3abbc039e8a7 100644
--- a/db/post_migrate/20180512061621_add_not_null_constraint_to_project_features_project_id.rb
+++ b/db/post_migrate/20180512061621_add_not_null_constraint_to_project_features_project_id.rb
@@ -1,4 +1,4 @@
-class AddNotNullConstraintToProjectFeaturesProjectId < ActiveRecord::Migration
+class AddNotNullConstraintToProjectFeaturesProjectId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180514161336_remove_gemnasium_service.rb b/db/post_migrate/20180514161336_remove_gemnasium_service.rb
index 6d7806e8daa4d..5842bde474c3b 100644
--- a/db/post_migrate/20180514161336_remove_gemnasium_service.rb
+++ b/db/post_migrate/20180514161336_remove_gemnasium_service.rb
@@ -1,4 +1,4 @@
-class RemoveGemnasiumService < ActiveRecord::Migration
+class RemoveGemnasiumService < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180521162137_migrate_remaining_mr_metrics_populating_background_migration.rb b/db/post_migrate/20180521162137_migrate_remaining_mr_metrics_populating_background_migration.rb
index 0282688fa40d2..39666a0cd2ae5 100644
--- a/db/post_migrate/20180521162137_migrate_remaining_mr_metrics_populating_background_migration.rb
+++ b/db/post_migrate/20180521162137_migrate_remaining_mr_metrics_populating_background_migration.rb
@@ -1,4 +1,4 @@
-class MigrateRemainingMrMetricsPopulatingBackgroundMigration < ActiveRecord::Migration
+class MigrateRemainingMrMetricsPopulatingBackgroundMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
index 7eca7394f5f83..b3b539fd15601 100644
--- a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
+++ b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
@@ -1,4 +1,4 @@
-class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration
+class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb b/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb
index 965cd3a8714b1..6246f6afab090 100644
--- a/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb
+++ b/db/post_migrate/20180529152628_schedule_to_archive_legacy_traces.rb
@@ -1,4 +1,4 @@
-class ScheduleToArchiveLegacyTraces < ActiveRecord::Migration
+class ScheduleToArchiveLegacyTraces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180603190921_migrate_object_storage_upload_sidekiq_queue.rb b/db/post_migrate/20180603190921_migrate_object_storage_upload_sidekiq_queue.rb
index 57bee6269b9d6..bc7c3eb538532 100644
--- a/db/post_migrate/20180603190921_migrate_object_storage_upload_sidekiq_queue.rb
+++ b/db/post_migrate/20180603190921_migrate_object_storage_upload_sidekiq_queue.rb
@@ -1,4 +1,4 @@
-class MigrateObjectStorageUploadSidekiqQueue < ActiveRecord::Migration
+class MigrateObjectStorageUploadSidekiqQueue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180604123514_cleanup_stages_position_migration.rb b/db/post_migrate/20180604123514_cleanup_stages_position_migration.rb
index 5418f442e790c..326cdfa27c3f1 100644
--- a/db/post_migrate/20180604123514_cleanup_stages_position_migration.rb
+++ b/db/post_migrate/20180604123514_cleanup_stages_position_migration.rb
@@ -1,4 +1,4 @@
-class CleanupStagesPositionMigration < ActiveRecord::Migration
+class CleanupStagesPositionMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb b/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb
index 3f3edb8ea3d3d..5e892f8bacef6 100644
--- a/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb
+++ b/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CleanupMergeRequestsAllowCollaborationRename < ActiveRecord::Migration
+class CleanupMergeRequestsAllowCollaborationRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb b/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb
index c4d2f5f61a0ac..73f6a3a2a4386 100644
--- a/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb
+++ b/db/post_migrate/20180619121030_enqueue_delete_diff_files_workers.rb
@@ -1,4 +1,4 @@
-class EnqueueDeleteDiffFilesWorkers < ActiveRecord::Migration
+class EnqueueDeleteDiffFilesWorkers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180629191052_add_partial_index_to_projects_for_last_repository_check_at.rb b/db/post_migrate/20180629191052_add_partial_index_to_projects_for_last_repository_check_at.rb
index a701d3678db59..15c02cd77b826 100644
--- a/db/post_migrate/20180629191052_add_partial_index_to_projects_for_last_repository_check_at.rb
+++ b/db/post_migrate/20180629191052_add_partial_index_to_projects_for_last_repository_check_at.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectsForLastRepositoryCheckAt < ActiveRecord::Migration
+class AddPartialIndexToProjectsForLastRepositoryCheckAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20180702120647_enqueue_fix_cross_project_label_links.rb b/db/post_migrate/20180702120647_enqueue_fix_cross_project_label_links.rb
index 59aa41adedee0..3d3d49e756449 100644
--- a/db/post_migrate/20180702120647_enqueue_fix_cross_project_label_links.rb
+++ b/db/post_migrate/20180702120647_enqueue_fix_cross_project_label_links.rb
@@ -1,4 +1,4 @@
-class EnqueueFixCrossProjectLabelLinks < ActiveRecord::Migration
+class EnqueueFixCrossProjectLabelLinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180704145007_update_project_indexes.rb b/db/post_migrate/20180704145007_update_project_indexes.rb
index 0e2601ad4fa5a..0a82f4535a0e0 100644
--- a/db/post_migrate/20180704145007_update_project_indexes.rb
+++ b/db/post_migrate/20180704145007_update_project_indexes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class UpdateProjectIndexes < ActiveRecord::Migration
+class UpdateProjectIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180706223200_populate_site_statistics.rb b/db/post_migrate/20180706223200_populate_site_statistics.rb
index e78e9eb900a18..896965b708fa4 100644
--- a/db/post_migrate/20180706223200_populate_site_statistics.rb
+++ b/db/post_migrate/20180706223200_populate_site_statistics.rb
@@ -1,4 +1,4 @@
-class PopulateSiteStatistics < ActiveRecord::Migration
+class PopulateSiteStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180723130817_delete_inconsistent_internal_id_records.rb b/db/post_migrate/20180723130817_delete_inconsistent_internal_id_records.rb
index f61fbe2fb9fee..b044224a1c06b 100644
--- a/db/post_migrate/20180723130817_delete_inconsistent_internal_id_records.rb
+++ b/db/post_migrate/20180723130817_delete_inconsistent_internal_id_records.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class DeleteInconsistentInternalIdRecords < ActiveRecord::Migration
+class DeleteInconsistentInternalIdRecords < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180809195358_migrate_null_wiki_access_levels.rb b/db/post_migrate/20180809195358_migrate_null_wiki_access_levels.rb
index 0a0a33299e442..363219da539a1 100644
--- a/db/post_migrate/20180809195358_migrate_null_wiki_access_levels.rb
+++ b/db/post_migrate/20180809195358_migrate_null_wiki_access_levels.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class MigrateNullWikiAccessLevels < ActiveRecord::Migration
+class MigrateNullWikiAccessLevels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180816161409_migrate_legacy_artifacts_to_job_artifacts.rb b/db/post_migrate/20180816161409_migrate_legacy_artifacts_to_job_artifacts.rb
index 2dd711e9c102c..6b0d1ef0d0c57 100644
--- a/db/post_migrate/20180816161409_migrate_legacy_artifacts_to_job_artifacts.rb
+++ b/db/post_migrate/20180816161409_migrate_legacy_artifacts_to_job_artifacts.rb
@@ -1,4 +1,4 @@
-class MigrateLegacyArtifactsToJobArtifacts < ActiveRecord::Migration
+class MigrateLegacyArtifactsToJobArtifacts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180816193530_rename_login_root_namespaces.rb b/db/post_migrate/20180816193530_rename_login_root_namespaces.rb
index 4ab1250473f52..70db8f46d050b 100644
--- a/db/post_migrate/20180816193530_rename_login_root_namespaces.rb
+++ b/db/post_migrate/20180816193530_rename_login_root_namespaces.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class RenameLoginRootNamespaces < ActiveRecord::Migration
+class RenameLoginRootNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   include Gitlab::Database::RenameReservedPathsMigration::V1
 
diff --git a/db/post_migrate/20180826111825_recalculate_site_statistics.rb b/db/post_migrate/20180826111825_recalculate_site_statistics.rb
index 741035a444f99..6d27eca38e331 100644
--- a/db/post_migrate/20180826111825_recalculate_site_statistics.rb
+++ b/db/post_migrate/20180826111825_recalculate_site_statistics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class RecalculateSiteStatistics < ActiveRecord::Migration
+class RecalculateSiteStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180906051323_remove_orphaned_label_links.rb b/db/post_migrate/20180906051323_remove_orphaned_label_links.rb
index b56b74f483ebf..a474aaf534cf2 100644
--- a/db/post_migrate/20180906051323_remove_orphaned_label_links.rb
+++ b/db/post_migrate/20180906051323_remove_orphaned_label_links.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class RemoveOrphanedLabelLinks < ActiveRecord::Migration
+class RemoveOrphanedLabelLinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180913051323_consume_remaining_diff_files_deletion_jobs.rb b/db/post_migrate/20180913051323_consume_remaining_diff_files_deletion_jobs.rb
index ed9422a389477..2c266a4695bfc 100644
--- a/db/post_migrate/20180913051323_consume_remaining_diff_files_deletion_jobs.rb
+++ b/db/post_migrate/20180913051323_consume_remaining_diff_files_deletion_jobs.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class ConsumeRemainingDiffFilesDeletionJobs < ActiveRecord::Migration
+class ConsumeRemainingDiffFilesDeletionJobs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180913142237_schedule_digest_personal_access_tokens.rb b/db/post_migrate/20180913142237_schedule_digest_personal_access_tokens.rb
index 36be819b2456d..951cb3b088c90 100644
--- a/db/post_migrate/20180913142237_schedule_digest_personal_access_tokens.rb
+++ b/db/post_migrate/20180913142237_schedule_digest_personal_access_tokens.rb
@@ -1,4 +1,4 @@
-class ScheduleDigestPersonalAccessTokens < ActiveRecord::Migration
+class ScheduleDigestPersonalAccessTokens < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180914162043_encrypt_web_hooks_columns.rb b/db/post_migrate/20180914162043_encrypt_web_hooks_columns.rb
index 05ec4864a9e38..ef864f490bb95 100644
--- a/db/post_migrate/20180914162043_encrypt_web_hooks_columns.rb
+++ b/db/post_migrate/20180914162043_encrypt_web_hooks_columns.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class EncryptWebHooksColumns < ActiveRecord::Migration
+class EncryptWebHooksColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180914201132_remove_sidekiq_throttling_from_application_settings.rb b/db/post_migrate/20180914201132_remove_sidekiq_throttling_from_application_settings.rb
index b3ed0d3f1e981..2c007ec395df4 100644
--- a/db/post_migrate/20180914201132_remove_sidekiq_throttling_from_application_settings.rb
+++ b/db/post_migrate/20180914201132_remove_sidekiq_throttling_from_application_settings.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveSidekiqThrottlingFromApplicationSettings < ActiveRecord::Migration
+class RemoveSidekiqThrottlingFromApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20180916014356_populate_external_pipeline_source.rb b/db/post_migrate/20180916014356_populate_external_pipeline_source.rb
index 5577d05cf408e..a3d2df1f2bdae 100644
--- a/db/post_migrate/20180916014356_populate_external_pipeline_source.rb
+++ b/db/post_migrate/20180916014356_populate_external_pipeline_source.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class PopulateExternalPipelineSource < ActiveRecord::Migration
+class PopulateExternalPipelineSource < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20180917172041_remove_wikis_count_from_site_statistics.rb b/db/post_migrate/20180917172041_remove_wikis_count_from_site_statistics.rb
index 0a39abe3bdf64..3b8300dabeba9 100644
--- a/db/post_migrate/20180917172041_remove_wikis_count_from_site_statistics.rb
+++ b/db/post_migrate/20180917172041_remove_wikis_count_from_site_statistics.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class RemoveWikisCountFromSiteStatistics < ActiveRecord::Migration
+class RemoveWikisCountFromSiteStatistics < ActiveRecord::Migration[4.2]
   def change
     remove_column :site_statistics, :wikis_count, :integer
   end
diff --git a/db/post_migrate/20181008145341_steal_encrypt_columns.rb b/db/post_migrate/20181008145341_steal_encrypt_columns.rb
index c107ac7291372..4102643ba138f 100644
--- a/db/post_migrate/20181008145341_steal_encrypt_columns.rb
+++ b/db/post_migrate/20181008145341_steal_encrypt_columns.rb
@@ -1,4 +1,4 @@
-class StealEncryptColumns < ActiveRecord::Migration
+class StealEncryptColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181008145359_remove_web_hooks_token_and_url.rb b/db/post_migrate/20181008145359_remove_web_hooks_token_and_url.rb
index 0c44bca5f1a9f..93e4458b795b0 100644
--- a/db/post_migrate/20181008145359_remove_web_hooks_token_and_url.rb
+++ b/db/post_migrate/20181008145359_remove_web_hooks_token_and_url.rb
@@ -1,4 +1,4 @@
-class RemoveWebHooksTokenAndUrl < ActiveRecord::Migration
+class RemoveWebHooksTokenAndUrl < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181008200441_remove_circuit_breaker.rb b/db/post_migrate/20181008200441_remove_circuit_breaker.rb
index 838addb7286c9..378692e8886af 100644
--- a/db/post_migrate/20181008200441_remove_circuit_breaker.rb
+++ b/db/post_migrate/20181008200441_remove_circuit_breaker.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class RemoveCircuitBreaker < ActiveRecord::Migration
+class RemoveCircuitBreaker < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/db/post_migrate/20181013005024_remove_koding_from_application_settings.rb b/db/post_migrate/20181013005024_remove_koding_from_application_settings.rb
index 938a32e4e983b..550ad94f4abae 100644
--- a/db/post_migrate/20181013005024_remove_koding_from_application_settings.rb
+++ b/db/post_migrate/20181013005024_remove_koding_from_application_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class RemoveKodingFromApplicationSettings < ActiveRecord::Migration
+class RemoveKodingFromApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181014121030_enqueue_redact_links.rb b/db/post_migrate/20181014121030_enqueue_redact_links.rb
index 1ee4703c88a30..8d1a840d59481 100644
--- a/db/post_migrate/20181014121030_enqueue_redact_links.rb
+++ b/db/post_migrate/20181014121030_enqueue_redact_links.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class EnqueueRedactLinks < ActiveRecord::Migration
+class EnqueueRedactLinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb b/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb
index f80a2aa6eaced..94a4574abff59 100644
--- a/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb
+++ b/db/post_migrate/20181022173835_enqueue_populate_cluster_kubernetes_namespace.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class EnqueuePopulateClusterKubernetesNamespace < ActiveRecord::Migration
+class EnqueuePopulateClusterKubernetesNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181030135124_fill_empty_finished_at_in_deployments.rb b/db/post_migrate/20181030135124_fill_empty_finished_at_in_deployments.rb
index 32b271c472a73..228841a14a048 100644
--- a/db/post_migrate/20181030135124_fill_empty_finished_at_in_deployments.rb
+++ b/db/post_migrate/20181030135124_fill_empty_finished_at_in_deployments.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class FillEmptyFinishedAtInDeployments < ActiveRecord::Migration
+class FillEmptyFinishedAtInDeployments < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181105201455_steal_fill_store_upload.rb b/db/post_migrate/20181105201455_steal_fill_store_upload.rb
index 982001fedbe3c..a31a4eab472ee 100644
--- a/db/post_migrate/20181105201455_steal_fill_store_upload.rb
+++ b/db/post_migrate/20181105201455_steal_fill_store_upload.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class StealFillStoreUpload < ActiveRecord::Migration
+class StealFillStoreUpload < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/db/post_migrate/20181107054254_remove_restricted_todos_again.rb b/db/post_migrate/20181107054254_remove_restricted_todos_again.rb
index 644e0074c46e2..bbeb4e8a1dea9 100644
--- a/db/post_migrate/20181107054254_remove_restricted_todos_again.rb
+++ b/db/post_migrate/20181107054254_remove_restricted_todos_again.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 # rescheduling of the revised RemoveRestrictedTodosWithCte background migration
-class RemoveRestrictedTodosAgain < ActiveRecord::Migration
+class RemoveRestrictedTodosAgain < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20170206203234_create_project_registry.rb b/ee/db/geo/migrate/20170206203234_create_project_registry.rb
index 0efddece2ff01..9471aa213a07c 100644
--- a/ee/db/geo/migrate/20170206203234_create_project_registry.rb
+++ b/ee/db/geo/migrate/20170206203234_create_project_registry.rb
@@ -1,4 +1,4 @@
-class CreateProjectRegistry < ActiveRecord::Migration
+class CreateProjectRegistry < ActiveRecord::Migration[4.2]
   def change
     create_table :project_registry do |t|
       t.integer  :project_id, null: false
diff --git a/ee/db/geo/migrate/20170223033541_create_file_registry.rb b/ee/db/geo/migrate/20170223033541_create_file_registry.rb
index daa41bafef5d7..5a2607d8de56e 100644
--- a/ee/db/geo/migrate/20170223033541_create_file_registry.rb
+++ b/ee/db/geo/migrate/20170223033541_create_file_registry.rb
@@ -1,4 +1,4 @@
-class CreateFileRegistry < ActiveRecord::Migration
+class CreateFileRegistry < ActiveRecord::Migration[4.2]
   def change
     create_table :file_registry do |t|
       t.string  :file_type, null: false
diff --git a/ee/db/geo/migrate/20170302005747_add_index_to_project_id_on_project_registry.rb b/ee/db/geo/migrate/20170302005747_add_index_to_project_id_on_project_registry.rb
index 1a514b987c83b..02e702ff65d90 100644
--- a/ee/db/geo/migrate/20170302005747_add_index_to_project_id_on_project_registry.rb
+++ b/ee/db/geo/migrate/20170302005747_add_index_to_project_id_on_project_registry.rb
@@ -1,4 +1,4 @@
-class AddIndexToProjectIdOnProjectRegistry < ActiveRecord::Migration
+class AddIndexToProjectIdOnProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20170526214010_convert_file_bytes_to_int64.rb b/ee/db/geo/migrate/20170526214010_convert_file_bytes_to_int64.rb
index 3370e0296f146..8f4dc6f2575f3 100644
--- a/ee/db/geo/migrate/20170526214010_convert_file_bytes_to_int64.rb
+++ b/ee/db/geo/migrate/20170526214010_convert_file_bytes_to_int64.rb
@@ -1,4 +1,4 @@
-class ConvertFileBytesToInt64 < ActiveRecord::Migration
+class ConvertFileBytesToInt64 < ActiveRecord::Migration[4.2]
   def change
     change_column :file_registry, :bytes, :integer, limit: 8
   end
diff --git a/ee/db/geo/migrate/20170605154253_create_event_log_state.rb b/ee/db/geo/migrate/20170605154253_create_event_log_state.rb
index 00b7369ffc73f..79039e7b70e84 100644
--- a/ee/db/geo/migrate/20170605154253_create_event_log_state.rb
+++ b/ee/db/geo/migrate/20170605154253_create_event_log_state.rb
@@ -1,4 +1,4 @@
-class CreateEventLogState < ActiveRecord::Migration
+class CreateEventLogState < ActiveRecord::Migration[4.2]
   def change
     create_table :event_log_states, id: false do |t|
       t.integer :event_id, limit: 8, primary_key: true
diff --git a/ee/db/geo/migrate/20170606155045_add_needs_resync_to_project_registry.rb b/ee/db/geo/migrate/20170606155045_add_needs_resync_to_project_registry.rb
index d2d1723b6a641..b362c59b18c14 100644
--- a/ee/db/geo/migrate/20170606155045_add_needs_resync_to_project_registry.rb
+++ b/ee/db/geo/migrate/20170606155045_add_needs_resync_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddNeedsResyncToProjectRegistry < ActiveRecord::Migration
+class AddNeedsResyncToProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20170614201943_add_last_wiki_synced_at_to_project_registry.rb b/ee/db/geo/migrate/20170614201943_add_last_wiki_synced_at_to_project_registry.rb
index 1c8714dbaae03..842d46f44d31e 100644
--- a/ee/db/geo/migrate/20170614201943_add_last_wiki_synced_at_to_project_registry.rb
+++ b/ee/db/geo/migrate/20170614201943_add_last_wiki_synced_at_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddLastWikiSyncedAtToProjectRegistry < ActiveRecord::Migration
+class AddLastWikiSyncedAtToProjectRegistry < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/geo/migrate/20170627195211_add_index_to_project_registry.rb b/ee/db/geo/migrate/20170627195211_add_index_to_project_registry.rb
index 2f85c91becb23..08e8422dd92f3 100644
--- a/ee/db/geo/migrate/20170627195211_add_index_to_project_registry.rb
+++ b/ee/db/geo/migrate/20170627195211_add_index_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddIndexToProjectRegistry < ActiveRecord::Migration
+class AddIndexToProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20170906174622_remove_duplicates_from_project_registry.rb b/ee/db/geo/migrate/20170906174622_remove_duplicates_from_project_registry.rb
index b351afd9a653e..0dea2a43b5881 100644
--- a/ee/db/geo/migrate/20170906174622_remove_duplicates_from_project_registry.rb
+++ b/ee/db/geo/migrate/20170906174622_remove_duplicates_from_project_registry.rb
@@ -1,4 +1,4 @@
-class RemoveDuplicatesFromProjectRegistry < ActiveRecord::Migration
+class RemoveDuplicatesFromProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20170906182752_add_unique_index_to_project_id_on_project_registry.rb b/ee/db/geo/migrate/20170906182752_add_unique_index_to_project_id_on_project_registry.rb
index 7d954b6a26644..4801ec2993fff 100644
--- a/ee/db/geo/migrate/20170906182752_add_unique_index_to_project_id_on_project_registry.rb
+++ b/ee/db/geo/migrate/20170906182752_add_unique_index_to_project_id_on_project_registry.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexToProjectIdOnProjectRegistry < ActiveRecord::Migration
+class AddUniqueIndexToProjectIdOnProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20171005045404_remove_file_uploads_from_registry.rb b/ee/db/geo/migrate/20171005045404_remove_file_uploads_from_registry.rb
index bea1c8adfcb61..75808a856c25b 100644
--- a/ee/db/geo/migrate/20171005045404_remove_file_uploads_from_registry.rb
+++ b/ee/db/geo/migrate/20171005045404_remove_file_uploads_from_registry.rb
@@ -1,4 +1,4 @@
-class RemoveFileUploadsFromRegistry < ActiveRecord::Migration
+class RemoveFileUploadsFromRegistry < ActiveRecord::Migration[4.2]
   # Previous to GitLab 10.1, GitLab would save attachments/avatars to the
   # wrong directory (/var/opt/gitlab/gitlab-rails/working). Destroy these
   # entries so they will be downloaded again.
diff --git a/ee/db/geo/migrate/20171009162208_add_file_registry_success.rb b/ee/db/geo/migrate/20171009162208_add_file_registry_success.rb
index 5d75f0545e7ac..f98742bfab7c8 100644
--- a/ee/db/geo/migrate/20171009162208_add_file_registry_success.rb
+++ b/ee/db/geo/migrate/20171009162208_add_file_registry_success.rb
@@ -1,4 +1,4 @@
-class AddFileRegistrySuccess < ActiveRecord::Migration
+class AddFileRegistrySuccess < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20171009162209_add_file_registry_success_index.rb b/ee/db/geo/migrate/20171009162209_add_file_registry_success_index.rb
index f7ab941029971..690ef58dda054 100644
--- a/ee/db/geo/migrate/20171009162209_add_file_registry_success_index.rb
+++ b/ee/db/geo/migrate/20171009162209_add_file_registry_success_index.rb
@@ -1,4 +1,4 @@
-class AddFileRegistrySuccessIndex < ActiveRecord::Migration
+class AddFileRegistrySuccessIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20171101105200_add_retry_count_fields_to_registries.rb b/ee/db/geo/migrate/20171101105200_add_retry_count_fields_to_registries.rb
index f4319c2b92ffd..9d9bfad4ffafe 100644
--- a/ee/db/geo/migrate/20171101105200_add_retry_count_fields_to_registries.rb
+++ b/ee/db/geo/migrate/20171101105200_add_retry_count_fields_to_registries.rb
@@ -1,4 +1,4 @@
-class AddRetryCountFieldsToRegistries < ActiveRecord::Migration
+class AddRetryCountFieldsToRegistries < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20171115143841_add_last_sync_failure_to_project_registry.rb b/ee/db/geo/migrate/20171115143841_add_last_sync_failure_to_project_registry.rb
index 31461b1260ddc..099224a21d984 100644
--- a/ee/db/geo/migrate/20171115143841_add_last_sync_failure_to_project_registry.rb
+++ b/ee/db/geo/migrate/20171115143841_add_last_sync_failure_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddLastSyncFailureToProjectRegistry < ActiveRecord::Migration
+class AddLastSyncFailureToProjectRegistry < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/geo/migrate/20180201154345_add_repository_verification_to_project_registry.rb b/ee/db/geo/migrate/20180201154345_add_repository_verification_to_project_registry.rb
index 74ada827ef0a1..62908baeb9b65 100644
--- a/ee/db/geo/migrate/20180201154345_add_repository_verification_to_project_registry.rb
+++ b/ee/db/geo/migrate/20180201154345_add_repository_verification_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddRepositoryVerificationToProjectRegistry < ActiveRecord::Migration
+class AddRepositoryVerificationToProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/geo/migrate/20180314175612_add_partial_index_to_project_registy_verification_failure_columns.rb b/ee/db/geo/migrate/20180314175612_add_partial_index_to_project_registy_verification_failure_columns.rb
index 12dfcfcbe3ebc..53b9558df05dd 100644
--- a/ee/db/geo/migrate/20180314175612_add_partial_index_to_project_registy_verification_failure_columns.rb
+++ b/ee/db/geo/migrate/20180314175612_add_partial_index_to_project_registy_verification_failure_columns.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectRegistyVerificationFailureColumns < ActiveRecord::Migration
+class AddPartialIndexToProjectRegistyVerificationFailureColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180315222132_add_partial_index_to_project_registy_checksum_columns.rb b/ee/db/geo/migrate/20180315222132_add_partial_index_to_project_registy_checksum_columns.rb
index 1cc303dd6c6ad..d9a8adda99c23 100644
--- a/ee/db/geo/migrate/20180315222132_add_partial_index_to_project_registy_checksum_columns.rb
+++ b/ee/db/geo/migrate/20180315222132_add_partial_index_to_project_registy_checksum_columns.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectRegistyChecksumColumns < ActiveRecord::Migration
+class AddPartialIndexToProjectRegistyChecksumColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180321144947_change_repository_verification_checksum_to_sha.rb b/ee/db/geo/migrate/20180321144947_change_repository_verification_checksum_to_sha.rb
index 02c333a837f58..c509a9c6099c3 100644
--- a/ee/db/geo/migrate/20180321144947_change_repository_verification_checksum_to_sha.rb
+++ b/ee/db/geo/migrate/20180321144947_change_repository_verification_checksum_to_sha.rb
@@ -1,4 +1,4 @@
-class ChangeRepositoryVerificationChecksumToSha < ActiveRecord::Migration
+class ChangeRepositoryVerificationChecksumToSha < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb b/ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb
index 55498ffe3219f..39d0c45078201 100644
--- a/ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb
+++ b/ee/db/geo/migrate/20180322062741_migrate_ci_job_artifacts_to_separate_registry.rb
@@ -1,4 +1,4 @@
-class MigrateCiJobArtifactsToSeparateRegistry < ActiveRecord::Migration
+class MigrateCiJobArtifactsToSeparateRegistry < ActiveRecord::Migration[4.2]
   def up
     tracking_db.create_table :job_artifact_registry, force: :cascade do |t|
       t.datetime_with_timezone "created_at"
diff --git a/ee/db/geo/migrate/20180323182105_add_missing_on_primary_to_file_registry.rb b/ee/db/geo/migrate/20180323182105_add_missing_on_primary_to_file_registry.rb
index e1ffa7c22364e..e341c473897b4 100644
--- a/ee/db/geo/migrate/20180323182105_add_missing_on_primary_to_file_registry.rb
+++ b/ee/db/geo/migrate/20180323182105_add_missing_on_primary_to_file_registry.rb
@@ -1,4 +1,4 @@
-class AddMissingOnPrimaryToFileRegistry < ActiveRecord::Migration
+class AddMissingOnPrimaryToFileRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180327071612_add_partial_index_to_project_registy_checksum_sha_columns.rb b/ee/db/geo/migrate/20180327071612_add_partial_index_to_project_registy_checksum_sha_columns.rb
index d32d86964c3ed..e5eede6dffc74 100644
--- a/ee/db/geo/migrate/20180327071612_add_partial_index_to_project_registy_checksum_sha_columns.rb
+++ b/ee/db/geo/migrate/20180327071612_add_partial_index_to_project_registy_checksum_sha_columns.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectRegistyChecksumShaColumns < ActiveRecord::Migration
+class AddPartialIndexToProjectRegistyChecksumShaColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180402170913_add_missing_on_primary_to_job_artifact_registry..rb b/ee/db/geo/migrate/20180402170913_add_missing_on_primary_to_job_artifact_registry..rb
index a390851172597..057437d0dbf43 100644
--- a/ee/db/geo/migrate/20180402170913_add_missing_on_primary_to_job_artifact_registry..rb
+++ b/ee/db/geo/migrate/20180402170913_add_missing_on_primary_to_job_artifact_registry..rb
@@ -1,4 +1,4 @@
-class AddMissingOnPrimaryToJobArtifactRegistry < ActiveRecord::Migration
+class AddMissingOnPrimaryToJobArtifactRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb b/ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb
index 0ea49707a9ca7..5f625adf7df6e 100644
--- a/ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb
+++ b/ee/db/geo/migrate/20180405074130_add_partial_index_project_repository_verification.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexProjectRepositoryVerification < ActiveRecord::Migration
+class AddPartialIndexProjectRepositoryVerification < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180412213305_add_index_to_artifact_id_on_job_artifact_registry.rb b/ee/db/geo/migrate/20180412213305_add_index_to_artifact_id_on_job_artifact_registry.rb
index e6335990b9265..e42a57a6db9ee 100644
--- a/ee/db/geo/migrate/20180412213305_add_index_to_artifact_id_on_job_artifact_registry.rb
+++ b/ee/db/geo/migrate/20180412213305_add_index_to_artifact_id_on_job_artifact_registry.rb
@@ -1,4 +1,4 @@
-class AddIndexToArtifactIdOnJobArtifactRegistry < ActiveRecord::Migration
+class AddIndexToArtifactIdOnJobArtifactRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180419174834_add_checksum_mismatch_fields_to_project_registry.rb b/ee/db/geo/migrate/20180419174834_add_checksum_mismatch_fields_to_project_registry.rb
index 8bc4e0b6a80b3..1dfb43589aade 100644
--- a/ee/db/geo/migrate/20180419174834_add_checksum_mismatch_fields_to_project_registry.rb
+++ b/ee/db/geo/migrate/20180419174834_add_checksum_mismatch_fields_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddChecksumMismatchFieldsToProjectRegistry < ActiveRecord::Migration
+class AddChecksumMismatchFieldsToProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180419192603_add_indexes_to_checksum_mismatch_fields_on_project_registry.rb b/ee/db/geo/migrate/20180419192603_add_indexes_to_checksum_mismatch_fields_on_project_registry.rb
index 9a5bc91b33de6..8e068bc164eed 100644
--- a/ee/db/geo/migrate/20180419192603_add_indexes_to_checksum_mismatch_fields_on_project_registry.rb
+++ b/ee/db/geo/migrate/20180419192603_add_indexes_to_checksum_mismatch_fields_on_project_registry.rb
@@ -1,4 +1,4 @@
-class AddIndexesToChecksumMismatchFieldsOnProjectRegistry < ActiveRecord::Migration
+class AddIndexesToChecksumMismatchFieldsOnProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180427114641_add_repository_check_to_geo_project_registry.rb b/ee/db/geo/migrate/20180427114641_add_repository_check_to_geo_project_registry.rb
index b243f873ce927..d510d930b271b 100644
--- a/ee/db/geo/migrate/20180427114641_add_repository_check_to_geo_project_registry.rb
+++ b/ee/db/geo/migrate/20180427114641_add_repository_check_to_geo_project_registry.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddRepositoryCheckToGeoProjectRegistry < ActiveRecord::Migration
+class AddRepositoryCheckToGeoProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180510223634_set_resync_flag_for_retried_projects.rb b/ee/db/geo/migrate/20180510223634_set_resync_flag_for_retried_projects.rb
index a9b64ec760656..2e588bdae3af7 100644
--- a/ee/db/geo/migrate/20180510223634_set_resync_flag_for_retried_projects.rb
+++ b/ee/db/geo/migrate/20180510223634_set_resync_flag_for_retried_projects.rb
@@ -1,4 +1,4 @@
-class SetResyncFlagForRetriedProjects < ActiveRecord::Migration
+class SetResyncFlagForRetriedProjects < ActiveRecord::Migration[4.2]
   def up
     execute <<-SQL
       UPDATE project_registry SET resync_repository = 't' WHERE repository_retry_count > 0 AND resync_repository = 'f';
diff --git a/ee/db/geo/migrate/20180613184349_add_resync_was_scheduled_at_to_project_registry.rb b/ee/db/geo/migrate/20180613184349_add_resync_was_scheduled_at_to_project_registry.rb
index 2584460e413d8..6d072593548a1 100644
--- a/ee/db/geo/migrate/20180613184349_add_resync_was_scheduled_at_to_project_registry.rb
+++ b/ee/db/geo/migrate/20180613184349_add_resync_was_scheduled_at_to_project_registry.rb
@@ -1,4 +1,4 @@
-class AddResyncWasScheduledAtToProjectRegistry < ActiveRecord::Migration
+class AddResyncWasScheduledAtToProjectRegistry < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180727221937_add_missing_on_primary_to_project_registry.rb b/ee/db/geo/migrate/20180727221937_add_missing_on_primary_to_project_registry.rb
index b89c9dd82ce99..2fc7c0bd35b36 100644
--- a/ee/db/geo/migrate/20180727221937_add_missing_on_primary_to_project_registry.rb
+++ b/ee/db/geo/migrate/20180727221937_add_missing_on_primary_to_project_registry.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddMissingOnPrimaryToProjectRegistry < ActiveRecord::Migration
+class AddMissingOnPrimaryToProjectRegistry < ActiveRecord::Migration[4.2]
   def change
     add_column :project_registry, :repository_missing_on_primary, :boolean
     add_column :project_registry, :wiki_missing_on_primary, :boolean
diff --git a/ee/db/geo/migrate/20180802215313_add_retry_verification_fields_to_project_registry.rb b/ee/db/geo/migrate/20180802215313_add_retry_verification_fields_to_project_registry.rb
index b69ac326cc37c..f0b11aa40a3e3 100644
--- a/ee/db/geo/migrate/20180802215313_add_retry_verification_fields_to_project_registry.rb
+++ b/ee/db/geo/migrate/20180802215313_add_retry_verification_fields_to_project_registry.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddRetryVerificationFieldsToProjectRegistry < ActiveRecord::Migration
+class AddRetryVerificationFieldsToProjectRegistry < ActiveRecord::Migration[4.2]
   def change
     add_column :project_registry, :repository_verification_retry_count, :integer
     add_column :project_registry, :wiki_verification_retry_count, :integer
diff --git a/ee/db/geo/migrate/20180803160048_add_synced_repositories_partial_index.rb b/ee/db/geo/migrate/20180803160048_add_synced_repositories_partial_index.rb
index 6dfe15de79cb1..34d26734550ff 100644
--- a/ee/db/geo/migrate/20180803160048_add_synced_repositories_partial_index.rb
+++ b/ee/db/geo/migrate/20180803160048_add_synced_repositories_partial_index.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddSyncedRepositoriesPartialIndex < ActiveRecord::Migration
+class AddSyncedRepositoriesPartialIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180806011909_add_failed_synchronizations_partial_index.rb b/ee/db/geo/migrate/20180806011909_add_failed_synchronizations_partial_index.rb
index 03e252d1d3d1b..82bde8bd0d0c7 100644
--- a/ee/db/geo/migrate/20180806011909_add_failed_synchronizations_partial_index.rb
+++ b/ee/db/geo/migrate/20180806011909_add_failed_synchronizations_partial_index.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddFailedSynchronizationsPartialIndex < ActiveRecord::Migration
+class AddFailedSynchronizationsPartialIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/migrate/20180806020615_add_pending_synchronizations_partial_index.rb b/ee/db/geo/migrate/20180806020615_add_pending_synchronizations_partial_index.rb
index d013a3d95b6cb..08c331a9460d0 100644
--- a/ee/db/geo/migrate/20180806020615_add_pending_synchronizations_partial_index.rb
+++ b/ee/db/geo/migrate/20180806020615_add_pending_synchronizations_partial_index.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddPendingSynchronizationsPartialIndex < ActiveRecord::Migration
+class AddPendingSynchronizationsPartialIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/geo/post_migrate/20180320011914_remove_last_verification_failed_columns_from_geo_project_registry.rb b/ee/db/geo/post_migrate/20180320011914_remove_last_verification_failed_columns_from_geo_project_registry.rb
index b4fbf00c3114b..a05925076e892 100644
--- a/ee/db/geo/post_migrate/20180320011914_remove_last_verification_failed_columns_from_geo_project_registry.rb
+++ b/ee/db/geo/post_migrate/20180320011914_remove_last_verification_failed_columns_from_geo_project_registry.rb
@@ -1,4 +1,4 @@
-class RemoveLastVerificationFailedColumnsFromGeoProjectRegistry < ActiveRecord::Migration
+class RemoveLastVerificationFailedColumnsFromGeoProjectRegistry < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/geo/post_migrate/20180320013929_remove_last_verification_at_columns_from_geo_project_registry.rb b/ee/db/geo/post_migrate/20180320013929_remove_last_verification_at_columns_from_geo_project_registry.rb
index d28864a7db543..18e3a34f86b5d 100644
--- a/ee/db/geo/post_migrate/20180320013929_remove_last_verification_at_columns_from_geo_project_registry.rb
+++ b/ee/db/geo/post_migrate/20180320013929_remove_last_verification_at_columns_from_geo_project_registry.rb
@@ -1,4 +1,4 @@
-class RemoveLastVerificationAtColumnsFromGeoProjectRegistry < ActiveRecord::Migration
+class RemoveLastVerificationAtColumnsFromGeoProjectRegistry < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/geo/post_migrate/20180326171626_remove_old_repository_verification_checksum_from_geo_project_registry.rb b/ee/db/geo/post_migrate/20180326171626_remove_old_repository_verification_checksum_from_geo_project_registry.rb
index 76f34129355c9..cb28daff59a0a 100644
--- a/ee/db/geo/post_migrate/20180326171626_remove_old_repository_verification_checksum_from_geo_project_registry.rb
+++ b/ee/db/geo/post_migrate/20180326171626_remove_old_repository_verification_checksum_from_geo_project_registry.rb
@@ -1,4 +1,4 @@
-class RemoveOldRepositoryVerificationChecksumFromGeoProjectRegistry < ActiveRecord::Migration
+class RemoveOldRepositoryVerificationChecksumFromGeoProjectRegistry < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/geo/post_migrate/20180331055706_delete_job_artifacts_from_file_registry.rb b/ee/db/geo/post_migrate/20180331055706_delete_job_artifacts_from_file_registry.rb
index 6c571fc18ad97..300408a7afd51 100644
--- a/ee/db/geo/post_migrate/20180331055706_delete_job_artifacts_from_file_registry.rb
+++ b/ee/db/geo/post_migrate/20180331055706_delete_job_artifacts_from_file_registry.rb
@@ -1,4 +1,4 @@
-class DeleteJobArtifactsFromFileRegistry < ActiveRecord::Migration
+class DeleteJobArtifactsFromFileRegistry < ActiveRecord::Migration[4.2]
   def up
     execute("DELETE FROM file_registry WHERE file_type = 'job_artifact'")
     execute('DROP TRIGGER IF EXISTS replicate_job_artifact_registry ON file_registry')
diff --git a/ee/db/migrate/20140319135450_init_ee_schema.rb b/ee/db/migrate/20140319135450_init_ee_schema.rb
index 464f2f0131979..a759c8b7dbadc 100644
--- a/ee/db/migrate/20140319135450_init_ee_schema.rb
+++ b/ee/db/migrate/20140319135450_init_ee_schema.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class InitEESchema < ActiveRecord::Migration
+class InitEESchema < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20140414093351_create_appearances.rb b/ee/db/migrate/20140414093351_create_appearances.rb
index 4c3fde9b6e39f..2a66943a57eaa 100644
--- a/ee/db/migrate/20140414093351_create_appearances.rb
+++ b/ee/db/migrate/20140414093351_create_appearances.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateAppearances < ActiveRecord::Migration
+class CreateAppearances < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20140508105809_add_mr_template_to_project.rb b/ee/db/migrate/20140508105809_add_mr_template_to_project.rb
index c16e488a61d12..e11ba80f75ad3 100644
--- a/ee/db/migrate/20140508105809_add_mr_template_to_project.rb
+++ b/ee/db/migrate/20140508105809_add_mr_template_to_project.rb
@@ -1,4 +1,4 @@
-class AddMrTemplateToProject < ActiveRecord::Migration
+class AddMrTemplateToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :merge_requests_template, :text
   end
diff --git a/ee/db/migrate/20140513095908_add_username_password_api_version_to_services.rb b/ee/db/migrate/20140513095908_add_username_password_api_version_to_services.rb
index 407c930525327..8e63fb35a5843 100644
--- a/ee/db/migrate/20140513095908_add_username_password_api_version_to_services.rb
+++ b/ee/db/migrate/20140513095908_add_username_password_api_version_to_services.rb
@@ -1,4 +1,4 @@
-class AddUsernamePasswordApiVersionToServices < ActiveRecord::Migration
+class AddUsernamePasswordApiVersionToServices < ActiveRecord::Migration[4.2]
   def change
     add_column :services, :username, :string
     add_column :services, :password, :string
diff --git a/ee/db/migrate/20140811083829_add_unsubscribed_at_field_to_users.rb b/ee/db/migrate/20140811083829_add_unsubscribed_at_field_to_users.rb
index 1e2efcbbf1e45..8938a0dc765d0 100644
--- a/ee/db/migrate/20140811083829_add_unsubscribed_at_field_to_users.rb
+++ b/ee/db/migrate/20140811083829_add_unsubscribed_at_field_to_users.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddUnsubscribedAtFieldToUsers < ActiveRecord::Migration
+class AddUnsubscribedAtFieldToUsers < ActiveRecord::Migration[4.2]
   def change
     add_column :users, :admin_email_unsubscribed_at, :datetime
   end
diff --git a/ee/db/migrate/20140811155127_add_jira_issue_transition_id_to_services.rb b/ee/db/migrate/20140811155127_add_jira_issue_transition_id_to_services.rb
index 7d16156bb5029..9c06dbdbd8773 100644
--- a/ee/db/migrate/20140811155127_add_jira_issue_transition_id_to_services.rb
+++ b/ee/db/migrate/20140811155127_add_jira_issue_transition_id_to_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddJiraIssueTransitionIdToServices < ActiveRecord::Migration
+class AddJiraIssueTransitionIdToServices < ActiveRecord::Migration[4.2]
   def up
     add_column :services, :jira_issue_transition_id, :string, default: '2'
     Service.reset_column_information
diff --git a/ee/db/migrate/20140813090117_add_ldap_groups_table.rb b/ee/db/migrate/20140813090117_add_ldap_groups_table.rb
index 8cffca4d4ce5e..60d319e4ed94a 100644
--- a/ee/db/migrate/20140813090117_add_ldap_groups_table.rb
+++ b/ee/db/migrate/20140813090117_add_ldap_groups_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class AddLdapGroupsTable < ActiveRecord::Migration
+class AddLdapGroupsTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb b/ee/db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
index d3e940a96df4c..a9cf2c241d770 100644
--- a/ee/db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
+++ b/ee/db/migrate/20140813133925_rename_ldap_group_to_ldap_group_link.rb
@@ -1,4 +1,4 @@
-class RenameLdapGroupToLdapGroupLink < ActiveRecord::Migration
+class RenameLdapGroupToLdapGroupLink < ActiveRecord::Migration[4.2]
   def up
     rename_table :ldap_groups, :ldap_group_links
 
diff --git a/ee/db/migrate/20140907223153_remove_columns_for_services.rb b/ee/db/migrate/20140907223153_remove_columns_for_services.rb
index c8dc67c01b070..0e964dbd5fb43 100644
--- a/ee/db/migrate/20140907223153_remove_columns_for_services.rb
+++ b/ee/db/migrate/20140907223153_remove_columns_for_services.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveColumnsForServices < ActiveRecord::Migration
+class RemoveColumnsForServices < ActiveRecord::Migration[4.2]
   def change
     remove_column :services, :username, :string
     remove_column :services, :password, :string
diff --git a/ee/db/migrate/20141010132608_add_provider_to_ldap_group_links.rb b/ee/db/migrate/20141010132608_add_provider_to_ldap_group_links.rb
index 2858d97cb6354..eb1234a5af194 100644
--- a/ee/db/migrate/20141010132608_add_provider_to_ldap_group_links.rb
+++ b/ee/db/migrate/20141010132608_add_provider_to_ldap_group_links.rb
@@ -1,4 +1,4 @@
-class AddProviderToLdapGroupLinks < ActiveRecord::Migration
+class AddProviderToLdapGroupLinks < ActiveRecord::Migration[4.2]
   def change
     add_column :ldap_group_links, :provider, :string
   end
diff --git a/ee/db/migrate/20141027173526_add_author_email_regex_to_git_hook.rb b/ee/db/migrate/20141027173526_add_author_email_regex_to_git_hook.rb
index bf58a13e81fc5..8960369a1bc58 100644
--- a/ee/db/migrate/20141027173526_add_author_email_regex_to_git_hook.rb
+++ b/ee/db/migrate/20141027173526_add_author_email_regex_to_git_hook.rb
@@ -1,4 +1,4 @@
-class AddAuthorEmailRegexToGitHook < ActiveRecord::Migration
+class AddAuthorEmailRegexToGitHook < ActiveRecord::Migration[4.2]
   def change
     add_column :git_hooks, :author_email_regex, :string
   end
diff --git a/ee/db/migrate/20141030133853_add_member_check_to_git_hooks.rb b/ee/db/migrate/20141030133853_add_member_check_to_git_hooks.rb
index 078df69d3dae3..8b4a2636da34e 100644
--- a/ee/db/migrate/20141030133853_add_member_check_to_git_hooks.rb
+++ b/ee/db/migrate/20141030133853_add_member_check_to_git_hooks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMemberCheckToGitHooks < ActiveRecord::Migration
+class AddMemberCheckToGitHooks < ActiveRecord::Migration[4.2]
   def change
     add_column :git_hooks, :member_check, :boolean, default: false, null: false
   end
diff --git a/ee/db/migrate/20141103160516_add_file_name_regex_to_git_hooks.rb b/ee/db/migrate/20141103160516_add_file_name_regex_to_git_hooks.rb
index ce0e1dedd16e5..6ad63269b9a5d 100644
--- a/ee/db/migrate/20141103160516_add_file_name_regex_to_git_hooks.rb
+++ b/ee/db/migrate/20141103160516_add_file_name_regex_to_git_hooks.rb
@@ -1,4 +1,4 @@
-class AddFileNameRegexToGitHooks < ActiveRecord::Migration
+class AddFileNameRegexToGitHooks < ActiveRecord::Migration[4.2]
   def change
     add_column :git_hooks, :file_name_regex, :string
   end
diff --git a/ee/db/migrate/20141212124604_add_group_membership_lock.rb b/ee/db/migrate/20141212124604_add_group_membership_lock.rb
index 8cd0d8d039318..e8d20ead047b3 100644
--- a/ee/db/migrate/20141212124604_add_group_membership_lock.rb
+++ b/ee/db/migrate/20141212124604_add_group_membership_lock.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddGroupMembershipLock < ActiveRecord::Migration
+class AddGroupMembershipLock < ActiveRecord::Migration[4.2]
   def change
     add_column :namespaces, :membership_lock, :boolean, default: false
   end
diff --git a/ee/db/migrate/20141213212220_add_header_logos_to_appearances.rb b/ee/db/migrate/20141213212220_add_header_logos_to_appearances.rb
index 9f3b78772711e..bce84468c2d00 100644
--- a/ee/db/migrate/20141213212220_add_header_logos_to_appearances.rb
+++ b/ee/db/migrate/20141213212220_add_header_logos_to_appearances.rb
@@ -1,4 +1,4 @@
-class AddHeaderLogosToAppearances < ActiveRecord::Migration
+class AddHeaderLogosToAppearances < ActiveRecord::Migration[4.2]
   def change
     add_column :appearances, :dark_logo, :string
     add_column :appearances, :light_logo, :string
diff --git a/ee/db/migrate/20141230100055_remove_old_fields_from_namespace.rb b/ee/db/migrate/20141230100055_remove_old_fields_from_namespace.rb
index 43fafe1b6ab92..ff3ae582f54f7 100644
--- a/ee/db/migrate/20141230100055_remove_old_fields_from_namespace.rb
+++ b/ee/db/migrate/20141230100055_remove_old_fields_from_namespace.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveOldFieldsFromNamespace < ActiveRecord::Migration
+class RemoveOldFieldsFromNamespace < ActiveRecord::Migration[4.2]
   def up
     remove_column :namespaces, :ldap_cn
     remove_column :namespaces, :ldap_access
diff --git a/ee/db/migrate/20150125163158_add_rebase_setting_to_projects.rb b/ee/db/migrate/20150125163158_add_rebase_setting_to_projects.rb
index d53e2b6a24d3f..6ccb9897365c0 100644
--- a/ee/db/migrate/20150125163158_add_rebase_setting_to_projects.rb
+++ b/ee/db/migrate/20150125163158_add_rebase_setting_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddRebaseSettingToProjects < ActiveRecord::Migration
+class AddRebaseSettingToProjects < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :merge_requests_rebase_default, :boolean, default: true
   end
diff --git a/ee/db/migrate/20150225214822_help_text_to_application_settings.rb b/ee/db/migrate/20150225214822_help_text_to_application_settings.rb
index 8594758a48ce2..19fdd02a6851f 100644
--- a/ee/db/migrate/20150225214822_help_text_to_application_settings.rb
+++ b/ee/db/migrate/20150225214822_help_text_to_application_settings.rb
@@ -1,4 +1,4 @@
-class HelpTextToApplicationSettings < ActiveRecord::Migration
+class HelpTextToApplicationSettings < ActiveRecord::Migration[4.2]
   def change
     add_column :application_settings, :help_text, :text
   end
diff --git a/ee/db/migrate/20150312000132_add_group_id_to_web_hooks.rb b/ee/db/migrate/20150312000132_add_group_id_to_web_hooks.rb
index 460f110c1b0cb..4f5557a83a774 100644
--- a/ee/db/migrate/20150312000132_add_group_id_to_web_hooks.rb
+++ b/ee/db/migrate/20150312000132_add_group_id_to_web_hooks.rb
@@ -1,4 +1,4 @@
-class AddGroupIdToWebHooks < ActiveRecord::Migration
+class AddGroupIdToWebHooks < ActiveRecord::Migration[4.2]
   def change
     add_column :web_hooks, :group_id, :integer, after: :project_id
   end
diff --git a/ee/db/migrate/20150324223425_add_is_sample_to_git_hooks.rb b/ee/db/migrate/20150324223425_add_is_sample_to_git_hooks.rb
index 0a88836e7f663..9cfc49eb4747e 100644
--- a/ee/db/migrate/20150324223425_add_is_sample_to_git_hooks.rb
+++ b/ee/db/migrate/20150324223425_add_is_sample_to_git_hooks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddIsSampleToGitHooks < ActiveRecord::Migration
+class AddIsSampleToGitHooks < ActiveRecord::Migration[4.2]
   def change
     add_column :git_hooks, :is_sample, :boolean, default: false
   end
diff --git a/ee/db/migrate/20150501095306_create_licenses.rb b/ee/db/migrate/20150501095306_create_licenses.rb
index 54cf6868b5082..29be6dbee099d 100644
--- a/ee/db/migrate/20150501095306_create_licenses.rb
+++ b/ee/db/migrate/20150501095306_create_licenses.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateLicenses < ActiveRecord::Migration
+class CreateLicenses < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20150507194350_create_historical_data.rb b/ee/db/migrate/20150507194350_create_historical_data.rb
index dfb1ef0fe518a..21a87c4e434ac 100644
--- a/ee/db/migrate/20150507194350_create_historical_data.rb
+++ b/ee/db/migrate/20150507194350_create_historical_data.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateHistoricalData < ActiveRecord::Migration
+class CreateHistoricalData < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20150605131047_add_max_file_size_to_git_hooks.rb b/ee/db/migrate/20150605131047_add_max_file_size_to_git_hooks.rb
index 49572fa2d144a..d48b7fd14f8ab 100644
--- a/ee/db/migrate/20150605131047_add_max_file_size_to_git_hooks.rb
+++ b/ee/db/migrate/20150605131047_add_max_file_size_to_git_hooks.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMaxFileSizeToGitHooks < ActiveRecord::Migration
+class AddMaxFileSizeToGitHooks < ActiveRecord::Migration[4.2]
   def change
     add_column :git_hooks, :max_file_size, :integer, default: 0
   end
diff --git a/ee/db/migrate/20150609113337_create_approves.rb b/ee/db/migrate/20150609113337_create_approves.rb
index c08bd68931189..90ff73340339f 100644
--- a/ee/db/migrate/20150609113337_create_approves.rb
+++ b/ee/db/migrate/20150609113337_create_approves.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateApproves < ActiveRecord::Migration
+class CreateApproves < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20150609125332_add_project_merge_approves.rb b/ee/db/migrate/20150609125332_add_project_merge_approves.rb
index 240de4afb5650..fdcd7aa0507dd 100644
--- a/ee/db/migrate/20150609125332_add_project_merge_approves.rb
+++ b/ee/db/migrate/20150609125332_add_project_merge_approves.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddProjectMergeApproves < ActiveRecord::Migration
+class AddProjectMergeApproves < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :approvals_before_merge, :integer, null: false, default: 0
   end
diff --git a/ee/db/migrate/20150707222220_add_approvers_table.rb b/ee/db/migrate/20150707222220_add_approvers_table.rb
index dead69ec0f478..4f8e4412c4540 100644
--- a/ee/db/migrate/20150707222220_add_approvers_table.rb
+++ b/ee/db/migrate/20150707222220_add_approvers_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class AddApproversTable < ActiveRecord::Migration
+class AddApproversTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20150709134649_add_reset_approvers_to_project.rb b/ee/db/migrate/20150709134649_add_reset_approvers_to_project.rb
index f9a760777a929..56c7010dfebfa 100644
--- a/ee/db/migrate/20150709134649_add_reset_approvers_to_project.rb
+++ b/ee/db/migrate/20150709134649_add_reset_approvers_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddResetApproversToProject < ActiveRecord::Migration
+class AddResetApproversToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :reset_approvers_on_push, :boolean, default: true
   end
diff --git a/ee/db/migrate/20150717155058_rename_reset_approvers.rb b/ee/db/migrate/20150717155058_rename_reset_approvers.rb
index cf7e74b659f42..f0b6fb1b8cf97 100644
--- a/ee/db/migrate/20150717155058_rename_reset_approvers.rb
+++ b/ee/db/migrate/20150717155058_rename_reset_approvers.rb
@@ -1,4 +1,4 @@
-class RenameResetApprovers < ActiveRecord::Migration
+class RenameResetApprovers < ActiveRecord::Migration[4.2]
   def change
     rename_column :projects, :reset_approvers_on_push, :reset_approvals_on_push
   end
diff --git a/ee/db/migrate/20150731200022_remove_invalid_approvers.rb b/ee/db/migrate/20150731200022_remove_invalid_approvers.rb
index e9d547d14f212..e7eba837f7333 100644
--- a/ee/db/migrate/20150731200022_remove_invalid_approvers.rb
+++ b/ee/db/migrate/20150731200022_remove_invalid_approvers.rb
@@ -1,4 +1,4 @@
-class RemoveInvalidApprovers < ActiveRecord::Migration
+class RemoveInvalidApprovers < ActiveRecord::Migration[4.2]
   def up
     execute("DELETE FROM approvers WHERE user_id = 0")
   end
diff --git a/ee/db/migrate/20150827144737_migrate_rebase_feature.rb b/ee/db/migrate/20150827144737_migrate_rebase_feature.rb
index 5c5ded0651db5..4306aac3366fb 100644
--- a/ee/db/migrate/20150827144737_migrate_rebase_feature.rb
+++ b/ee/db/migrate/20150827144737_migrate_rebase_feature.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class MigrateRebaseFeature < ActiveRecord::Migration
+class MigrateRebaseFeature < ActiveRecord::Migration[4.2]
   def up
     execute %q{UPDATE projects SET merge_requests_ff_only_enabled = TRUE WHERE merge_requests_rebase_enabled IS TRUE}
 
diff --git a/ee/db/migrate/20150929160851_add_issues_template_to_project.rb b/ee/db/migrate/20150929160851_add_issues_template_to_project.rb
index 1caf6531c2eb1..be68b4e6ef6a0 100644
--- a/ee/db/migrate/20150929160851_add_issues_template_to_project.rb
+++ b/ee/db/migrate/20150929160851_add_issues_template_to_project.rb
@@ -1,4 +1,4 @@
-class AddIssuesTemplateToProject < ActiveRecord::Migration
+class AddIssuesTemplateToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :issues_template, :text
   end
diff --git a/ee/db/migrate/20151007110107_update_group_links.rb b/ee/db/migrate/20151007110107_update_group_links.rb
index 5e5eb95a4f121..0dfcf221a4178 100644
--- a/ee/db/migrate/20151007110107_update_group_links.rb
+++ b/ee/db/migrate/20151007110107_update_group_links.rb
@@ -1,4 +1,4 @@
-class UpdateGroupLinks < ActiveRecord::Migration
+class UpdateGroupLinks < ActiveRecord::Migration[4.2]
   def change
     provider = quote_string(Gitlab::Auth::LDAP::Config.providers.first)
     execute("UPDATE ldap_group_links SET provider = '#{provider}' WHERE provider IS NULL")
diff --git a/ee/db/migrate/20151110125416_add_mirror_to_project.rb b/ee/db/migrate/20151110125416_add_mirror_to_project.rb
index a71e8db710894..169875bd0446f 100644
--- a/ee/db/migrate/20151110125416_add_mirror_to_project.rb
+++ b/ee/db/migrate/20151110125416_add_mirror_to_project.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMirrorToProject < ActiveRecord::Migration
+class AddMirrorToProject < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :mirror, :boolean, default: false, null: false
     add_column :projects, :mirror_last_update_at, :datetime
diff --git a/ee/db/migrate/20151113115819_canonicalize_kerberos_identities.rb b/ee/db/migrate/20151113115819_canonicalize_kerberos_identities.rb
index 3fddb53c0f8c6..22c260f632e54 100644
--- a/ee/db/migrate/20151113115819_canonicalize_kerberos_identities.rb
+++ b/ee/db/migrate/20151113115819_canonicalize_kerberos_identities.rb
@@ -1,4 +1,4 @@
-class CanonicalizeKerberosIdentities < ActiveRecord::Migration
+class CanonicalizeKerberosIdentities < ActiveRecord::Migration[4.2]
   # This migration can be performed online without errors.
   # It makes sure that all Kerberos identities are in canonical form
   # with a realm name (`username` => `username@DEFAULT.REALM`).
diff --git a/ee/db/migrate/20151208110020_add_note_to_users.rb b/ee/db/migrate/20151208110020_add_note_to_users.rb
index 92c4563bfce19..194a0cd024647 100644
--- a/ee/db/migrate/20151208110020_add_note_to_users.rb
+++ b/ee/db/migrate/20151208110020_add_note_to_users.rb
@@ -1,4 +1,4 @@
-class AddNoteToUsers < ActiveRecord::Migration
+class AddNoteToUsers < ActiveRecord::Migration[4.2]
   def up
     # Column "note" has been added to schema mistakenly (without actual migration),
     # and this is why it can exist in some instances.
diff --git a/ee/db/migrate/20151209222208_add_weight_to_issue.rb b/ee/db/migrate/20151209222208_add_weight_to_issue.rb
index 69e15e7261a03..ebc02a8e9a98f 100644
--- a/ee/db/migrate/20151209222208_add_weight_to_issue.rb
+++ b/ee/db/migrate/20151209222208_add_weight_to_issue.rb
@@ -1,4 +1,4 @@
-class AddWeightToIssue < ActiveRecord::Migration
+class AddWeightToIssue < ActiveRecord::Migration[4.2]
   def change
     add_column :issues, :weight, :integer
   end
diff --git a/ee/db/migrate/20151215005729_rename_jenkins_service.rb b/ee/db/migrate/20151215005729_rename_jenkins_service.rb
index 5349c176774d2..452fd406aa3bd 100644
--- a/ee/db/migrate/20151215005729_rename_jenkins_service.rb
+++ b/ee/db/migrate/20151215005729_rename_jenkins_service.rb
@@ -1,4 +1,4 @@
-class RenameJenkinsService < ActiveRecord::Migration
+class RenameJenkinsService < ActiveRecord::Migration[4.2]
   def up
     execute "UPDATE services SET type = 'JenkinsDeprecatedService' WHERE type = 'JenkinsService';"
   end
diff --git a/ee/db/migrate/20151228203337_change_max_file_size_to_not_null_on_git_hooks.rb b/ee/db/migrate/20151228203337_change_max_file_size_to_not_null_on_git_hooks.rb
index 4fc12038c7785..6544de0959f48 100644
--- a/ee/db/migrate/20151228203337_change_max_file_size_to_not_null_on_git_hooks.rb
+++ b/ee/db/migrate/20151228203337_change_max_file_size_to_not_null_on_git_hooks.rb
@@ -1,4 +1,4 @@
-class ChangeMaxFileSizeToNotNullOnGitHooks < ActiveRecord::Migration
+class ChangeMaxFileSizeToNotNullOnGitHooks < ActiveRecord::Migration[4.2]
   def change
     change_column_null :git_hooks, :max_file_size, false, 0
   end
diff --git a/ee/db/migrate/20160112174440_create_geo_nodes.rb b/ee/db/migrate/20160112174440_create_geo_nodes.rb
index 70f0ded00b3a3..82cd5a9812973 100644
--- a/ee/db/migrate/20160112174440_create_geo_nodes.rb
+++ b/ee/db/migrate/20160112174440_create_geo_nodes.rb
@@ -1,4 +1,4 @@
-class CreateGeoNodes < ActiveRecord::Migration
+class CreateGeoNodes < ActiveRecord::Migration[4.2]
   def change
     create_table :geo_nodes do |t|
       t.string :schema
diff --git a/ee/db/migrate/20160119170055_add_mirror_trigger_builds_to_projects.rb b/ee/db/migrate/20160119170055_add_mirror_trigger_builds_to_projects.rb
index c3ea0130a5aff..c1c2d02780b9d 100644
--- a/ee/db/migrate/20160119170055_add_mirror_trigger_builds_to_projects.rb
+++ b/ee/db/migrate/20160119170055_add_mirror_trigger_builds_to_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddMirrorTriggerBuildsToProjects < ActiveRecord::Migration
+class AddMirrorTriggerBuildsToProjects < ActiveRecord::Migration[4.2]
   def change
     add_column :projects, :mirror_trigger_builds, :boolean, default: false, null: false
   end
diff --git a/ee/db/migrate/20160129075828_create_index_statuses.rb b/ee/db/migrate/20160129075828_create_index_statuses.rb
index e66b4fbd7aa70..00d9509d299e9 100644
--- a/ee/db/migrate/20160129075828_create_index_statuses.rb
+++ b/ee/db/migrate/20160129075828_create_index_statuses.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateIndexStatuses < ActiveRecord::Migration
+class CreateIndexStatuses < ActiveRecord::Migration[4.2]
   def change
     create_table :index_statuses do |t|
       t.integer :project_id, null: false
diff --git a/ee/db/migrate/20160204190809_update_jenkins_service_category.rb b/ee/db/migrate/20160204190809_update_jenkins_service_category.rb
index f1b0f2ee6d8d2..b5e3ca640b31c 100644
--- a/ee/db/migrate/20160204190809_update_jenkins_service_category.rb
+++ b/ee/db/migrate/20160204190809_update_jenkins_service_category.rb
@@ -1,4 +1,4 @@
-class UpdateJenkinsServiceCategory < ActiveRecord::Migration
+class UpdateJenkinsServiceCategory < ActiveRecord::Migration[4.2]
   def up
     category = quote_column_name('category')
     type = quote_column_name('type')
diff --git a/ee/db/migrate/20160221013512_add_geo_node_key_to_geo_node.rb b/ee/db/migrate/20160221013512_add_geo_node_key_to_geo_node.rb
index df35739b50237..8f06127356056 100644
--- a/ee/db/migrate/20160221013512_add_geo_node_key_to_geo_node.rb
+++ b/ee/db/migrate/20160221013512_add_geo_node_key_to_geo_node.rb
@@ -1,4 +1,4 @@
-class AddGeoNodeKeyToGeoNode < ActiveRecord::Migration
+class AddGeoNodeKeyToGeoNode < ActiveRecord::Migration[4.2]
   def change
     change_table :geo_nodes do |t|
       t.belongs_to :geo_node_key, index: true
diff --git a/ee/db/migrate/20160229034258_add_doorkeeper_application_to_geo_node.rb b/ee/db/migrate/20160229034258_add_doorkeeper_application_to_geo_node.rb
index 7f0a89c58a472..a1830f20c0389 100644
--- a/ee/db/migrate/20160229034258_add_doorkeeper_application_to_geo_node.rb
+++ b/ee/db/migrate/20160229034258_add_doorkeeper_application_to_geo_node.rb
@@ -1,4 +1,4 @@
-class AddDoorkeeperApplicationToGeoNode < ActiveRecord::Migration
+class AddDoorkeeperApplicationToGeoNode < ActiveRecord::Migration[4.2]
   def change
     change_table :geo_nodes do |t|
       t.belongs_to :oauth_application
diff --git a/ee/db/migrate/20160302141317_rename_header_field_on_appearrance.rb b/ee/db/migrate/20160302141317_rename_header_field_on_appearrance.rb
index fdcf1e9ad9560..268fb181c1406 100644
--- a/ee/db/migrate/20160302141317_rename_header_field_on_appearrance.rb
+++ b/ee/db/migrate/20160302141317_rename_header_field_on_appearrance.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RenameHeaderFieldOnAppearrance < ActiveRecord::Migration
+class RenameHeaderFieldOnAppearrance < ActiveRecord::Migration[4.2]
   def up
     unless column_exists?(:appearances, :header_logo)
       rename_column :appearances, :light_logo, :header_logo
diff --git a/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb b/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb
index 92aa7f043e33f..89a78a926d181 100644
--- a/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb
+++ b/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb
@@ -1,4 +1,4 @@
-class AddSecondaryExternUidToIdentities < ActiveRecord::Migration
+class AddSecondaryExternUidToIdentities < ActiveRecord::Migration[4.2]
   def change
     add_column :identities, :secondary_extern_uid, :string
   end
diff --git a/ee/db/migrate/20160316124047_git_hooks_project_id_index.rb b/ee/db/migrate/20160316124047_git_hooks_project_id_index.rb
index f5d78e4194202..20d5b8a7cc859 100644
--- a/ee/db/migrate/20160316124047_git_hooks_project_id_index.rb
+++ b/ee/db/migrate/20160316124047_git_hooks_project_id_index.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class GitHooksProjectIdIndex < ActiveRecord::Migration
+class GitHooksProjectIdIndex < ActiveRecord::Migration[4.2]
   disable_ddl_transaction!
 
   def change
diff --git a/ee/db/migrate/20160317191509_add_last_sync_time_to_groups.rb b/ee/db/migrate/20160317191509_add_last_sync_time_to_groups.rb
index 47976852b7445..613200c62fc43 100644
--- a/ee/db/migrate/20160317191509_add_last_sync_time_to_groups.rb
+++ b/ee/db/migrate/20160317191509_add_last_sync_time_to_groups.rb
@@ -1,5 +1,5 @@
 # rubocop:disable all
-class AddLastSyncTimeToGroups < ActiveRecord::Migration
+class AddLastSyncTimeToGroups < ActiveRecord::Migration[4.2]
   def change
     add_column :namespaces, :last_ldap_sync_at, :datetime
     add_index :namespaces, :last_ldap_sync_at
diff --git a/ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb b/ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb
index 8b4efddc25831..5351706177cac 100644
--- a/ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb
+++ b/ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateRemoteMirrorsEE < ActiveRecord::Migration
+class CreateRemoteMirrorsEE < ActiveRecord::Migration[4.2]
   def up
     # When moving from CE to EE, remote_mirrors may already exist
     return if table_exists?(:remote_mirrors)
diff --git a/ee/db/migrate/20160414064845_add_system_hook_to_geo_node.rb b/ee/db/migrate/20160414064845_add_system_hook_to_geo_node.rb
index 974d9d4672746..90a17f1e09ac4 100644
--- a/ee/db/migrate/20160414064845_add_system_hook_to_geo_node.rb
+++ b/ee/db/migrate/20160414064845_add_system_hook_to_geo_node.rb
@@ -1,4 +1,4 @@
-class AddSystemHookToGeoNode < ActiveRecord::Migration
+class AddSystemHookToGeoNode < ActiveRecord::Migration[4.2]
   def change
     change_table :geo_nodes do |t|
       t.references :system_hook
diff --git a/ee/db/migrate/20160530214349_make_remote_mirrors_disabled_by_default_ee.rb b/ee/db/migrate/20160530214349_make_remote_mirrors_disabled_by_default_ee.rb
index 5aa96ecd6c793..f9bfb8b3b90d4 100644
--- a/ee/db/migrate/20160530214349_make_remote_mirrors_disabled_by_default_ee.rb
+++ b/ee/db/migrate/20160530214349_make_remote_mirrors_disabled_by_default_ee.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MakeRemoteMirrorsDisabledByDefaultEE < ActiveRecord::Migration
+class MakeRemoteMirrorsDisabledByDefaultEE < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/ee/db/migrate/20160601102211_create_path_locks_table.rb b/ee/db/migrate/20160601102211_create_path_locks_table.rb
index 444ab883bb7a4..4b453c7e752d8 100644
--- a/ee/db/migrate/20160601102211_create_path_locks_table.rb
+++ b/ee/db/migrate/20160601102211_create_path_locks_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreatePathLocksTable < ActiveRecord::Migration
+class CreatePathLocksTable < ActiveRecord::Migration[4.2]
   def change
     create_table :path_locks do |t|
       t.string :path, null: false, index: true
diff --git a/ee/db/migrate/20160611101122_add_es_to_application_settings.rb b/ee/db/migrate/20160611101122_add_es_to_application_settings.rb
index c8971fefbfa95..c02a43a694087 100644
--- a/ee/db/migrate/20160611101122_add_es_to_application_settings.rb
+++ b/ee/db/migrate/20160611101122_add_es_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddEsToApplicationSettings < ActiveRecord::Migration
+class AddEsToApplicationSettings < ActiveRecord::Migration[4.2]
   def up
     add_column :application_settings, :elasticsearch_indexing, :boolean, default: false, null: false
     add_column :application_settings, :elasticsearch_search, :boolean, default: false, null: false
diff --git a/ee/db/migrate/20160615092001_disable_mirror_without_import_url.rb b/ee/db/migrate/20160615092001_disable_mirror_without_import_url.rb
index 502c167a60413..aed19527ed8c3 100644
--- a/ee/db/migrate/20160615092001_disable_mirror_without_import_url.rb
+++ b/ee/db/migrate/20160615092001_disable_mirror_without_import_url.rb
@@ -1,7 +1,7 @@
 # RemoveWrongImportUrlFromProjects migration missed setting the mirror flag to false when making import_url nil
 # for invalid URIs that why we need this migration.
 
-class DisableMirrorWithoutImportUrl < ActiveRecord::Migration
+class DisableMirrorWithoutImportUrl < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def up
diff --git a/ee/db/migrate/20160615142732_add_approvals_before_merge_to_merge_requests.rb b/ee/db/migrate/20160615142732_add_approvals_before_merge_to_merge_requests.rb
index 1c3ce7f34523a..6fdcd834bca55 100644
--- a/ee/db/migrate/20160615142732_add_approvals_before_merge_to_merge_requests.rb
+++ b/ee/db/migrate/20160615142732_add_approvals_before_merge_to_merge_requests.rb
@@ -1,4 +1,4 @@
-class AddApprovalsBeforeMergeToMergeRequests < ActiveRecord::Migration
+class AddApprovalsBeforeMergeToMergeRequests < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   def change
diff --git a/ee/db/migrate/20160705111606_rename_git_hooks_to_push_rules.rb b/ee/db/migrate/20160705111606_rename_git_hooks_to_push_rules.rb
index 1fe898b2d6821..21229f0820040 100644
--- a/ee/db/migrate/20160705111606_rename_git_hooks_to_push_rules.rb
+++ b/ee/db/migrate/20160705111606_rename_git_hooks_to_push_rules.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RenameGitHooksToPushRules < ActiveRecord::Migration
+class RenameGitHooksToPushRules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # When using the methods "add_concurrent_index" or "add_column_with_default"
diff --git a/ee/db/migrate/20160718210912_add_ldap_sync_state_to_groups.rb b/ee/db/migrate/20160718210912_add_ldap_sync_state_to_groups.rb
index 080e580b8b8bd..28c468f7d9606 100644
--- a/ee/db/migrate/20160718210912_add_ldap_sync_state_to_groups.rb
+++ b/ee/db/migrate/20160718210912_add_ldap_sync_state_to_groups.rb
@@ -1,7 +1,7 @@
 # Migration type: online without errors (works on previous version and new one)
 # rubocop:disable Migration/Datetime
 # rubocop:disable Migration/UpdateLargeTable
-class AddLdapSyncStateToGroups < ActiveRecord::Migration
+class AddLdapSyncStateToGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/ee/db/migrate/20160718210939_add_ldap_sync_state_indices_to_groups.rb b/ee/db/migrate/20160718210939_add_ldap_sync_state_indices_to_groups.rb
index 84bf35d7eee81..6bd90746585dd 100644
--- a/ee/db/migrate/20160718210939_add_ldap_sync_state_indices_to_groups.rb
+++ b/ee/db/migrate/20160718210939_add_ldap_sync_state_indices_to_groups.rb
@@ -1,7 +1,7 @@
 # Migration type: online without errors (works on previous version and new one)
 
 # rubocop:disable RemoveIndex
-class AddLdapSyncStateIndicesToGroups < ActiveRecord::Migration
+class AddLdapSyncStateIndicesToGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/ee/db/migrate/20160718211006_remove_last_ldap_sync_status_index_from_groups.rb b/ee/db/migrate/20160718211006_remove_last_ldap_sync_status_index_from_groups.rb
index d8a8dfe5d6f09..91e513a62bcf8 100644
--- a/ee/db/migrate/20160718211006_remove_last_ldap_sync_status_index_from_groups.rb
+++ b/ee/db/migrate/20160718211006_remove_last_ldap_sync_status_index_from_groups.rb
@@ -1,7 +1,7 @@
 # Migration type: online without errors (works on previous version and new one)
 
 # rubocop:disable RemoveIndex
-class RemoveLastLdapSyncStatusIndexFromGroups < ActiveRecord::Migration
+class RemoveLastLdapSyncStatusIndexFromGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/ee/db/migrate/20160718211059_remove_last_ldap_sync_status_from_groups.rb b/ee/db/migrate/20160718211059_remove_last_ldap_sync_status_from_groups.rb
index 091799f9df3cd..a6fc0e3143889 100644
--- a/ee/db/migrate/20160718211059_remove_last_ldap_sync_status_from_groups.rb
+++ b/ee/db/migrate/20160718211059_remove_last_ldap_sync_status_from_groups.rb
@@ -1,7 +1,7 @@
 # Migration type: online without errors (works on previous version and new one)
 # rubocop:disable Migration/Datetime
 # rubocop:disable Migration/RemoveColumn
-class RemoveLastLdapSyncStatusFromGroups < ActiveRecord::Migration
+class RemoveLastLdapSyncStatusFromGroups < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20160721042141_add_column_user_id_to_protected_branches_access_levels.rb b/ee/db/migrate/20160721042141_add_column_user_id_to_protected_branches_access_levels.rb
index fc9a0f770b646..dccee09102db6 100644
--- a/ee/db/migrate/20160721042141_add_column_user_id_to_protected_branches_access_levels.rb
+++ b/ee/db/migrate/20160721042141_add_column_user_id_to_protected_branches_access_levels.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddColumnUserIdToProtectedBranchesAccessLevels < ActiveRecord::Migration
+class AddColumnUserIdToProtectedBranchesAccessLevels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/ee/db/migrate/20160721043623_allow_nulls_for_protected_branch_access_levels.rb b/ee/db/migrate/20160721043623_allow_nulls_for_protected_branch_access_levels.rb
index 64cbe1cc27187..048b1c04f1189 100644
--- a/ee/db/migrate/20160721043623_allow_nulls_for_protected_branch_access_levels.rb
+++ b/ee/db/migrate/20160721043623_allow_nulls_for_protected_branch_access_levels.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AllowNullsForProtectedBranchAccessLevels < ActiveRecord::Migration
+class AllowNullsForProtectedBranchAccessLevels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20160810153405_remove_geo_node_key_id_index.rb b/ee/db/migrate/20160810153405_remove_geo_node_key_id_index.rb
index 7fee1cdeb20f5..08aa454231e37 100644
--- a/ee/db/migrate/20160810153405_remove_geo_node_key_id_index.rb
+++ b/ee/db/migrate/20160810153405_remove_geo_node_key_id_index.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable RemoveIndex
-class RemoveGeoNodeKeyIdIndex < ActiveRecord::Migration
+class RemoveGeoNodeKeyIdIndex < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20160812054342_add_group_id_columns_to_protected_branch_access_levels.rb b/ee/db/migrate/20160812054342_add_group_id_columns_to_protected_branch_access_levels.rb
index 733eb36545bc5..12a5aae146b63 100644
--- a/ee/db/migrate/20160812054342_add_group_id_columns_to_protected_branch_access_levels.rb
+++ b/ee/db/migrate/20160812054342_add_group_id_columns_to_protected_branch_access_levels.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddGroupIdColumnsToProtectedBranchAccessLevels < ActiveRecord::Migration
+class AddGroupIdColumnsToProtectedBranchAccessLevels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/ee/db/migrate/20160829104026_add_repository_size_limit_to_application_settings.rb b/ee/db/migrate/20160829104026_add_repository_size_limit_to_application_settings.rb
index f934281cc9bf2..079a38f49c365 100644
--- a/ee/db/migrate/20160829104026_add_repository_size_limit_to_application_settings.rb
+++ b/ee/db/migrate/20160829104026_add_repository_size_limit_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddRepositorySizeLimitToApplicationSettings < ActiveRecord::Migration
+class AddRepositorySizeLimitToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20160831231325_update_mirror_when_empty_import_url_in_projects.rb b/ee/db/migrate/20160831231325_update_mirror_when_empty_import_url_in_projects.rb
index 1f0eb9cb0af42..1521aa4a73b8e 100644
--- a/ee/db/migrate/20160831231325_update_mirror_when_empty_import_url_in_projects.rb
+++ b/ee/db/migrate/20160831231325_update_mirror_when_empty_import_url_in_projects.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/UpdateColumnInBatches
 # rubocop:disable Migration/UpdateLargeTable
-class UpdateMirrorWhenEmptyImportUrlInProjects < ActiveRecord::Migration
+class UpdateMirrorWhenEmptyImportUrlInProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20160906143504_add_ldap_attributes_to_member.rb b/ee/db/migrate/20160906143504_add_ldap_attributes_to_member.rb
index 111903f3e9172..6af338f0301a4 100644
--- a/ee/db/migrate/20160906143504_add_ldap_attributes_to_member.rb
+++ b/ee/db/migrate/20160906143504_add_ldap_attributes_to_member.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddLdapAttributesToMember < ActiveRecord::Migration
+class AddLdapAttributesToMember < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/ee/db/migrate/20160913172608_add_repository_size_limit_to_projects.rb b/ee/db/migrate/20160913172608_add_repository_size_limit_to_projects.rb
index 636f3b661182b..cb51109018f29 100644
--- a/ee/db/migrate/20160913172608_add_repository_size_limit_to_projects.rb
+++ b/ee/db/migrate/20160913172608_add_repository_size_limit_to_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddRepositorySizeLimitToProjects < ActiveRecord::Migration
+class AddRepositorySizeLimitToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20160913172737_add_repository_size_limit_to_namespaces.rb b/ee/db/migrate/20160913172737_add_repository_size_limit_to_namespaces.rb
index 23955d8ab121a..eb59cbd7d194f 100644
--- a/ee/db/migrate/20160913172737_add_repository_size_limit_to_namespaces.rb
+++ b/ee/db/migrate/20160913172737_add_repository_size_limit_to_namespaces.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddRepositorySizeLimitToNamespaces < ActiveRecord::Migration
+class AddRepositorySizeLimitToNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20160915201649_add_prevent_secrets_to_push_rules.rb b/ee/db/migrate/20160915201649_add_prevent_secrets_to_push_rules.rb
index de347bbeb71af..7cb3053f352a4 100644
--- a/ee/db/migrate/20160915201649_add_prevent_secrets_to_push_rules.rb
+++ b/ee/db/migrate/20160915201649_add_prevent_secrets_to_push_rules.rb
@@ -1,4 +1,4 @@
-class AddPreventSecretsToPushRules < ActiveRecord::Migration
+class AddPreventSecretsToPushRules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20160916101334_add_approver_groups.rb b/ee/db/migrate/20160916101334_add_approver_groups.rb
index 87342ad88c924..4bccdd46db156 100644
--- a/ee/db/migrate/20160916101334_add_approver_groups.rb
+++ b/ee/db/migrate/20160916101334_add_approver_groups.rb
@@ -2,7 +2,7 @@
 # for more information on how to write migrations for GitLab.
 
 # rubocop:disable Migration/Timestamps
-class AddApproverGroups < ActiveRecord::Migration
+class AddApproverGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/ee/db/migrate/20161005144359_add_name_to_boards.rb b/ee/db/migrate/20161005144359_add_name_to_boards.rb
index 9b46b96df733c..3d22329573617 100644
--- a/ee/db/migrate/20161005144359_add_name_to_boards.rb
+++ b/ee/db/migrate/20161005144359_add_name_to_boards.rb
@@ -1,4 +1,4 @@
-class AddNameToBoards < ActiveRecord::Migration
+class AddNameToBoards < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20161021185735_migrate_ee_sidekiq_queues_from_default.rb b/ee/db/migrate/20161021185735_migrate_ee_sidekiq_queues_from_default.rb
index e04762268e698..b0e797685363a 100644
--- a/ee/db/migrate/20161021185735_migrate_ee_sidekiq_queues_from_default.rb
+++ b/ee/db/migrate/20161021185735_migrate_ee_sidekiq_queues_from_default.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MigrateEESidekiqQueuesFromDefault < ActiveRecord::Migration
+class MigrateEESidekiqQueuesFromDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/ee/db/migrate/20161030005533_add_estimate_to_issuables.rb b/ee/db/migrate/20161030005533_add_estimate_to_issuables.rb
index 9d5a0956f101e..96861ef5cd3c2 100644
--- a/ee/db/migrate/20161030005533_add_estimate_to_issuables.rb
+++ b/ee/db/migrate/20161030005533_add_estimate_to_issuables.rb
@@ -1,4 +1,4 @@
-class AddEstimateToIssuables < ActiveRecord::Migration
+class AddEstimateToIssuables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20161030020610_create_timelogs.rb b/ee/db/migrate/20161030020610_create_timelogs.rb
index dc94e4747978b..18a48f524cb4c 100644
--- a/ee/db/migrate/20161030020610_create_timelogs.rb
+++ b/ee/db/migrate/20161030020610_create_timelogs.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateTimelogs < ActiveRecord::Migration
+class CreateTimelogs < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20161230123835_add_squash_to_merge_requests_ee.rb b/ee/db/migrate/20161230123835_add_squash_to_merge_requests_ee.rb
index d8caa8ef2e11c..89708d6f51964 100644
--- a/ee/db/migrate/20161230123835_add_squash_to_merge_requests_ee.rb
+++ b/ee/db/migrate/20161230123835_add_squash_to_merge_requests_ee.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddSquashToMergeRequestsEE < ActiveRecord::Migration
+class AddSquashToMergeRequestsEE < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/ee/db/migrate/20170106172234_add_shared_runners_minutes_to_application_settings.rb b/ee/db/migrate/20170106172234_add_shared_runners_minutes_to_application_settings.rb
index 7d14f3a5ff7de..50b400362cb9b 100644
--- a/ee/db/migrate/20170106172234_add_shared_runners_minutes_to_application_settings.rb
+++ b/ee/db/migrate/20170106172234_add_shared_runners_minutes_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddSharedRunnersMinutesToApplicationSettings < ActiveRecord::Migration
+class AddSharedRunnersMinutesToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170106172235_add_shared_runners_minutes_limit_to_namespace.rb b/ee/db/migrate/20170106172235_add_shared_runners_minutes_limit_to_namespace.rb
index 0a00a0221354a..1b10ab6c6280e 100644
--- a/ee/db/migrate/20170106172235_add_shared_runners_minutes_limit_to_namespace.rb
+++ b/ee/db/migrate/20170106172235_add_shared_runners_minutes_limit_to_namespace.rb
@@ -1,4 +1,4 @@
-class AddSharedRunnersMinutesLimitToNamespace < ActiveRecord::Migration
+class AddSharedRunnersMinutesLimitToNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170106172236_create_table_namespace_statistics.rb b/ee/db/migrate/20170106172236_create_table_namespace_statistics.rb
index 870fe3a28eae1..65fb2635cc969 100644
--- a/ee/db/migrate/20170106172236_create_table_namespace_statistics.rb
+++ b/ee/db/migrate/20170106172236_create_table_namespace_statistics.rb
@@ -1,4 +1,4 @@
-class CreateTableNamespaceStatistics < ActiveRecord::Migration
+class CreateTableNamespaceStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170106172237_add_shared_runners_seconds_to_project_statistics.rb b/ee/db/migrate/20170106172237_add_shared_runners_seconds_to_project_statistics.rb
index 6fe1565dd3cc0..c41a9af2082c2 100644
--- a/ee/db/migrate/20170106172237_add_shared_runners_seconds_to_project_statistics.rb
+++ b/ee/db/migrate/20170106172237_add_shared_runners_seconds_to_project_statistics.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddSharedRunnersSecondsToProjectStatistics < ActiveRecord::Migration
+class AddSharedRunnersSecondsToProjectStatistics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170118194941_convert_application_settings_repository_size_limit_to_bytes.rb b/ee/db/migrate/20170118194941_convert_application_settings_repository_size_limit_to_bytes.rb
index 11abb20f50d0a..6003c3eb48a2e 100644
--- a/ee/db/migrate/20170118194941_convert_application_settings_repository_size_limit_to_bytes.rb
+++ b/ee/db/migrate/20170118194941_convert_application_settings_repository_size_limit_to_bytes.rb
@@ -1,6 +1,6 @@
 # rubocop:disable Migration/RemoveColumn
 # rubocop:disable Migration/UpdateColumnInBatches
-class ConvertApplicationSettingsRepositorySizeLimitToBytes < ActiveRecord::Migration
+class ConvertApplicationSettingsRepositorySizeLimitToBytes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170118200338_convert_projects_repository_size_limit_to_bytes.rb b/ee/db/migrate/20170118200338_convert_projects_repository_size_limit_to_bytes.rb
index e309222650930..1890e93b3b299 100644
--- a/ee/db/migrate/20170118200338_convert_projects_repository_size_limit_to_bytes.rb
+++ b/ee/db/migrate/20170118200338_convert_projects_repository_size_limit_to_bytes.rb
@@ -1,7 +1,7 @@
 # rubocop:disable Migration/UpdateColumnInBatches
 # rubocop:disable Migration/UpdateLargeTable
 # rubocop:disable Migration/RemoveColumn
-class ConvertProjectsRepositorySizeLimitToBytes < ActiveRecord::Migration
+class ConvertProjectsRepositorySizeLimitToBytes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170118200412_convert_namespaces_repository_size_limit_to_bytes.rb b/ee/db/migrate/20170118200412_convert_namespaces_repository_size_limit_to_bytes.rb
index 65199ec14c72b..377ae2fe12273 100644
--- a/ee/db/migrate/20170118200412_convert_namespaces_repository_size_limit_to_bytes.rb
+++ b/ee/db/migrate/20170118200412_convert_namespaces_repository_size_limit_to_bytes.rb
@@ -1,7 +1,7 @@
 # rubocop:disable Migration/RemoveColumn
 # rubocop:disable Migration/UpdateColumnInBatches
 # rubocop:disable Migration/UpdateLargeTable
-class ConvertNamespacesRepositorySizeLimitToBytes < ActiveRecord::Migration
+class ConvertNamespacesRepositorySizeLimitToBytes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170120123345_add_column_auditor_to_users.rb b/ee/db/migrate/20170120123345_add_column_auditor_to_users.rb
index 0a99054666f1c..0ca201196b25b 100644
--- a/ee/db/migrate/20170120123345_add_column_auditor_to_users.rb
+++ b/ee/db/migrate/20170120123345_add_column_auditor_to_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 # rubocop:disable Migration/UpdateLargeTable
-class AddColumnAuditorToUsers < ActiveRecord::Migration
+class AddColumnAuditorToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170130113559_add_sync_schedule_to_projects_and_remote_projects.rb b/ee/db/migrate/20170130113559_add_sync_schedule_to_projects_and_remote_projects.rb
index a980910f17b19..dbe7718c4a873 100644
--- a/ee/db/migrate/20170130113559_add_sync_schedule_to_projects_and_remote_projects.rb
+++ b/ee/db/migrate/20170130113559_add_sync_schedule_to_projects_and_remote_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/UpdateLargeTable
-class AddSyncScheduleToProjectsAndRemoteProjects < ActiveRecord::Migration
+class AddSyncScheduleToProjectsAndRemoteProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170202114129_add_milestone_id_to_boards.rb b/ee/db/migrate/20170202114129_add_milestone_id_to_boards.rb
index 977d953de65cf..2687fc632a40b 100644
--- a/ee/db/migrate/20170202114129_add_milestone_id_to_boards.rb
+++ b/ee/db/migrate/20170202114129_add_milestone_id_to_boards.rb
@@ -1,4 +1,4 @@
-class AddMilestoneIdToBoards < ActiveRecord::Migration
+class AddMilestoneIdToBoards < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170207150212_add_indexes_to_mirrors.rb b/ee/db/migrate/20170207150212_add_indexes_to_mirrors.rb
index de6cfc70fd29c..d70d75c3382ab 100644
--- a/ee/db/migrate/20170207150212_add_indexes_to_mirrors.rb
+++ b/ee/db/migrate/20170207150212_add_indexes_to_mirrors.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexesToMirrors < ActiveRecord::Migration
+class AddIndexesToMirrors < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb b/ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb
index 22e4dceafe101..6e65a814c40af 100644
--- a/ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb
+++ b/ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToMirrorsLastUpdateAtFields < ActiveRecord::Migration
+class AddIndexToMirrorsLastUpdateAtFields < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170210144005_add_global_minimum_mirror_sync_time_to_application_settings.rb b/ee/db/migrate/20170210144005_add_global_minimum_mirror_sync_time_to_application_settings.rb
index 3b700ddb58af8..18c44c678ea76 100644
--- a/ee/db/migrate/20170210144005_add_global_minimum_mirror_sync_time_to_application_settings.rb
+++ b/ee/db/migrate/20170210144005_add_global_minimum_mirror_sync_time_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddGlobalMinimumMirrorSyncTimeToApplicationSettings < ActiveRecord::Migration
+class AddGlobalMinimumMirrorSyncTimeToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170215151539_add_aws_elasticsearch.rb b/ee/db/migrate/20170215151539_add_aws_elasticsearch.rb
index 623e6625f1d44..9d31a4f2d24ba 100644
--- a/ee/db/migrate/20170215151539_add_aws_elasticsearch.rb
+++ b/ee/db/migrate/20170215151539_add_aws_elasticsearch.rb
@@ -1,4 +1,4 @@
-class AddAwsElasticsearch < ActiveRecord::Migration
+class AddAwsElasticsearch < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170215151540_migrate_old_elasticsearch_settings.rb b/ee/db/migrate/20170215151540_migrate_old_elasticsearch_settings.rb
index 668af1fa066a7..c65bd3674fab6 100644
--- a/ee/db/migrate/20170215151540_migrate_old_elasticsearch_settings.rb
+++ b/ee/db/migrate/20170215151540_migrate_old_elasticsearch_settings.rb
@@ -1,4 +1,4 @@
-class MigrateOldElasticsearchSettings < ActiveRecord::Migration
+class MigrateOldElasticsearchSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::ArelMethods
   include Gitlab::Database::MigrationHelpers
 
diff --git a/ee/db/migrate/20170215151541_remove_old_elasticsearch_settings.rb b/ee/db/migrate/20170215151541_remove_old_elasticsearch_settings.rb
index 34fbd4b8bbbd1..915097f5969c7 100644
--- a/ee/db/migrate/20170215151541_remove_old_elasticsearch_settings.rb
+++ b/ee/db/migrate/20170215151541_remove_old_elasticsearch_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveOldElasticsearchSettings < ActiveRecord::Migration
+class RemoveOldElasticsearchSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = true
diff --git a/ee/db/migrate/20170216000450_add_enabled_to_geo_nodes.rb b/ee/db/migrate/20170216000450_add_enabled_to_geo_nodes.rb
index b898081bd36ce..f4f0f5499eaee 100644
--- a/ee/db/migrate/20170216000450_add_enabled_to_geo_nodes.rb
+++ b/ee/db/migrate/20170216000450_add_enabled_to_geo_nodes.rb
@@ -1,4 +1,4 @@
-class AddEnabledToGeoNodes < ActiveRecord::Migration
+class AddEnabledToGeoNodes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170224075132_add_access_keys_to_geo_nodes.rb b/ee/db/migrate/20170224075132_add_access_keys_to_geo_nodes.rb
index 0ce4264cdff78..0686364865963 100644
--- a/ee/db/migrate/20170224075132_add_access_keys_to_geo_nodes.rb
+++ b/ee/db/migrate/20170224075132_add_access_keys_to_geo_nodes.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddAccessKeysToGeoNodes < ActiveRecord::Migration
+class AddAccessKeysToGeoNodes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170306180725_add_index_to_milestone_id_on_boards.rb b/ee/db/migrate/20170306180725_add_index_to_milestone_id_on_boards.rb
index 30715355d2b6a..a52403173f2d9 100644
--- a/ee/db/migrate/20170306180725_add_index_to_milestone_id_on_boards.rb
+++ b/ee/db/migrate/20170306180725_add_index_to_milestone_id_on_boards.rb
@@ -1,5 +1,5 @@
 # rubocop:disable RemoveIndex
-class AddIndexToMilestoneIdOnBoards < ActiveRecord::Migration
+class AddIndexToMilestoneIdOnBoards < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170308015651_add_geo_status_timout_to_application_settings.rb b/ee/db/migrate/20170308015651_add_geo_status_timout_to_application_settings.rb
index 18edfacfc2003..ca35080cb5f43 100644
--- a/ee/db/migrate/20170308015651_add_geo_status_timout_to_application_settings.rb
+++ b/ee/db/migrate/20170308015651_add_geo_status_timout_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddGeoStatusTimoutToApplicationSettings < ActiveRecord::Migration
+class AddGeoStatusTimoutToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170403141442_add_elasticsearch_experimental_indexer_to_application_settings.rb b/ee/db/migrate/20170403141442_add_elasticsearch_experimental_indexer_to_application_settings.rb
index fd3020b18ec9a..82fb9d0784e28 100644
--- a/ee/db/migrate/20170403141442_add_elasticsearch_experimental_indexer_to_application_settings.rb
+++ b/ee/db/migrate/20170403141442_add_elasticsearch_experimental_indexer_to_application_settings.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/SaferBooleanColumn
-class AddElasticsearchExperimentalIndexerToApplicationSettings < ActiveRecord::Migration
+class AddElasticsearchExperimentalIndexerToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170404223037_add_service_desk_settings.rb b/ee/db/migrate/20170404223037_add_service_desk_settings.rb
index 48e476fe63d9e..95e56dfdac232 100644
--- a/ee/db/migrate/20170404223037_add_service_desk_settings.rb
+++ b/ee/db/migrate/20170404223037_add_service_desk_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddServiceDeskSettings < ActiveRecord::Migration
+class AddServiceDeskSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170419065104_notes_metadata_remove_approvals_value.rb b/ee/db/migrate/20170419065104_notes_metadata_remove_approvals_value.rb
index 05164216d64ba..bc48ebc4c55f4 100644
--- a/ee/db/migrate/20170419065104_notes_metadata_remove_approvals_value.rb
+++ b/ee/db/migrate/20170419065104_notes_metadata_remove_approvals_value.rb
@@ -1,4 +1,4 @@
-class NotesMetadataRemoveApprovalsValue < ActiveRecord::Migration
+class NotesMetadataRemoveApprovalsValue < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170420200123_remove_service_desk_mail_key_from_projects.rb b/ee/db/migrate/20170420200123_remove_service_desk_mail_key_from_projects.rb
index 0074ab3dd7543..ca06223e9072b 100644
--- a/ee/db/migrate/20170420200123_remove_service_desk_mail_key_from_projects.rb
+++ b/ee/db/migrate/20170420200123_remove_service_desk_mail_key_from_projects.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class RemoveServiceDeskMailKeyFromProjects < ActiveRecord::Migration
+class RemoveServiceDeskMailKeyFromProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170421113144_add_index_to_approvals_merge_request_id.rb b/ee/db/migrate/20170421113144_add_index_to_approvals_merge_request_id.rb
index ed600782f8681..86657fc723759 100644
--- a/ee/db/migrate/20170421113144_add_index_to_approvals_merge_request_id.rb
+++ b/ee/db/migrate/20170421113144_add_index_to_approvals_merge_request_id.rb
@@ -1,4 +1,4 @@
-class AddIndexToApprovalsMergeRequestId < ActiveRecord::Migration
+class AddIndexToApprovalsMergeRequestId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170427180205_add_last_update_started_at_column_to_remote_mirrors.rb b/ee/db/migrate/20170427180205_add_last_update_started_at_column_to_remote_mirrors.rb
index 897330e02bb2e..b59867c5d3b62 100644
--- a/ee/db/migrate/20170427180205_add_last_update_started_at_column_to_remote_mirrors.rb
+++ b/ee/db/migrate/20170427180205_add_last_update_started_at_column_to_remote_mirrors.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Datetime
-class AddLastUpdateStartedAtColumnToRemoteMirrors < ActiveRecord::Migration
+class AddLastUpdateStartedAtColumnToRemoteMirrors < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170505133904_update_geo_nodes_system_hooks.rb b/ee/db/migrate/20170505133904_update_geo_nodes_system_hooks.rb
index c76812cc33dae..6297257146244 100644
--- a/ee/db/migrate/20170505133904_update_geo_nodes_system_hooks.rb
+++ b/ee/db/migrate/20170505133904_update_geo_nodes_system_hooks.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class UpdateGeoNodesSystemHooks < ActiveRecord::Migration
+class UpdateGeoNodesSystemHooks < ActiveRecord::Migration[4.2]
   # Set this constant to true if this migration requires downtime.
   DOWNTIME = false
 
diff --git a/ee/db/migrate/20170509153720_create_project_mirror_data_ee.rb b/ee/db/migrate/20170509153720_create_project_mirror_data_ee.rb
index dc5521468ba10..63b7228e3f04f 100644
--- a/ee/db/migrate/20170509153720_create_project_mirror_data_ee.rb
+++ b/ee/db/migrate/20170509153720_create_project_mirror_data_ee.rb
@@ -1,4 +1,4 @@
-class CreateProjectMirrorDataEE < ActiveRecord::Migration
+class CreateProjectMirrorDataEE < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170512131952_add_plan_to_namespace.rb b/ee/db/migrate/20170512131952_add_plan_to_namespace.rb
index caf1f758db363..fb8059b7ae6f6 100644
--- a/ee/db/migrate/20170512131952_add_plan_to_namespace.rb
+++ b/ee/db/migrate/20170512131952_add_plan_to_namespace.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPlanToNamespace < ActiveRecord::Migration
+class AddPlanToNamespace < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170512173638_add_check_namespace_plan_to_application_settings.rb b/ee/db/migrate/20170512173638_add_check_namespace_plan_to_application_settings.rb
index b1cfe9571dd1f..14e1777ae51d3 100644
--- a/ee/db/migrate/20170512173638_add_check_namespace_plan_to_application_settings.rb
+++ b/ee/db/migrate/20170512173638_add_check_namespace_plan_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCheckNamespacePlanToApplicationSettings < ActiveRecord::Migration
+class AddCheckNamespacePlanToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
   disable_ddl_transaction!
 
diff --git a/ee/db/migrate/20170513005817_add_push_rule_branch_name.rb b/ee/db/migrate/20170513005817_add_push_rule_branch_name.rb
index 315240954fa5d..f2f767aac7fe6 100644
--- a/ee/db/migrate/20170513005817_add_push_rule_branch_name.rb
+++ b/ee/db/migrate/20170513005817_add_push_rule_branch_name.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPushRuleBranchName < ActiveRecord::Migration
+class AddPushRuleBranchName < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170515093334_add_mirror_settings_to_application_setting.rb b/ee/db/migrate/20170515093334_add_mirror_settings_to_application_setting.rb
index f19388c4c4876..1ce028b419e08 100644
--- a/ee/db/migrate/20170515093334_add_mirror_settings_to_application_setting.rb
+++ b/ee/db/migrate/20170515093334_add_mirror_settings_to_application_setting.rb
@@ -1,4 +1,4 @@
-class AddMirrorSettingsToApplicationSetting < ActiveRecord::Migration
+class AddMirrorSettingsToApplicationSetting < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170517162048_create_issue_links_table.rb b/ee/db/migrate/20170517162048_create_issue_links_table.rb
index 442b87a208d29..711b46779f969 100644
--- a/ee/db/migrate/20170517162048_create_issue_links_table.rb
+++ b/ee/db/migrate/20170517162048_create_issue_links_table.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/Timestamps
-class CreateIssueLinksTable < ActiveRecord::Migration
+class CreateIssueLinksTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170522194603_create_geo_repository_updated_events.rb b/ee/db/migrate/20170522194603_create_geo_repository_updated_events.rb
index 561a8bfe87a3e..9158d9377e6a1 100644
--- a/ee/db/migrate/20170522194603_create_geo_repository_updated_events.rb
+++ b/ee/db/migrate/20170522194603_create_geo_repository_updated_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoRepositoryUpdatedEvents < ActiveRecord::Migration
+class CreateGeoRepositoryUpdatedEvents < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170522201800_create_geo_event_log.rb b/ee/db/migrate/20170522201800_create_geo_event_log.rb
index af16966dd4ae1..372e7d4abb628 100644
--- a/ee/db/migrate/20170522201800_create_geo_event_log.rb
+++ b/ee/db/migrate/20170522201800_create_geo_event_log.rb
@@ -1,4 +1,4 @@
-class CreateGeoEventLog < ActiveRecord::Migration
+class CreateGeoEventLog < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170525174157_create_pipeline_source_pipeline.rb b/ee/db/migrate/20170525174157_create_pipeline_source_pipeline.rb
index 8c00a1526daff..b9b297450d764 100644
--- a/ee/db/migrate/20170525174157_create_pipeline_source_pipeline.rb
+++ b/ee/db/migrate/20170525174157_create_pipeline_source_pipeline.rb
@@ -1,4 +1,4 @@
-class CreatePipelineSourcePipeline < ActiveRecord::Migration
+class CreatePipelineSourcePipeline < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170525174158_add_ci_pipeline_source_pipeline_indexes.rb b/ee/db/migrate/20170525174158_add_ci_pipeline_source_pipeline_indexes.rb
index 5ab23a7016635..ff78cb3305638 100644
--- a/ee/db/migrate/20170525174158_add_ci_pipeline_source_pipeline_indexes.rb
+++ b/ee/db/migrate/20170525174158_add_ci_pipeline_source_pipeline_indexes.rb
@@ -1,4 +1,4 @@
-class AddCiPipelineSourcePipelineIndexes < ActiveRecord::Migration
+class AddCiPipelineSourcePipelineIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170525174159_add_ci_pipeline_source_pipeline_foreign_key.rb b/ee/db/migrate/20170525174159_add_ci_pipeline_source_pipeline_foreign_key.rb
index 068e5b87314e6..649c57325a0c6 100644
--- a/ee/db/migrate/20170525174159_add_ci_pipeline_source_pipeline_foreign_key.rb
+++ b/ee/db/migrate/20170525174159_add_ci_pipeline_source_pipeline_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddCiPipelineSourcePipelineForeignKey < ActiveRecord::Migration
+class AddCiPipelineSourcePipelineForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170602003304_add_clone_url_prefix_to_geo_node.rb b/ee/db/migrate/20170602003304_add_clone_url_prefix_to_geo_node.rb
index fbdb86a0c41b2..54f76b076b017 100644
--- a/ee/db/migrate/20170602003304_add_clone_url_prefix_to_geo_node.rb
+++ b/ee/db/migrate/20170602003304_add_clone_url_prefix_to_geo_node.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCloneUrlPrefixToGeoNode < ActiveRecord::Migration
+class AddCloneUrlPrefixToGeoNode < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170605151307_add_disable_overriding_approvers_per_merge_request_to_project.rb b/ee/db/migrate/20170605151307_add_disable_overriding_approvers_per_merge_request_to_project.rb
index 2442930f7e7c3..363d41fb8e917 100644
--- a/ee/db/migrate/20170605151307_add_disable_overriding_approvers_per_merge_request_to_project.rb
+++ b/ee/db/migrate/20170605151307_add_disable_overriding_approvers_per_merge_request_to_project.rb
@@ -1,4 +1,4 @@
-class AddDisableOverridingApproversPerMergeRequestToProject < ActiveRecord::Migration
+class AddDisableOverridingApproversPerMergeRequestToProject < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170614053336_create_geo_repository_deleted_events.rb b/ee/db/migrate/20170614053336_create_geo_repository_deleted_events.rb
index c0d3db8901856..27cf15cabdaba 100644
--- a/ee/db/migrate/20170614053336_create_geo_repository_deleted_events.rb
+++ b/ee/db/migrate/20170614053336_create_geo_repository_deleted_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoRepositoryDeletedEvents < ActiveRecord::Migration
+class CreateGeoRepositoryDeletedEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170614061551_add_geo_repository_deleted_events_foreign_key.rb b/ee/db/migrate/20170614061551_add_geo_repository_deleted_events_foreign_key.rb
index 9b21c58ecbb31..1d75d15fe621d 100644
--- a/ee/db/migrate/20170614061551_add_geo_repository_deleted_events_foreign_key.rb
+++ b/ee/db/migrate/20170614061551_add_geo_repository_deleted_events_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddGeoRepositoryDeletedEventsForeignKey < ActiveRecord::Migration
+class AddGeoRepositoryDeletedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170620063751_remove_geo_primary_system_hook.rb b/ee/db/migrate/20170620063751_remove_geo_primary_system_hook.rb
index a818d4e8c797e..7413e409bf4fe 100644
--- a/ee/db/migrate/20170620063751_remove_geo_primary_system_hook.rb
+++ b/ee/db/migrate/20170620063751_remove_geo_primary_system_hook.rb
@@ -1,4 +1,4 @@
-class RemoveGeoPrimarySystemHook < ActiveRecord::Migration
+class RemoveGeoPrimarySystemHook < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170620143011_add_slack_integrationtable.rb b/ee/db/migrate/20170620143011_add_slack_integrationtable.rb
index 8b4151e8344c2..b9a6cdbf3f25c 100644
--- a/ee/db/migrate/20170620143011_add_slack_integrationtable.rb
+++ b/ee/db/migrate/20170620143011_add_slack_integrationtable.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddSlackIntegrationtable < ActiveRecord::Migration
+class AddSlackIntegrationtable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170622124246_add_ee_foreign_keys_pointing_to_projects.rb b/ee/db/migrate/20170622124246_add_ee_foreign_keys_pointing_to_projects.rb
index e8d9c35cd63a2..694c317b71cc1 100644
--- a/ee/db/migrate/20170622124246_add_ee_foreign_keys_pointing_to_projects.rb
+++ b/ee/db/migrate/20170622124246_add_ee_foreign_keys_pointing_to_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEEForeignKeysPointingToProjects < ActiveRecord::Migration
+class AddEEForeignKeysPointingToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20170622131529_add_foreign_key_for_approvals.rb b/ee/db/migrate/20170622131529_add_foreign_key_for_approvals.rb
index c1456ce5e5742..45629fe392aef 100644
--- a/ee/db/migrate/20170622131529_add_foreign_key_for_approvals.rb
+++ b/ee/db/migrate/20170622131529_add_foreign_key_for_approvals.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddForeignKeyForApprovals < ActiveRecord::Migration
+class AddForeignKeyForApprovals < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170623195236_create_geo_repository_renamed_events.rb b/ee/db/migrate/20170623195236_create_geo_repository_renamed_events.rb
index eb5de5e90caed..926dc3a5f5daa 100644
--- a/ee/db/migrate/20170623195236_create_geo_repository_renamed_events.rb
+++ b/ee/db/migrate/20170623195236_create_geo_repository_renamed_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoRepositoryRenamedEvents < ActiveRecord::Migration
+class CreateGeoRepositoryRenamedEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170623202610_add_geo_repository_renamed_events_foreign_key.rb b/ee/db/migrate/20170623202610_add_geo_repository_renamed_events_foreign_key.rb
index 8f19ede7b332f..d39906cccde4e 100644
--- a/ee/db/migrate/20170623202610_add_geo_repository_renamed_events_foreign_key.rb
+++ b/ee/db/migrate/20170623202610_add_geo_repository_renamed_events_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddGeoRepositoryRenamedEventsForeignKey < ActiveRecord::Migration
+class AddGeoRepositoryRenamedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170625171421_add_slack_to_application_settings.rb b/ee/db/migrate/20170625171421_add_slack_to_application_settings.rb
index f45c5fd2ae675..1490789ae01ba 100644
--- a/ee/db/migrate/20170625171421_add_slack_to_application_settings.rb
+++ b/ee/db/migrate/20170625171421_add_slack_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 # rubocop:disable Migration/SaferBooleanColumn
-class AddSlackToApplicationSettings < ActiveRecord::Migration
+class AddSlackToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170626202753_update_authorized_keys_file.rb b/ee/db/migrate/20170626202753_update_authorized_keys_file.rb
index 091d536e6b382..e0b4c5f35a1e6 100644
--- a/ee/db/migrate/20170626202753_update_authorized_keys_file.rb
+++ b/ee/db/migrate/20170626202753_update_authorized_keys_file.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class UpdateAuthorizedKeysFile < ActiveRecord::Migration
+class UpdateAuthorizedKeysFile < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   class ApplicationSetting < ActiveRecord::Base
diff --git a/ee/db/migrate/20170627211700_add_default_to_authorized_keys_enabled_application_setting.rb b/ee/db/migrate/20170627211700_add_default_to_authorized_keys_enabled_application_setting.rb
index aa26af35b8fa7..5b8a86f582b92 100644
--- a/ee/db/migrate/20170627211700_add_default_to_authorized_keys_enabled_application_setting.rb
+++ b/ee/db/migrate/20170627211700_add_default_to_authorized_keys_enabled_application_setting.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddDefaultToAuthorizedKeysEnabledApplicationSetting < ActiveRecord::Migration
+class AddDefaultToAuthorizedKeysEnabledApplicationSetting < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170706121518_make_service_desk_enabled_by_default.rb b/ee/db/migrate/20170706121518_make_service_desk_enabled_by_default.rb
index c721fcc2088ee..096089d5626b9 100644
--- a/ee/db/migrate/20170706121518_make_service_desk_enabled_by_default.rb
+++ b/ee/db/migrate/20170706121518_make_service_desk_enabled_by_default.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class MakeServiceDeskEnabledByDefault < ActiveRecord::Migration
+class MakeServiceDeskEnabledByDefault < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170717213940_create_geo_node_namespace_links.rb b/ee/db/migrate/20170717213940_create_geo_node_namespace_links.rb
index 7e19c7e2a1fb2..28bbfa6a5e359 100644
--- a/ee/db/migrate/20170717213940_create_geo_node_namespace_links.rb
+++ b/ee/db/migrate/20170717213940_create_geo_node_namespace_links.rb
@@ -1,4 +1,4 @@
-class CreateGeoNodeNamespaceLinks < ActiveRecord::Migration
+class CreateGeoNodeNamespaceLinks < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170718185922_add_group_id_to_boards.rb b/ee/db/migrate/20170718185922_add_group_id_to_boards.rb
index 69c91fca99392..c81c4a1228cd6 100644
--- a/ee/db/migrate/20170718185922_add_group_id_to_boards.rb
+++ b/ee/db/migrate/20170718185922_add_group_id_to_boards.rb
@@ -1,4 +1,4 @@
-class AddGroupIdToBoards < ActiveRecord::Migration
+class AddGroupIdToBoards < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20170718190627_add_group_boards_indexes.rb b/ee/db/migrate/20170718190627_add_group_boards_indexes.rb
index 6b086c3e8f0b7..4e7419dce46d2 100644
--- a/ee/db/migrate/20170718190627_add_group_boards_indexes.rb
+++ b/ee/db/migrate/20170718190627_add_group_boards_indexes.rb
@@ -1,4 +1,4 @@
-class AddGroupBoardsIndexes < ActiveRecord::Migration
+class AddGroupBoardsIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20170719182937_convert_max_mirror_delay_to_minutes_in_application_settings.rb b/ee/db/migrate/20170719182937_convert_max_mirror_delay_to_minutes_in_application_settings.rb
index 925a2b8a0d07a..5ad5baddd0055 100644
--- a/ee/db/migrate/20170719182937_convert_max_mirror_delay_to_minutes_in_application_settings.rb
+++ b/ee/db/migrate/20170719182937_convert_max_mirror_delay_to_minutes_in_application_settings.rb
@@ -1,4 +1,4 @@
-class ConvertMaxMirrorDelayToMinutesInApplicationSettings < ActiveRecord::Migration
+class ConvertMaxMirrorDelayToMinutesInApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170726111039_add_restrict_group_owners_to_admins_option_to_application_settings.rb b/ee/db/migrate/20170726111039_add_restrict_group_owners_to_admins_option_to_application_settings.rb
index 18bdddec60f23..b199215bd73eb 100644
--- a/ee/db/migrate/20170726111039_add_restrict_group_owners_to_admins_option_to_application_settings.rb
+++ b/ee/db/migrate/20170726111039_add_restrict_group_owners_to_admins_option_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRestrictGroupOwnersToAdminsOptionToApplicationSettings < ActiveRecord::Migration
+class AddRestrictGroupOwnersToAdminsOptionToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170801200418_geo_repositories_changed_events.rb b/ee/db/migrate/20170801200418_geo_repositories_changed_events.rb
index 6c16f076cf3ca..c3da7c215fc68 100644
--- a/ee/db/migrate/20170801200418_geo_repositories_changed_events.rb
+++ b/ee/db/migrate/20170801200418_geo_repositories_changed_events.rb
@@ -1,4 +1,4 @@
-class GeoRepositoriesChangedEvents < ActiveRecord::Migration
+class GeoRepositoriesChangedEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170801201439_add_geo_repositories_changed_events_foreign_key.rb b/ee/db/migrate/20170801201439_add_geo_repositories_changed_events_foreign_key.rb
index 32e73075da560..299766c9d7f8b 100644
--- a/ee/db/migrate/20170801201439_add_geo_repositories_changed_events_foreign_key.rb
+++ b/ee/db/migrate/20170801201439_add_geo_repositories_changed_events_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddGeoRepositoriesChangedEventsForeignKey < ActiveRecord::Migration
+class AddGeoRepositoriesChangedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170808005254_add_email_opted_in_fields_to_users.rb b/ee/db/migrate/20170808005254_add_email_opted_in_fields_to_users.rb
index c7508ac0e893f..f72ca05efdcad 100644
--- a/ee/db/migrate/20170808005254_add_email_opted_in_fields_to_users.rb
+++ b/ee/db/migrate/20170808005254_add_email_opted_in_fields_to_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEmailOptedInFieldsToUsers < ActiveRecord::Migration
+class AddEmailOptedInFieldsToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170808155717_create_plans.rb b/ee/db/migrate/20170808155717_create_plans.rb
index 036473a1419ab..19c6e71ea1570 100644
--- a/ee/db/migrate/20170808155717_create_plans.rb
+++ b/ee/db/migrate/20170808155717_create_plans.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreatePlans < ActiveRecord::Migration
+class CreatePlans < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   class Plan < ActiveRecord::Base
diff --git a/ee/db/migrate/20170808155912_add_plan_id_to_namespaces.rb b/ee/db/migrate/20170808155912_add_plan_id_to_namespaces.rb
index 6ab50f509e48a..d7676e2527313 100644
--- a/ee/db/migrate/20170808155912_add_plan_id_to_namespaces.rb
+++ b/ee/db/migrate/20170808155912_add_plan_id_to_namespaces.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPlanIdToNamespaces < ActiveRecord::Migration
+class AddPlanIdToNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb b/ee/db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb
index 26b3f94ef29d0..eb2780ca7130f 100644
--- a/ee/db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb
+++ b/ee/db/migrate/20170811203342_fix_email_opted_in_at_on_users.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class FixEmailOptedInAtOnUsers < ActiveRecord::Migration
+class FixEmailOptedInAtOnUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170818174141_drop_unnecessary_timestamp_columns_in_geo_event_tables.rb b/ee/db/migrate/20170818174141_drop_unnecessary_timestamp_columns_in_geo_event_tables.rb
index e73d24d98d2e1..7ad09e674f92b 100644
--- a/ee/db/migrate/20170818174141_drop_unnecessary_timestamp_columns_in_geo_event_tables.rb
+++ b/ee/db/migrate/20170818174141_drop_unnecessary_timestamp_columns_in_geo_event_tables.rb
@@ -1,5 +1,5 @@
 # rubocop:disable Migration/RemoveColumn
-class DropUnnecessaryTimestampColumnsInGeoEventTables < ActiveRecord::Migration
+class DropUnnecessaryTimestampColumnsInGeoEventTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170901133132_create_geo_repository_created_events.rb b/ee/db/migrate/20170901133132_create_geo_repository_created_events.rb
index 87f526b661c15..7bf2f783282ad 100644
--- a/ee/db/migrate/20170901133132_create_geo_repository_created_events.rb
+++ b/ee/db/migrate/20170901133132_create_geo_repository_created_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoRepositoryCreatedEvents < ActiveRecord::Migration
+class CreateGeoRepositoryCreatedEvents < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170905201347_add_index_to_geo_event_log_repository_created_event_id.rb b/ee/db/migrate/20170905201347_add_index_to_geo_event_log_repository_created_event_id.rb
index d1e60793cc214..8bd233fd31acd 100644
--- a/ee/db/migrate/20170905201347_add_index_to_geo_event_log_repository_created_event_id.rb
+++ b/ee/db/migrate/20170905201347_add_index_to_geo_event_log_repository_created_event_id.rb
@@ -1,4 +1,4 @@
-class AddIndexToGeoEventLogRepositoryCreatedEventId < ActiveRecord::Migration
+class AddIndexToGeoEventLogRepositoryCreatedEventId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170905202320_add_missing_indexes_to_geo_event_log.rb b/ee/db/migrate/20170905202320_add_missing_indexes_to_geo_event_log.rb
index 423209e384099..bf9e991916aed 100644
--- a/ee/db/migrate/20170905202320_add_missing_indexes_to_geo_event_log.rb
+++ b/ee/db/migrate/20170905202320_add_missing_indexes_to_geo_event_log.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToGeoEventLog < ActiveRecord::Migration
+class AddMissingIndexesToGeoEventLog < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170906160132_add_geo_repository_created_events_fk_on_geo_event_log.rb b/ee/db/migrate/20170906160132_add_geo_repository_created_events_fk_on_geo_event_log.rb
index 9e36bb64c04ed..27b1dbf088d47 100644
--- a/ee/db/migrate/20170906160132_add_geo_repository_created_events_fk_on_geo_event_log.rb
+++ b/ee/db/migrate/20170906160132_add_geo_repository_created_events_fk_on_geo_event_log.rb
@@ -1,4 +1,4 @@
-class AddGeoRepositoryCreatedEventsFkOnGeoEventLog < ActiveRecord::Migration
+class AddGeoRepositoryCreatedEventsFkOnGeoEventLog < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20170910051507_correct_protected_access_levels_foreign_keys.rb b/ee/db/migrate/20170910051507_correct_protected_access_levels_foreign_keys.rb
index fc4ea29aeeec4..e1a30055fbc62 100644
--- a/ee/db/migrate/20170910051507_correct_protected_access_levels_foreign_keys.rb
+++ b/ee/db/migrate/20170910051507_correct_protected_access_levels_foreign_keys.rb
@@ -1,4 +1,4 @@
-class CorrectProtectedAccessLevelsForeignKeys < ActiveRecord::Migration
+class CorrectProtectedAccessLevelsForeignKeys < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170911133813_drop_cn_constraint_to_ldap_group_links.rb b/ee/db/migrate/20170911133813_drop_cn_constraint_to_ldap_group_links.rb
index c1365c79813cf..1b33ac1a93565 100644
--- a/ee/db/migrate/20170911133813_drop_cn_constraint_to_ldap_group_links.rb
+++ b/ee/db/migrate/20170911133813_drop_cn_constraint_to_ldap_group_links.rb
@@ -1,4 +1,4 @@
-class DropCnConstraintToLdapGroupLinks < ActiveRecord::Migration
+class DropCnConstraintToLdapGroupLinks < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170911134018_add_filter_to_ldap_group_links.rb b/ee/db/migrate/20170911134018_add_filter_to_ldap_group_links.rb
index a98d50836aaf0..154be12159ad6 100644
--- a/ee/db/migrate/20170911134018_add_filter_to_ldap_group_links.rb
+++ b/ee/db/migrate/20170911134018_add_filter_to_ldap_group_links.rb
@@ -1,4 +1,4 @@
-class AddFilterToLdapGroupLinks < ActiveRecord::Migration
+class AddFilterToLdapGroupLinks < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170914012544_add_reject_unsigned_commits_to_push_rules.rb b/ee/db/migrate/20170914012544_add_reject_unsigned_commits_to_push_rules.rb
index 1d9a297585a84..40beeb9c988ad 100644
--- a/ee/db/migrate/20170914012544_add_reject_unsigned_commits_to_push_rules.rb
+++ b/ee/db/migrate/20170914012544_add_reject_unsigned_commits_to_push_rules.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddRejectUnsignedCommitsToPushRules < ActiveRecord::Migration
+class AddRejectUnsignedCommitsToPushRules < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20170920091408_add_index_for_pushrules_is_sample.rb b/ee/db/migrate/20170920091408_add_index_for_pushrules_is_sample.rb
index 058a456e0a3e9..7e3cd4fe0f9c2 100644
--- a/ee/db/migrate/20170920091408_add_index_for_pushrules_is_sample.rb
+++ b/ee/db/migrate/20170920091408_add_index_for_pushrules_is_sample.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexForPushrulesIsSample < ActiveRecord::Migration
+class AddIndexForPushrulesIsSample < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20170926200545_add_weight_to_boards.rb b/ee/db/migrate/20170926200545_add_weight_to_boards.rb
index edf1909f179ca..02ac2943a6ec9 100644
--- a/ee/db/migrate/20170926200545_add_weight_to_boards.rb
+++ b/ee/db/migrate/20170926200545_add_weight_to_boards.rb
@@ -1,4 +1,4 @@
-class AddWeightToBoards < ActiveRecord::Migration
+class AddWeightToBoards < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20170926203418_create_board_labels.rb b/ee/db/migrate/20170926203418_create_board_labels.rb
index cf683f7cf7e48..49b2214bdc373 100644
--- a/ee/db/migrate/20170926203418_create_board_labels.rb
+++ b/ee/db/migrate/20170926203418_create_board_labels.rb
@@ -1,4 +1,4 @@
-class CreateBoardLabels < ActiveRecord::Migration
+class CreateBoardLabels < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20170928081016_add_pipeline_quotas_to_plan.rb b/ee/db/migrate/20170928081016_add_pipeline_quotas_to_plan.rb
index a43b2541e98e2..559c73247b53d 100644
--- a/ee/db/migrate/20170928081016_add_pipeline_quotas_to_plan.rb
+++ b/ee/db/migrate/20170928081016_add_pipeline_quotas_to_plan.rb
@@ -1,4 +1,4 @@
-class AddPipelineQuotasToPlan < ActiveRecord::Migration
+class AddPipelineQuotasToPlan < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171002105019_create_missing_free_plan.rb b/ee/db/migrate/20171002105019_create_missing_free_plan.rb
index 96a6823f760f0..579e25bd39b6b 100644
--- a/ee/db/migrate/20171002105019_create_missing_free_plan.rb
+++ b/ee/db/migrate/20171002105019_create_missing_free_plan.rb
@@ -1,4 +1,4 @@
-class CreateMissingFreePlan < ActiveRecord::Migration
+class CreateMissingFreePlan < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171006201108_add_commit_committer_check_to_push_rules.rb b/ee/db/migrate/20171006201108_add_commit_committer_check_to_push_rules.rb
index bc5fb7ec75667..b98775863a70d 100644
--- a/ee/db/migrate/20171006201108_add_commit_committer_check_to_push_rules.rb
+++ b/ee/db/migrate/20171006201108_add_commit_committer_check_to_push_rules.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCommitCommitterCheckToPushRules < ActiveRecord::Migration
+class AddCommitCommitterCheckToPushRules < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20171010095526_create_board_assignees.rb b/ee/db/migrate/20171010095526_create_board_assignees.rb
index 324d7f96398aa..e1b5542acf3eb 100644
--- a/ee/db/migrate/20171010095526_create_board_assignees.rb
+++ b/ee/db/migrate/20171010095526_create_board_assignees.rb
@@ -1,4 +1,4 @@
-class CreateBoardAssignees < ActiveRecord::Migration
+class CreateBoardAssignees < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20171010140746_geo_configurable_max_capacities.rb b/ee/db/migrate/20171010140746_geo_configurable_max_capacities.rb
index 37601ca81dc97..92b9b9a643b58 100644
--- a/ee/db/migrate/20171010140746_geo_configurable_max_capacities.rb
+++ b/ee/db/migrate/20171010140746_geo_configurable_max_capacities.rb
@@ -1,4 +1,4 @@
-class GeoConfigurableMaxCapacities < ActiveRecord::Migration
+class GeoConfigurableMaxCapacities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171012070521_create_epics.rb b/ee/db/migrate/20171012070521_create_epics.rb
index a2359d0a12b9d..0ffde95956e17 100644
--- a/ee/db/migrate/20171012070521_create_epics.rb
+++ b/ee/db/migrate/20171012070521_create_epics.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreateEpics < ActiveRecord::Migration
+class CreateEpics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171013192542_add_geo_node_clone_protocol.rb b/ee/db/migrate/20171013192542_add_geo_node_clone_protocol.rb
index 6815a53faeb60..9b70c5426cdc3 100644
--- a/ee/db/migrate/20171013192542_add_geo_node_clone_protocol.rb
+++ b/ee/db/migrate/20171013192542_add_geo_node_clone_protocol.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddGeoNodeCloneProtocol < ActiveRecord::Migration
+class AddGeoNodeCloneProtocol < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb b/ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb
index 039e71c5cbde0..9081f328e6a77 100644
--- a/ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb
+++ b/ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddRemoteMirrorAvailableToApplicationSettings < ActiveRecord::Migration
+class AddRemoteMirrorAvailableToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb b/ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb
index 8b94d74ac55c7..cf79ac3cdd3f0 100644
--- a/ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb
+++ b/ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb
@@ -1,4 +1,4 @@
-class AddRemoteMirrorAvailableOverriddenToProjectsEE < ActiveRecord::Migration
+class AddRemoteMirrorAvailableOverriddenToProjectsEE < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171031055422_create_geo_node_statuses.rb b/ee/db/migrate/20171031055422_create_geo_node_statuses.rb
index 5a277f9619c99..aed1f272a56e6 100644
--- a/ee/db/migrate/20171031055422_create_geo_node_statuses.rb
+++ b/ee/db/migrate/20171031055422_create_geo_node_statuses.rb
@@ -1,4 +1,4 @@
-class CreateGeoNodeStatuses < ActiveRecord::Migration
+class CreateGeoNodeStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171107090120_add_composite_index_to_project_mirror_data_next_execution_timestamp_and_retry_count.rb b/ee/db/migrate/20171107090120_add_composite_index_to_project_mirror_data_next_execution_timestamp_and_retry_count.rb
index 2abe0b3758aab..0c4205f5e337d 100644
--- a/ee/db/migrate/20171107090120_add_composite_index_to_project_mirror_data_next_execution_timestamp_and_retry_count.rb
+++ b/ee/db/migrate/20171107090120_add_composite_index_to_project_mirror_data_next_execution_timestamp_and_retry_count.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddCompositeIndexToProjectMirrorDataNextExecutionTimestampAndRetryCount < ActiveRecord::Migration
+class AddCompositeIndexToProjectMirrorDataNextExecutionTimestampAndRetryCount < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171107130813_create_epic_issues_table.rb b/ee/db/migrate/20171107130813_create_epic_issues_table.rb
index 860901d3c85fd..35991a90ec222 100644
--- a/ee/db/migrate/20171107130813_create_epic_issues_table.rb
+++ b/ee/db/migrate/20171107130813_create_epic_issues_table.rb
@@ -1,4 +1,4 @@
-class CreateEpicIssuesTable < ActiveRecord::Migration
+class CreateEpicIssuesTable < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20171107144122_create_geo_hashed_storage_migrated_events.rb b/ee/db/migrate/20171107144122_create_geo_hashed_storage_migrated_events.rb
index 861bbf0a292c9..fab992ad4d7c6 100644
--- a/ee/db/migrate/20171107144122_create_geo_hashed_storage_migrated_events.rb
+++ b/ee/db/migrate/20171107144122_create_geo_hashed_storage_migrated_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoHashedStorageMigratedEvents < ActiveRecord::Migration
+class CreateGeoHashedStorageMigratedEvents < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20171107144726_add_geo_hashed_storage_migrated_events_foreign_key.rb b/ee/db/migrate/20171107144726_add_geo_hashed_storage_migrated_events_foreign_key.rb
index 48628530a91d8..843b6d2d43ff1 100644
--- a/ee/db/migrate/20171107144726_add_geo_hashed_storage_migrated_events_foreign_key.rb
+++ b/ee/db/migrate/20171107144726_add_geo_hashed_storage_migrated_events_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddGeoHashedStorageMigratedEventsForeignKey < ActiveRecord::Migration
+class AddGeoHashedStorageMigratedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171109115718_add_only_mirror_protected_branches_to_projects.rb b/ee/db/migrate/20171109115718_add_only_mirror_protected_branches_to_projects.rb
index c1000b1eada50..faf6611f6c825 100644
--- a/ee/db/migrate/20171109115718_add_only_mirror_protected_branches_to_projects.rb
+++ b/ee/db/migrate/20171109115718_add_only_mirror_protected_branches_to_projects.rb
@@ -1,4 +1,4 @@
-class AddOnlyMirrorProtectedBranchesToProjects < ActiveRecord::Migration
+class AddOnlyMirrorProtectedBranchesToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171110152729_add_only_protected_branches_to_remote_mirrors.rb b/ee/db/migrate/20171110152729_add_only_protected_branches_to_remote_mirrors.rb
index db473703f5509..2fd14cd44e815 100644
--- a/ee/db/migrate/20171110152729_add_only_protected_branches_to_remote_mirrors.rb
+++ b/ee/db/migrate/20171110152729_add_only_protected_branches_to_remote_mirrors.rb
@@ -1,4 +1,4 @@
-class AddOnlyProtectedBranchesToRemoteMirrors < ActiveRecord::Migration
+class AddOnlyProtectedBranchesToRemoteMirrors < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171120143816_create_geo_lfs_object_deleted_events.rb b/ee/db/migrate/20171120143816_create_geo_lfs_object_deleted_events.rb
index c43515398f335..346426e939b3b 100644
--- a/ee/db/migrate/20171120143816_create_geo_lfs_object_deleted_events.rb
+++ b/ee/db/migrate/20171120143816_create_geo_lfs_object_deleted_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoLfsObjectDeletedEvents < ActiveRecord::Migration
+class CreateGeoLfsObjectDeletedEvents < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20171120145444_add_geo_lfs_object_deleted_events_foreign_key.rb b/ee/db/migrate/20171120145444_add_geo_lfs_object_deleted_events_foreign_key.rb
index c3c5a2cd24d64..85e048052134b 100644
--- a/ee/db/migrate/20171120145444_add_geo_lfs_object_deleted_events_foreign_key.rb
+++ b/ee/db/migrate/20171120145444_add_geo_lfs_object_deleted_events_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddGeoLfsObjectDeletedEventsForeignKey < ActiveRecord::Migration
+class AddGeoLfsObjectDeletedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171124070437_add_attachments_migration_to_geo_migration_events.rb b/ee/db/migrate/20171124070437_add_attachments_migration_to_geo_migration_events.rb
index 55ae9905c1a35..0ef2e285d2b4f 100644
--- a/ee/db/migrate/20171124070437_add_attachments_migration_to_geo_migration_events.rb
+++ b/ee/db/migrate/20171124070437_add_attachments_migration_to_geo_migration_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddAttachmentsMigrationToGeoMigrationEvents < ActiveRecord::Migration
+class AddAttachmentsMigrationToGeoMigrationEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171124164248_store_geo_nodes_url_directly.rb b/ee/db/migrate/20171124164248_store_geo_nodes_url_directly.rb
index 5a54c3e360a1d..90b91269a2479 100644
--- a/ee/db/migrate/20171124164248_store_geo_nodes_url_directly.rb
+++ b/ee/db/migrate/20171124164248_store_geo_nodes_url_directly.rb
@@ -1,4 +1,4 @@
-class StoreGeoNodesUrlDirectly < ActiveRecord::Migration
+class StoreGeoNodesUrlDirectly < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171124164249_index_geo_nodes_url.rb b/ee/db/migrate/20171124164249_index_geo_nodes_url.rb
index 756f7b7e6df9c..c971bb8368ba6 100644
--- a/ee/db/migrate/20171124164249_index_geo_nodes_url.rb
+++ b/ee/db/migrate/20171124164249_index_geo_nodes_url.rb
@@ -1,4 +1,4 @@
-class IndexGeoNodesUrl < ActiveRecord::Migration
+class IndexGeoNodesUrl < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171129150921_rename_remote_mirror_available_to_mirror_available.rb b/ee/db/migrate/20171129150921_rename_remote_mirror_available_to_mirror_available.rb
index 178d8a424cfb6..bf18190b81227 100644
--- a/ee/db/migrate/20171129150921_rename_remote_mirror_available_to_mirror_available.rb
+++ b/ee/db/migrate/20171129150921_rename_remote_mirror_available_to_mirror_available.rb
@@ -1,4 +1,4 @@
-class RenameRemoteMirrorAvailableToMirrorAvailable < ActiveRecord::Migration
+class RenameRemoteMirrorAvailableToMirrorAvailable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171129152659_add_pull_mirror_available_overridden_to_projects.rb b/ee/db/migrate/20171129152659_add_pull_mirror_available_overridden_to_projects.rb
index 29b7c520005b4..fa43f89aac82a 100644
--- a/ee/db/migrate/20171129152659_add_pull_mirror_available_overridden_to_projects.rb
+++ b/ee/db/migrate/20171129152659_add_pull_mirror_available_overridden_to_projects.rb
@@ -1,4 +1,4 @@
-class AddPullMirrorAvailableOverriddenToProjects < ActiveRecord::Migration
+class AddPullMirrorAvailableOverriddenToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171130151759_create_geo_upload_deleted_events.rb b/ee/db/migrate/20171130151759_create_geo_upload_deleted_events.rb
index ad859e063f36d..dce59beace975 100644
--- a/ee/db/migrate/20171130151759_create_geo_upload_deleted_events.rb
+++ b/ee/db/migrate/20171130151759_create_geo_upload_deleted_events.rb
@@ -1,4 +1,4 @@
-class CreateGeoUploadDeletedEvents < ActiveRecord::Migration
+class CreateGeoUploadDeletedEvents < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20171130152602_add_geo_upload_deleted_events_foreign_key.rb b/ee/db/migrate/20171130152602_add_geo_upload_deleted_events_foreign_key.rb
index c9701033fc3d0..8dd4097c4d857 100644
--- a/ee/db/migrate/20171130152602_add_geo_upload_deleted_events_foreign_key.rb
+++ b/ee/db/migrate/20171130152602_add_geo_upload_deleted_events_foreign_key.rb
@@ -1,4 +1,4 @@
-class AddGeoUploadDeletedEventsForeignKey < ActiveRecord::Migration
+class AddGeoUploadDeletedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171204112945_add_geo_replication_slot_status.rb b/ee/db/migrate/20171204112945_add_geo_replication_slot_status.rb
index e5e9331d68910..a210fb74e8c13 100644
--- a/ee/db/migrate/20171204112945_add_geo_replication_slot_status.rb
+++ b/ee/db/migrate/20171204112945_add_geo_replication_slot_status.rb
@@ -1,4 +1,4 @@
-class AddGeoReplicationSlotStatus < ActiveRecord::Migration
+class AddGeoReplicationSlotStatus < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20171207105719_add_wiki_info_to_geo_node_statuses.rb b/ee/db/migrate/20171207105719_add_wiki_info_to_geo_node_statuses.rb
index aa5e73676538c..17a14cd68403e 100644
--- a/ee/db/migrate/20171207105719_add_wiki_info_to_geo_node_statuses.rb
+++ b/ee/db/migrate/20171207105719_add_wiki_info_to_geo_node_statuses.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddWikiInfoToGeoNodeStatuses < ActiveRecord::Migration
+class AddWikiInfoToGeoNodeStatuses < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20171211131502_add_external_classification_authorization_settings_to_appliction_settings.rb b/ee/db/migrate/20171211131502_add_external_classification_authorization_settings_to_appliction_settings.rb
index 66e1a35f763dd..a7dec8732fb8b 100644
--- a/ee/db/migrate/20171211131502_add_external_classification_authorization_settings_to_appliction_settings.rb
+++ b/ee/db/migrate/20171211131502_add_external_classification_authorization_settings_to_appliction_settings.rb
@@ -1,4 +1,4 @@
-class AddExternalClassificationAuthorizationSettingsToApplictionSettings < ActiveRecord::Migration
+class AddExternalClassificationAuthorizationSettingsToApplictionSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171214115254_add_position_to_epic_issues.rb b/ee/db/migrate/20171214115254_add_position_to_epic_issues.rb
index 288e8c9227417..3dc9fdabeeb89 100644
--- a/ee/db/migrate/20171214115254_add_position_to_epic_issues.rb
+++ b/ee/db/migrate/20171214115254_add_position_to_epic_issues.rb
@@ -1,4 +1,4 @@
-class AddPositionToEpicIssues < ActiveRecord::Migration
+class AddPositionToEpicIssues < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171218140451_add_external_authorization_service_classification_label_to_projects.rb b/ee/db/migrate/20171218140451_add_external_authorization_service_classification_label_to_projects.rb
index d2910513f4a0c..7b83580f02557 100644
--- a/ee/db/migrate/20171218140451_add_external_authorization_service_classification_label_to_projects.rb
+++ b/ee/db/migrate/20171218140451_add_external_authorization_service_classification_label_to_projects.rb
@@ -1,4 +1,4 @@
-class AddExternalAuthorizationServiceClassificationLabelToProjects < ActiveRecord::Migration
+class AddExternalAuthorizationServiceClassificationLabelToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20171222151344_add_regexp_uses_re2_to_push_rules.rb b/ee/db/migrate/20171222151344_add_regexp_uses_re2_to_push_rules.rb
index ed2804fffc49d..81741599e1389 100644
--- a/ee/db/migrate/20171222151344_add_regexp_uses_re2_to_push_rules.rb
+++ b/ee/db/migrate/20171222151344_add_regexp_uses_re2_to_push_rules.rb
@@ -1,4 +1,4 @@
-class AddRegexpUsesRe2ToPushRules < ActiveRecord::Migration
+class AddRegexpUsesRe2ToPushRules < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180103234731_create_geo_job_artifact_deleted_event.rb b/ee/db/migrate/20180103234731_create_geo_job_artifact_deleted_event.rb
index 01bb1be1a69b9..b35f75809dd04 100644
--- a/ee/db/migrate/20180103234731_create_geo_job_artifact_deleted_event.rb
+++ b/ee/db/migrate/20180103234731_create_geo_job_artifact_deleted_event.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreateGeoJobArtifactDeletedEvent < ActiveRecord::Migration
+class CreateGeoJobArtifactDeletedEvent < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180104001824_add_geo_job_artifact_deleted_events_foreign_key.rb b/ee/db/migrate/20180104001824_add_geo_job_artifact_deleted_events_foreign_key.rb
index a362ed0beabd1..a7997bd1f7032 100644
--- a/ee/db/migrate/20180104001824_add_geo_job_artifact_deleted_events_foreign_key.rb
+++ b/ee/db/migrate/20180104001824_add_geo_job_artifact_deleted_events_foreign_key.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddGeoJobArtifactDeletedEventsForeignKey < ActiveRecord::Migration
+class AddGeoJobArtifactDeletedEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180105233807_add_job_artifact_counts_to_geo_node_statuses.rb b/ee/db/migrate/20180105233807_add_job_artifact_counts_to_geo_node_statuses.rb
index 2c28274e93022..e82ea2f104130 100644
--- a/ee/db/migrate/20180105233807_add_job_artifact_counts_to_geo_node_statuses.rb
+++ b/ee/db/migrate/20180105233807_add_job_artifact_counts_to_geo_node_statuses.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddJobArtifactCountsToGeoNodeStatuses < ActiveRecord::Migration
+class AddJobArtifactCountsToGeoNodeStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180109150457_add_remote_name_to_remote_mirrors.rb b/ee/db/migrate/20180109150457_add_remote_name_to_remote_mirrors.rb
index 2ff17c6063a6b..df645b29c598f 100644
--- a/ee/db/migrate/20180109150457_add_remote_name_to_remote_mirrors.rb
+++ b/ee/db/migrate/20180109150457_add_remote_name_to_remote_mirrors.rb
@@ -1,4 +1,4 @@
-class AddRemoteNameToRemoteMirrors < ActiveRecord::Migration
+class AddRemoteNameToRemoteMirrors < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180115013218_create_saml_providers.rb b/ee/db/migrate/20180115013218_create_saml_providers.rb
index c24e7a6921c2f..569cd3584ed92 100644
--- a/ee/db/migrate/20180115013218_create_saml_providers.rb
+++ b/ee/db/migrate/20180115013218_create_saml_providers.rb
@@ -1,4 +1,4 @@
-class CreateSamlProviders < ActiveRecord::Migration
+class CreateSamlProviders < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180115094742_add_default_project_creation_setting.rb b/ee/db/migrate/20180115094742_add_default_project_creation_setting.rb
index 7b9c0732b7547..22de39e16727b 100644
--- a/ee/db/migrate/20180115094742_add_default_project_creation_setting.rb
+++ b/ee/db/migrate/20180115094742_add_default_project_creation_setting.rb
@@ -1,4 +1,4 @@
-class AddDefaultProjectCreationSetting < ActiveRecord::Migration
+class AddDefaultProjectCreationSetting < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180115113902_add_project_creation_level_to_groups.rb b/ee/db/migrate/20180115113902_add_project_creation_level_to_groups.rb
index 8c64ce1944c87..5a8a9d2764f66 100644
--- a/ee/db/migrate/20180115113902_add_project_creation_level_to_groups.rb
+++ b/ee/db/migrate/20180115113902_add_project_creation_level_to_groups.rb
@@ -1,4 +1,4 @@
-class AddProjectCreationLevelToGroups < ActiveRecord::Migration
+class AddProjectCreationLevelToGroups < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180126165535_geo_selective_sync_by_shard.rb b/ee/db/migrate/20180126165535_geo_selective_sync_by_shard.rb
index 17aa0dcba77ee..ae9e38fd9d313 100644
--- a/ee/db/migrate/20180126165535_geo_selective_sync_by_shard.rb
+++ b/ee/db/migrate/20180126165535_geo_selective_sync_by_shard.rb
@@ -1,4 +1,4 @@
-class GeoSelectiveSyncByShard < ActiveRecord::Migration
+class GeoSelectiveSyncByShard < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180131104538_add_date_indexes_to_epics.rb b/ee/db/migrate/20180131104538_add_date_indexes_to_epics.rb
index 51a14d9c8f640..0a79fd808a089 100644
--- a/ee/db/migrate/20180131104538_add_date_indexes_to_epics.rb
+++ b/ee/db/migrate/20180131104538_add_date_indexes_to_epics.rb
@@ -1,4 +1,4 @@
-class AddDateIndexesToEpics < ActiveRecord::Migration
+class AddDateIndexesToEpics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180201101405_change_geo_node_status_column_size.rb b/ee/db/migrate/20180201101405_change_geo_node_status_column_size.rb
index 8cb3270e2597a..3a93dbc0f2244 100644
--- a/ee/db/migrate/20180201101405_change_geo_node_status_column_size.rb
+++ b/ee/db/migrate/20180201101405_change_geo_node_status_column_size.rb
@@ -1,4 +1,4 @@
-class ChangeGeoNodeStatusColumnSize < ActiveRecord::Migration
+class ChangeGeoNodeStatusColumnSize < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180201192230_store_version_and_revision_in_geo_node_status.rb b/ee/db/migrate/20180201192230_store_version_and_revision_in_geo_node_status.rb
index 713a3cf0342f7..c7fff3838d331 100644
--- a/ee/db/migrate/20180201192230_store_version_and_revision_in_geo_node_status.rb
+++ b/ee/db/migrate/20180201192230_store_version_and_revision_in_geo_node_status.rb
@@ -1,4 +1,4 @@
-class StoreVersionAndRevisionInGeoNodeStatus < ActiveRecord::Migration
+class StoreVersionAndRevisionInGeoNodeStatus < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180206184810_create_project_repository_states.rb b/ee/db/migrate/20180206184810_create_project_repository_states.rb
index 3a17f9b3ed73f..74c609822f6d8 100644
--- a/ee/db/migrate/20180206184810_create_project_repository_states.rb
+++ b/ee/db/migrate/20180206184810_create_project_repository_states.rb
@@ -1,4 +1,4 @@
-class CreateProjectRepositoryStates < ActiveRecord::Migration
+class CreateProjectRepositoryStates < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180209115333_create_chatops_tables.rb b/ee/db/migrate/20180209115333_create_chatops_tables.rb
index 0ca05365f1969..ff1325bd60d2b 100644
--- a/ee/db/migrate/20180209115333_create_chatops_tables.rb
+++ b/ee/db/migrate/20180209115333_create_chatops_tables.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class CreateChatopsTables < ActiveRecord::Migration
+class CreateChatopsTables < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180215143644_add_mirror_overwrites_diverged_branches_to_project.rb b/ee/db/migrate/20180215143644_add_mirror_overwrites_diverged_branches_to_project.rb
index d00d3bc2ff366..514a5c828bf82 100644
--- a/ee/db/migrate/20180215143644_add_mirror_overwrites_diverged_branches_to_project.rb
+++ b/ee/db/migrate/20180215143644_add_mirror_overwrites_diverged_branches_to_project.rb
@@ -1,4 +1,4 @@
-class AddMirrorOverwritesDivergedBranchesToProject < ActiveRecord::Migration
+class AddMirrorOverwritesDivergedBranchesToProject < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180225180932_add_geo_node_verification_status.rb b/ee/db/migrate/20180225180932_add_geo_node_verification_status.rb
index 986bc90ff508e..1f9251bc981a1 100644
--- a/ee/db/migrate/20180225180932_add_geo_node_verification_status.rb
+++ b/ee/db/migrate/20180225180932_add_geo_node_verification_status.rb
@@ -1,4 +1,4 @@
-class AddGeoNodeVerificationStatus < ActiveRecord::Migration
+class AddGeoNodeVerificationStatus < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180302230551_add_external_webhook_token_to_projects.rb b/ee/db/migrate/20180302230551_add_external_webhook_token_to_projects.rb
index 3f2eb7d1360bd..9e623336a4799 100644
--- a/ee/db/migrate/20180302230551_add_external_webhook_token_to_projects.rb
+++ b/ee/db/migrate/20180302230551_add_external_webhook_token_to_projects.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddExternalWebhookTokenToProjects < ActiveRecord::Migration
+class AddExternalWebhookTokenToProjects < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180307164427_disable_mirroring_for_projects_with_invalid_mirror_users.rb b/ee/db/migrate/20180307164427_disable_mirroring_for_projects_with_invalid_mirror_users.rb
index a00d60277fa32..adddafcba4bbb 100644
--- a/ee/db/migrate/20180307164427_disable_mirroring_for_projects_with_invalid_mirror_users.rb
+++ b/ee/db/migrate/20180307164427_disable_mirroring_for_projects_with_invalid_mirror_users.rb
@@ -1,4 +1,4 @@
-class DisableMirroringForProjectsWithInvalidMirrorUsers < ActiveRecord::Migration
+class DisableMirroringForProjectsWithInvalidMirrorUsers < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20180308234102_add_partial_index_to_project_repository_states_checksum_columns.rb b/ee/db/migrate/20180308234102_add_partial_index_to_project_repository_states_checksum_columns.rb
index 288212e56e386..782e6f1f7933d 100644
--- a/ee/db/migrate/20180308234102_add_partial_index_to_project_repository_states_checksum_columns.rb
+++ b/ee/db/migrate/20180308234102_add_partial_index_to_project_repository_states_checksum_columns.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectRepositoryStatesChecksumColumns < ActiveRecord::Migration
+class AddPartialIndexToProjectRepositoryStatesChecksumColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180314100728_add_external_authorization_service_timeout_to_application_settings.rb b/ee/db/migrate/20180314100728_add_external_authorization_service_timeout_to_application_settings.rb
index fb6dad548a9fa..c3c6aa0ddf833 100644
--- a/ee/db/migrate/20180314100728_add_external_authorization_service_timeout_to_application_settings.rb
+++ b/ee/db/migrate/20180314100728_add_external_authorization_service_timeout_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddExternalAuthorizationServiceTimeoutToApplicationSettings < ActiveRecord::Migration
+class AddExternalAuthorizationServiceTimeoutToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb b/ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb
index 9505dd76cca9e..e17f76274f878 100644
--- a/ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb
+++ b/ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb
@@ -1,4 +1,4 @@
-class AddHeaderAndFooterBannersToAppearancesTable < ActiveRecord::Migration
+class AddHeaderAndFooterBannersToAppearancesTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180314174825_add_partial_index_to_project_repository_states_verification_columns.rb b/ee/db/migrate/20180314174825_add_partial_index_to_project_repository_states_verification_columns.rb
index 7bd151850f673..bb9ed395ac11e 100644
--- a/ee/db/migrate/20180314174825_add_partial_index_to_project_repository_states_verification_columns.rb
+++ b/ee/db/migrate/20180314174825_add_partial_index_to_project_repository_states_verification_columns.rb
@@ -1,4 +1,4 @@
-class AddPartialIndexToProjectRepositoryStatesVerificationColumns < ActiveRecord::Migration
+class AddPartialIndexToProjectRepositoryStatesVerificationColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180315160435_add_external_auth_mutual_tls_fields_to_project_settings.rb b/ee/db/migrate/20180315160435_add_external_auth_mutual_tls_fields_to_project_settings.rb
index f2fda2f673c03..ee3d1078f5e74 100644
--- a/ee/db/migrate/20180315160435_add_external_auth_mutual_tls_fields_to_project_settings.rb
+++ b/ee/db/migrate/20180315160435_add_external_auth_mutual_tls_fields_to_project_settings.rb
@@ -1,4 +1,4 @@
-class AddExternalAuthMutualTlsFieldsToProjectSettings < ActiveRecord::Migration
+class AddExternalAuthMutualTlsFieldsToProjectSettings < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180317020334_add_saml_provider_to_identities.rb b/ee/db/migrate/20180317020334_add_saml_provider_to_identities.rb
index b8aa5e82f0b4e..16e66fc7d6c6d 100644
--- a/ee/db/migrate/20180317020334_add_saml_provider_to_identities.rb
+++ b/ee/db/migrate/20180317020334_add_saml_provider_to_identities.rb
@@ -1,4 +1,4 @@
-class AddSamlProviderToIdentities < ActiveRecord::Migration
+class AddSamlProviderToIdentities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180320142552_create_prometheus_alerts.rb b/ee/db/migrate/20180320142552_create_prometheus_alerts.rb
index ca9a7afd6eaed..a49a6cc42206a 100644
--- a/ee/db/migrate/20180320142552_create_prometheus_alerts.rb
+++ b/ee/db/migrate/20180320142552_create_prometheus_alerts.rb
@@ -1,4 +1,4 @@
-class CreatePrometheusAlerts < ActiveRecord::Migration
+class CreatePrometheusAlerts < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20180325034910_create_protected_branch_unprotect_access_levels.rb b/ee/db/migrate/20180325034910_create_protected_branch_unprotect_access_levels.rb
index 7f1b43ac27e1d..4b6db0f07e9cf 100644
--- a/ee/db/migrate/20180325034910_create_protected_branch_unprotect_access_levels.rb
+++ b/ee/db/migrate/20180325034910_create_protected_branch_unprotect_access_levels.rb
@@ -1,4 +1,4 @@
-class CreateProtectedBranchUnprotectAccessLevels < ActiveRecord::Migration
+class CreateProtectedBranchUnprotectAccessLevels < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180329230151_add_missing_on_primary_counts_to_geo_node_statuses.rb b/ee/db/migrate/20180329230151_add_missing_on_primary_counts_to_geo_node_statuses.rb
index ccda49534166a..c31a253df7f45 100644
--- a/ee/db/migrate/20180329230151_add_missing_on_primary_counts_to_geo_node_statuses.rb
+++ b/ee/db/migrate/20180329230151_add_missing_on_primary_counts_to_geo_node_statuses.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddMissingOnPrimaryCountsToGeoNodeStatuses < ActiveRecord::Migration
+class AddMissingOnPrimaryCountsToGeoNodeStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180401213713_add_email_additional_text_to_application_settings.rb b/ee/db/migrate/20180401213713_add_email_additional_text_to_application_settings.rb
index 56c35983767d1..57bffa28b8e97 100644
--- a/ee/db/migrate/20180401213713_add_email_additional_text_to_application_settings.rb
+++ b/ee/db/migrate/20180401213713_add_email_additional_text_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddEmailAdditionalTextToApplicationSettings < ActiveRecord::Migration
+class AddEmailAdditionalTextToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180416112831_drop_null_constraint_geo_events_storage_path.rb b/ee/db/migrate/20180416112831_drop_null_constraint_geo_events_storage_path.rb
index 861a83b19a231..867527627324b 100644
--- a/ee/db/migrate/20180416112831_drop_null_constraint_geo_events_storage_path.rb
+++ b/ee/db/migrate/20180416112831_drop_null_constraint_geo_events_storage_path.rb
@@ -1,4 +1,4 @@
-class DropNullConstraintGeoEventsStoragePath < ActiveRecord::Migration
+class DropNullConstraintGeoEventsStoragePath < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180416205949_add_checksum_fields_to_geo_node_statuses.rb b/ee/db/migrate/20180416205949_add_checksum_fields_to_geo_node_statuses.rb
index 6160598b15787..65b8a2ee7d964 100644
--- a/ee/db/migrate/20180416205949_add_checksum_fields_to_geo_node_statuses.rb
+++ b/ee/db/migrate/20180416205949_add_checksum_fields_to_geo_node_statuses.rb
@@ -1,4 +1,4 @@
-class AddChecksumFieldsToGeoNodeStatuses < ActiveRecord::Migration
+class AddChecksumFieldsToGeoNodeStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180419031622_add_index_for_tracking_mirrored_ci_cd_repositories.rb b/ee/db/migrate/20180419031622_add_index_for_tracking_mirrored_ci_cd_repositories.rb
index 9aaa575ee63a5..a8af0121ce845 100644
--- a/ee/db/migrate/20180419031622_add_index_for_tracking_mirrored_ci_cd_repositories.rb
+++ b/ee/db/migrate/20180419031622_add_index_for_tracking_mirrored_ci_cd_repositories.rb
@@ -1,4 +1,4 @@
-class AddIndexForTrackingMirroredCiCdRepositories < ActiveRecord::Migration
+class AddIndexForTrackingMirroredCiCdRepositories < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/ee/db/migrate/20180419171038_create_vulnerability_feedback.rb b/ee/db/migrate/20180419171038_create_vulnerability_feedback.rb
index 288d1b048b659..dc8730d53c4d3 100644
--- a/ee/db/migrate/20180419171038_create_vulnerability_feedback.rb
+++ b/ee/db/migrate/20180419171038_create_vulnerability_feedback.rb
@@ -1,4 +1,4 @@
-class CreateVulnerabilityFeedback < ActiveRecord::Migration
+class CreateVulnerabilityFeedback < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180423165301_add_negative_matching_commit_message_push_rule.rb b/ee/db/migrate/20180423165301_add_negative_matching_commit_message_push_rule.rb
index 66f2ec9d7f291..119f654c477ca 100644
--- a/ee/db/migrate/20180423165301_add_negative_matching_commit_message_push_rule.rb
+++ b/ee/db/migrate/20180423165301_add_negative_matching_commit_message_push_rule.rb
@@ -1,4 +1,4 @@
-class AddNegativeMatchingCommitMessagePushRule < ActiveRecord::Migration
+class AddNegativeMatchingCommitMessagePushRule < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180502124117_add_missing_columns_to_project_mirror_data.rb b/ee/db/migrate/20180502124117_add_missing_columns_to_project_mirror_data.rb
index ef0e725d95fb9..4f96761d87715 100644
--- a/ee/db/migrate/20180502124117_add_missing_columns_to_project_mirror_data.rb
+++ b/ee/db/migrate/20180502124117_add_missing_columns_to_project_mirror_data.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddMissingColumnsToProjectMirrorData < ActiveRecord::Migration
+class AddMissingColumnsToProjectMirrorData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180502125859_add_saml_provider_index_and_constraint_to_identities.rb b/ee/db/migrate/20180502125859_add_saml_provider_index_and_constraint_to_identities.rb
index f5f2613260735..8b00115a53459 100644
--- a/ee/db/migrate/20180502125859_add_saml_provider_index_and_constraint_to_identities.rb
+++ b/ee/db/migrate/20180502125859_add_saml_provider_index_and_constraint_to_identities.rb
@@ -1,4 +1,4 @@
-class AddSamlProviderIndexAndConstraintToIdentities < ActiveRecord::Migration
+class AddSamlProviderIndexAndConstraintToIdentities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180503154922_add_indexes_to_project_mirror_data_ee.rb b/ee/db/migrate/20180503154922_add_indexes_to_project_mirror_data_ee.rb
index 70f4aaa5e2846..ab5316f13c622 100644
--- a/ee/db/migrate/20180503154922_add_indexes_to_project_mirror_data_ee.rb
+++ b/ee/db/migrate/20180503154922_add_indexes_to_project_mirror_data_ee.rb
@@ -1,4 +1,4 @@
-class AddIndexesToProjectMirrorDataEE < ActiveRecord::Migration
+class AddIndexesToProjectMirrorDataEE < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180520211048_add_discovery_token_to_namespaces.rb b/ee/db/migrate/20180520211048_add_discovery_token_to_namespaces.rb
index 9cab92f32aa69..8a1c5df68e661 100644
--- a/ee/db/migrate/20180520211048_add_discovery_token_to_namespaces.rb
+++ b/ee/db/migrate/20180520211048_add_discovery_token_to_namespaces.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddDiscoveryTokenToNamespaces < ActiveRecord::Migration
+class AddDiscoveryTokenToNamespaces < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180524115107_add_last_update_started_at_to_applications_prometheus.rb b/ee/db/migrate/20180524115107_add_last_update_started_at_to_applications_prometheus.rb
index 642fa076ec7b7..e55c1ad8ab94c 100644
--- a/ee/db/migrate/20180524115107_add_last_update_started_at_to_applications_prometheus.rb
+++ b/ee/db/migrate/20180524115107_add_last_update_started_at_to_applications_prometheus.rb
@@ -1,4 +1,4 @@
-class AddLastUpdateStartedAtToApplicationsPrometheus < ActiveRecord::Migration
+class AddLastUpdateStartedAtToApplicationsPrometheus < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180531031410_add_index_for_active_users.rb b/ee/db/migrate/20180531031410_add_index_for_active_users.rb
index fde042922f7ad..699bb9d407a80 100644
--- a/ee/db/migrate/20180531031410_add_index_for_active_users.rb
+++ b/ee/db/migrate/20180531031410_add_index_for_active_users.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddIndexForActiveUsers < ActiveRecord::Migration
+class AddIndexForActiveUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180531221734_add_pseudonymizer_enabled_to_application_settings.rb b/ee/db/migrate/20180531221734_add_pseudonymizer_enabled_to_application_settings.rb
index 7517e78a61873..41feb0eedf6a5 100644
--- a/ee/db/migrate/20180531221734_add_pseudonymizer_enabled_to_application_settings.rb
+++ b/ee/db/migrate/20180531221734_add_pseudonymizer_enabled_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddPseudonymizerEnabledToApplicationSettings < ActiveRecord::Migration
+class AddPseudonymizerEnabledToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180607154422_add_user_to_list.rb b/ee/db/migrate/20180607154422_add_user_to_list.rb
index 6fbe3069003f3..266b40f11e2d1 100644
--- a/ee/db/migrate/20180607154422_add_user_to_list.rb
+++ b/ee/db/migrate/20180607154422_add_user_to_list.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddUserToList < ActiveRecord::Migration
+class AddUserToList < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180607154516_add_user_index_to_list.rb b/ee/db/migrate/20180607154516_add_user_index_to_list.rb
index c1a2404cd7ff0..38f9b4a8caf46 100644
--- a/ee/db/migrate/20180607154516_add_user_index_to_list.rb
+++ b/ee/db/migrate/20180607154516_add_user_index_to_list.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddUserIndexToList < ActiveRecord::Migration
+class AddUserIndexToList < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180607154645_add_user_fk_to_list.rb b/ee/db/migrate/20180607154645_add_user_fk_to_list.rb
index 6b6b0bf3dfb95..65227380ea50e 100644
--- a/ee/db/migrate/20180607154645_add_user_fk_to_list.rb
+++ b/ee/db/migrate/20180607154645_add_user_fk_to_list.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddUserFkToList < ActiveRecord::Migration
+class AddUserFkToList < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180612175636_add_geo_nodes_verification_max_capacity.rb b/ee/db/migrate/20180612175636_add_geo_nodes_verification_max_capacity.rb
index 1237083525185..3be4bb847986a 100644
--- a/ee/db/migrate/20180612175636_add_geo_nodes_verification_max_capacity.rb
+++ b/ee/db/migrate/20180612175636_add_geo_nodes_verification_max_capacity.rb
@@ -1,4 +1,4 @@
-class AddGeoNodesVerificationMaxCapacity < ActiveRecord::Migration
+class AddGeoNodesVerificationMaxCapacity < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180615152524_add_project_to_application_settings.rb b/ee/db/migrate/20180615152524_add_project_to_application_settings.rb
index 441f6a4c7fba3..18dc6f7f12db2 100644
--- a/ee/db/migrate/20180615152524_add_project_to_application_settings.rb
+++ b/ee/db/migrate/20180615152524_add_project_to_application_settings.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddProjectToApplicationSettings < ActiveRecord::Migration
+class AddProjectToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180621100024_create_software_licenses.rb b/ee/db/migrate/20180621100024_create_software_licenses.rb
index 3cf3489957320..f7230bb1ac628 100644
--- a/ee/db/migrate/20180621100024_create_software_licenses.rb
+++ b/ee/db/migrate/20180621100024_create_software_licenses.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 # A software license. Used in the License Management feature for CI/CD.
-class CreateSoftwareLicenses < ActiveRecord::Migration
+class CreateSoftwareLicenses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180621100025_create_software_license_policies.rb b/ee/db/migrate/20180621100025_create_software_license_policies.rb
index 82165b6f130bf..95dceaa7ef46c 100644
--- a/ee/db/migrate/20180621100025_create_software_license_policies.rb
+++ b/ee/db/migrate/20180621100025_create_software_license_policies.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateSoftwareLicensePolicies < ActiveRecord::Migration
+class CreateSoftwareLicensePolicies < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180623053658_add_trial_ends_on_to_namespaces.rb b/ee/db/migrate/20180623053658_add_trial_ends_on_to_namespaces.rb
index 6ee6b7a67e991..3ef0829ed4516 100644
--- a/ee/db/migrate/20180623053658_add_trial_ends_on_to_namespaces.rb
+++ b/ee/db/migrate/20180623053658_add_trial_ends_on_to_namespaces.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddTrialEndsOnToNamespaces < ActiveRecord::Migration
+class AddTrialEndsOnToNamespaces < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180626171125_add_feature_flags_to_projects.rb b/ee/db/migrate/20180626171125_add_feature_flags_to_projects.rb
index c2ade6cc41311..bbdb7dcb245fb 100644
--- a/ee/db/migrate/20180626171125_add_feature_flags_to_projects.rb
+++ b/ee/db/migrate/20180626171125_add_feature_flags_to_projects.rb
@@ -1,4 +1,4 @@
-class AddFeatureFlagsToProjects < ActiveRecord::Migration
+class AddFeatureFlagsToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/migrate/20180702114215_schedule_weight_system_note_comma_cleanup.rb b/ee/db/migrate/20180702114215_schedule_weight_system_note_comma_cleanup.rb
index 0c738fc315d0d..2cf94d524f2c6 100644
--- a/ee/db/migrate/20180702114215_schedule_weight_system_note_comma_cleanup.rb
+++ b/ee/db/migrate/20180702114215_schedule_weight_system_note_comma_cleanup.rb
@@ -1,4 +1,4 @@
-class ScheduleWeightSystemNoteCommaCleanup < ActiveRecord::Migration
+class ScheduleWeightSystemNoteCommaCleanup < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180702181530_add_retry_fields_to_project_repository_states.rb b/ee/db/migrate/20180702181530_add_retry_fields_to_project_repository_states.rb
index 8a3de5bafd74a..fbdd3915129d2 100644
--- a/ee/db/migrate/20180702181530_add_retry_fields_to_project_repository_states.rb
+++ b/ee/db/migrate/20180702181530_add_retry_fields_to_project_repository_states.rb
@@ -1,4 +1,4 @@
-class AddRetryFieldsToProjectRepositoryStates < ActiveRecord::Migration
+class AddRetryFieldsToProjectRepositoryStates < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180709153607_add_custom_project_templates_group_id_to_application_settings.rb b/ee/db/migrate/20180709153607_add_custom_project_templates_group_id_to_application_settings.rb
index a0d249ae66f46..771033b55f982 100644
--- a/ee/db/migrate/20180709153607_add_custom_project_templates_group_id_to_application_settings.rb
+++ b/ee/db/migrate/20180709153607_add_custom_project_templates_group_id_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddCustomProjectTemplatesGroupIdToApplicationSettings < ActiveRecord::Migration
+class AddCustomProjectTemplatesGroupIdToApplicationSettings < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20180709183353_add_protected_environments_table.rb b/ee/db/migrate/20180709183353_add_protected_environments_table.rb
index 163a34d58c3c4..d2880e9fc9c14 100644
--- a/ee/db/migrate/20180709183353_add_protected_environments_table.rb
+++ b/ee/db/migrate/20180709183353_add_protected_environments_table.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddProtectedEnvironmentsTable < ActiveRecord::Migration
+class AddProtectedEnvironmentsTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180709184533_add_protected_environment_deploy_access_level_table.rb b/ee/db/migrate/20180709184533_add_protected_environment_deploy_access_level_table.rb
index 3acd4a1579aa1..97639b0097654 100644
--- a/ee/db/migrate/20180709184533_add_protected_environment_deploy_access_level_table.rb
+++ b/ee/db/migrate/20180709184533_add_protected_environment_deploy_access_level_table.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddProtectedEnvironmentDeployAccessLevelTable < ActiveRecord::Migration
+class AddProtectedEnvironmentDeployAccessLevelTable < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180711014025_add_date_columns_to_epics.rb b/ee/db/migrate/20180711014025_add_date_columns_to_epics.rb
index ae4e0ac31606c..e50bed7dddfc8 100644
--- a/ee/db/migrate/20180711014025_add_date_columns_to_epics.rb
+++ b/ee/db/migrate/20180711014025_add_date_columns_to_epics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddDateColumnsToEpics < ActiveRecord::Migration
+class AddDateColumnsToEpics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180711014026_update_date_columns_on_epics.rb b/ee/db/migrate/20180711014026_update_date_columns_on_epics.rb
index c39531940c138..ba0b13f193d88 100644
--- a/ee/db/migrate/20180711014026_update_date_columns_on_epics.rb
+++ b/ee/db/migrate/20180711014026_update_date_columns_on_epics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class UpdateDateColumnsOnEpics < ActiveRecord::Migration
+class UpdateDateColumnsOnEpics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180718100455_clean_up_from_weight_system_note_comma_migration.rb b/ee/db/migrate/20180718100455_clean_up_from_weight_system_note_comma_migration.rb
index 8a8ff62ef1397..715a8ebd4901e 100644
--- a/ee/db/migrate/20180718100455_clean_up_from_weight_system_note_comma_migration.rb
+++ b/ee/db/migrate/20180718100455_clean_up_from_weight_system_note_comma_migration.rb
@@ -1,4 +1,4 @@
-class CleanUpFromWeightSystemNoteCommaMigration < ActiveRecord::Migration
+class CleanUpFromWeightSystemNoteCommaMigration < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180719161844_add_storage_configuration_digest.rb b/ee/db/migrate/20180719161844_add_storage_configuration_digest.rb
index c6cc1b30fd3e0..801907cea9914 100644
--- a/ee/db/migrate/20180719161844_add_storage_configuration_digest.rb
+++ b/ee/db/migrate/20180719161844_add_storage_configuration_digest.rb
@@ -1,4 +1,4 @@
-class AddStorageConfigurationDigest < ActiveRecord::Migration
+class AddStorageConfigurationDigest < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180720082636_add_name_index_to_ci_builds.rb b/ee/db/migrate/20180720082636_add_name_index_to_ci_builds.rb
index 5d8f692ef2721..d0343dd3e9a1c 100644
--- a/ee/db/migrate/20180720082636_add_name_index_to_ci_builds.rb
+++ b/ee/db/migrate/20180720082636_add_name_index_to_ci_builds.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddNameIndexToCiBuilds < ActiveRecord::Migration
+class AddNameIndexToCiBuilds < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180720120716_create_packages_packages.rb b/ee/db/migrate/20180720120716_create_packages_packages.rb
index 847e5f86a249f..351a6a4015a56 100644
--- a/ee/db/migrate/20180720120716_create_packages_packages.rb
+++ b/ee/db/migrate/20180720120716_create_packages_packages.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class CreatePackagesPackages < ActiveRecord::Migration
+class CreatePackagesPackages < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180720120726_create_packages_package_files.rb b/ee/db/migrate/20180720120726_create_packages_package_files.rb
index 307646a0ce258..b5c0ebc5cc376 100644
--- a/ee/db/migrate/20180720120726_create_packages_package_files.rb
+++ b/ee/db/migrate/20180720120726_create_packages_package_files.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class CreatePackagesPackageFiles < ActiveRecord::Migration
+class CreatePackagesPackageFiles < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180720121404_create_packages_maven_metadata.rb b/ee/db/migrate/20180720121404_create_packages_maven_metadata.rb
index f41d02bb65ff2..36b1614aa1787 100644
--- a/ee/db/migrate/20180720121404_create_packages_maven_metadata.rb
+++ b/ee/db/migrate/20180720121404_create_packages_maven_metadata.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class CreatePackagesMavenMetadata < ActiveRecord::Migration
+class CreatePackagesMavenMetadata < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180723023517_add_new_epic_to_notification_settings.rb b/ee/db/migrate/20180723023517_add_new_epic_to_notification_settings.rb
index 93933c0c5856e..946a3a29831bb 100644
--- a/ee/db/migrate/20180723023517_add_new_epic_to_notification_settings.rb
+++ b/ee/db/migrate/20180723023517_add_new_epic_to_notification_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddNewEpicToNotificationSettings < ActiveRecord::Migration
+class AddNewEpicToNotificationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180723081631_add_roadmap_layout_to_users.rb b/ee/db/migrate/20180723081631_add_roadmap_layout_to_users.rb
index 3a01379ea70e1..1da2ff2d1f1e0 100644
--- a/ee/db/migrate/20180723081631_add_roadmap_layout_to_users.rb
+++ b/ee/db/migrate/20180723081631_add_roadmap_layout_to_users.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddRoadmapLayoutToUsers < ActiveRecord::Migration
+class AddRoadmapLayoutToUsers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180723134433_add_basic_snowplow_attributes_to_application_settings.rb b/ee/db/migrate/20180723134433_add_basic_snowplow_attributes_to_application_settings.rb
index 9bf3543216e01..d85ec45a71d42 100644
--- a/ee/db/migrate/20180723134433_add_basic_snowplow_attributes_to_application_settings.rb
+++ b/ee/db/migrate/20180723134433_add_basic_snowplow_attributes_to_application_settings.rb
@@ -1,4 +1,4 @@
-class AddBasicSnowplowAttributesToApplicationSettings < ActiveRecord::Migration
+class AddBasicSnowplowAttributesToApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180724161450_add_milestone_to_lists.rb b/ee/db/migrate/20180724161450_add_milestone_to_lists.rb
index 54d077ea57b87..b858504ab7272 100644
--- a/ee/db/migrate/20180724161450_add_milestone_to_lists.rb
+++ b/ee/db/migrate/20180724161450_add_milestone_to_lists.rb
@@ -1,4 +1,4 @@
-class AddMilestoneToLists < ActiveRecord::Migration
+class AddMilestoneToLists < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20180803001726_add_verification_retry_counts_to_geo_node_statuses.rb b/ee/db/migrate/20180803001726_add_verification_retry_counts_to_geo_node_statuses.rb
index fc91cd55a803d..0203e45ceff98 100644
--- a/ee/db/migrate/20180803001726_add_verification_retry_counts_to_geo_node_statuses.rb
+++ b/ee/db/migrate/20180803001726_add_verification_retry_counts_to_geo_node_statuses.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddVerificationRetryCountsToGeoNodeStatuses < ActiveRecord::Migration
+class AddVerificationRetryCountsToGeoNodeStatuses < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/migrate/20180803041220_add_projects_count_to_geo_node_statuses.rb b/ee/db/migrate/20180803041220_add_projects_count_to_geo_node_statuses.rb
index e50ef56f5c0b8..29567016b9a0e 100644
--- a/ee/db/migrate/20180803041220_add_projects_count_to_geo_node_statuses.rb
+++ b/ee/db/migrate/20180803041220_add_projects_count_to_geo_node_statuses.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class AddProjectsCountToGeoNodeStatuses < ActiveRecord::Migration
+class AddProjectsCountToGeoNodeStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180806145747_add_index_to_environment_name_for_like.rb b/ee/db/migrate/20180806145747_add_index_to_environment_name_for_like.rb
index 91e4ac8c52bcd..776286100ab7d 100644
--- a/ee/db/migrate/20180806145747_add_index_to_environment_name_for_like.rb
+++ b/ee/db/migrate/20180806145747_add_index_to_environment_name_for_like.rb
@@ -1,4 +1,4 @@
-class AddIndexToEnvironmentNameForLike < ActiveRecord::Migration
+class AddIndexToEnvironmentNameForLike < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180823132905_add_packages_enabled_to_project.rb b/ee/db/migrate/20180823132905_add_packages_enabled_to_project.rb
index 4312b5aa3b400..084cb9f19a42d 100644
--- a/ee/db/migrate/20180823132905_add_packages_enabled_to_project.rb
+++ b/ee/db/migrate/20180823132905_add_packages_enabled_to_project.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddPackagesEnabledToProject < ActiveRecord::Migration
+class AddPackagesEnabledToProject < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180831134049_allow_many_prometheus_alerts.rb b/ee/db/migrate/20180831134049_allow_many_prometheus_alerts.rb
index 5b9d19827ee28..b3c952827dc28 100644
--- a/ee/db/migrate/20180831134049_allow_many_prometheus_alerts.rb
+++ b/ee/db/migrate/20180831134049_allow_many_prometheus_alerts.rb
@@ -1,4 +1,4 @@
-class AllowManyPrometheusAlerts < ActiveRecord::Migration
+class AllowManyPrometheusAlerts < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180831152625_add_merge_requests_author_approval_to_projects.rb b/ee/db/migrate/20180831152625_add_merge_requests_author_approval_to_projects.rb
index 40c245be2642e..8fef233dd27ca 100644
--- a/ee/db/migrate/20180831152625_add_merge_requests_author_approval_to_projects.rb
+++ b/ee/db/migrate/20180831152625_add_merge_requests_author_approval_to_projects.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddMergeRequestsAuthorApprovalToProjects < ActiveRecord::Migration
+class AddMergeRequestsAuthorApprovalToProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180910104020_add_closed_columns_to_epic.rb b/ee/db/migrate/20180910104020_add_closed_columns_to_epic.rb
index a335831bd2421..2ad306b245215 100644
--- a/ee/db/migrate/20180910104020_add_closed_columns_to_epic.rb
+++ b/ee/db/migrate/20180910104020_add_closed_columns_to_epic.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddClosedColumnsToEpic < ActiveRecord::Migration
+class AddClosedColumnsToEpic < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20180910105100_add_state_to_epic.rb b/ee/db/migrate/20180910105100_add_state_to_epic.rb
index 4515c7bcb2b17..f8311853a2967 100644
--- a/ee/db/migrate/20180910105100_add_state_to_epic.rb
+++ b/ee/db/migrate/20180910105100_add_state_to_epic.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class AddStateToEpic < ActiveRecord::Migration
+class AddStateToEpic < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917145556_create_draft_notes.rb b/ee/db/migrate/20180917145556_create_draft_notes.rb
index 66ba767b53c87..38dae0fd94c16 100644
--- a/ee/db/migrate/20180917145556_create_draft_notes.rb
+++ b/ee/db/migrate/20180917145556_create_draft_notes.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
-class CreateDraftNotes < ActiveRecord::Migration
+class CreateDraftNotes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917171038_create_vulnerability_scanners.rb b/ee/db/migrate/20180917171038_create_vulnerability_scanners.rb
index fdf057f0c8a52..070839791a024 100644
--- a/ee/db/migrate/20180917171038_create_vulnerability_scanners.rb
+++ b/ee/db/migrate/20180917171038_create_vulnerability_scanners.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateVulnerabilityScanners < ActiveRecord::Migration
+class CreateVulnerabilityScanners < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917171533_create_vulnerability_occurrences.rb b/ee/db/migrate/20180917171533_create_vulnerability_occurrences.rb
index 23e4b36ba0719..01074083db348 100644
--- a/ee/db/migrate/20180917171533_create_vulnerability_occurrences.rb
+++ b/ee/db/migrate/20180917171533_create_vulnerability_occurrences.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateVulnerabilityOccurrences < ActiveRecord::Migration
+class CreateVulnerabilityOccurrences < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917171534_create_vulnerability_identifiers.rb b/ee/db/migrate/20180917171534_create_vulnerability_identifiers.rb
index 0321a332bbfcf..3c77d79b9edb3 100644
--- a/ee/db/migrate/20180917171534_create_vulnerability_identifiers.rb
+++ b/ee/db/migrate/20180917171534_create_vulnerability_identifiers.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateVulnerabilityIdentifiers < ActiveRecord::Migration
+class CreateVulnerabilityIdentifiers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917171535_create_vulnerability_occurrence_identifiers.rb b/ee/db/migrate/20180917171535_create_vulnerability_occurrence_identifiers.rb
index 0d1388fc91d45..4bb9e7dac34cc 100644
--- a/ee/db/migrate/20180917171535_create_vulnerability_occurrence_identifiers.rb
+++ b/ee/db/migrate/20180917171535_create_vulnerability_occurrence_identifiers.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateVulnerabilityOccurrenceIdentifiers < ActiveRecord::Migration
+class CreateVulnerabilityOccurrenceIdentifiers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917213751_create_geo_reset_checksum_events.rb b/ee/db/migrate/20180917213751_create_geo_reset_checksum_events.rb
index 59b11a3886bf2..2a47afc8619a5 100644
--- a/ee/db/migrate/20180917213751_create_geo_reset_checksum_events.rb
+++ b/ee/db/migrate/20180917213751_create_geo_reset_checksum_events.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateGeoResetChecksumEvents < ActiveRecord::Migration
+class CreateGeoResetChecksumEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180917214204_add_geo_reset_checksum_events_foreign_key.rb b/ee/db/migrate/20180917214204_add_geo_reset_checksum_events_foreign_key.rb
index 7c92cf2d62645..70f8480cefb1d 100644
--- a/ee/db/migrate/20180917214204_add_geo_reset_checksum_events_foreign_key.rb
+++ b/ee/db/migrate/20180917214204_add_geo_reset_checksum_events_foreign_key.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddGeoResetChecksumEventsForeignKey < ActiveRecord::Migration
+class AddGeoResetChecksumEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180920043317_add_foreign_key_to_epics.rb b/ee/db/migrate/20180920043317_add_foreign_key_to_epics.rb
index fb59418d3696d..efa6545b8bcd4 100644
--- a/ee/db/migrate/20180920043317_add_foreign_key_to_epics.rb
+++ b/ee/db/migrate/20180920043317_add_foreign_key_to_epics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddForeignKeyToEpics < ActiveRecord::Migration
+class AddForeignKeyToEpics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180924070647_add_label_event_epic_column.rb b/ee/db/migrate/20180924070647_add_label_event_epic_column.rb
index a2bc6b8447d73..58fb56f92266c 100644
--- a/ee/db/migrate/20180924070647_add_label_event_epic_column.rb
+++ b/ee/db/migrate/20180924070647_add_label_event_epic_column.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddLabelEventEpicColumn < ActiveRecord::Migration
+class AddLabelEventEpicColumn < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/migrate/20180926101838_add_namespace_file_template_project_id.rb b/ee/db/migrate/20180926101838_add_namespace_file_template_project_id.rb
index 0070bb2cdb06a..222bb1019bbef 100644
--- a/ee/db/migrate/20180926101838_add_namespace_file_template_project_id.rb
+++ b/ee/db/migrate/20180926101838_add_namespace_file_template_project_id.rb
@@ -1,4 +1,4 @@
-class AddNamespaceFileTemplateProjectId < ActiveRecord::Migration
+class AddNamespaceFileTemplateProjectId < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180926140319_create_prometheus_alert_events.rb b/ee/db/migrate/20180926140319_create_prometheus_alert_events.rb
index 893ef73ed011e..c6dc366833e74 100644
--- a/ee/db/migrate/20180926140319_create_prometheus_alert_events.rb
+++ b/ee/db/migrate/20180926140319_create_prometheus_alert_events.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreatePrometheusAlertEvents < ActiveRecord::Migration
+class CreatePrometheusAlertEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20180930171532_recreate_vulnerability_occurrences_and_vulnerability_occurrence_identifiers.rb b/ee/db/migrate/20180930171532_recreate_vulnerability_occurrences_and_vulnerability_occurrence_identifiers.rb
index 35cf206ac45ed..c47eb386a37bb 100644
--- a/ee/db/migrate/20180930171532_recreate_vulnerability_occurrences_and_vulnerability_occurrence_identifiers.rb
+++ b/ee/db/migrate/20180930171532_recreate_vulnerability_occurrences_and_vulnerability_occurrence_identifiers.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class RecreateVulnerabilityOccurrencesAndVulnerabilityOccurrenceIdentifiers < ActiveRecord::Migration
+class RecreateVulnerabilityOccurrencesAndVulnerabilityOccurrenceIdentifiers < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181001172126_create_geo_cache_invalidation_events.rb b/ee/db/migrate/20181001172126_create_geo_cache_invalidation_events.rb
index 4bd5d36fb951d..5d395a2407286 100644
--- a/ee/db/migrate/20181001172126_create_geo_cache_invalidation_events.rb
+++ b/ee/db/migrate/20181001172126_create_geo_cache_invalidation_events.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateGeoCacheInvalidationEvents < ActiveRecord::Migration
+class CreateGeoCacheInvalidationEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181001172651_add_geo_cache_invalidation_events_foreign_key.rb b/ee/db/migrate/20181001172651_add_geo_cache_invalidation_events_foreign_key.rb
index 9b131f642722d..59264ab42fce3 100644
--- a/ee/db/migrate/20181001172651_add_geo_cache_invalidation_events_foreign_key.rb
+++ b/ee/db/migrate/20181001172651_add_geo_cache_invalidation_events_foreign_key.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddGeoCacheInvalidationEventsForeignKey < ActiveRecord::Migration
+class AddGeoCacheInvalidationEventsForeignKey < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181004131020_change_vuln_occurrence_columns.rb b/ee/db/migrate/20181004131020_change_vuln_occurrence_columns.rb
index 8362ac45e9a96..e5e6675427138 100644
--- a/ee/db/migrate/20181004131020_change_vuln_occurrence_columns.rb
+++ b/ee/db/migrate/20181004131020_change_vuln_occurrence_columns.rb
@@ -1,4 +1,4 @@
-class ChangeVulnOccurrenceColumns < ActiveRecord::Migration
+class ChangeVulnOccurrenceColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181004131025_add_vuln_occurrence_pipelines.rb b/ee/db/migrate/20181004131025_add_vuln_occurrence_pipelines.rb
index 6227c7fadffbb..c59f566119b1c 100644
--- a/ee/db/migrate/20181004131025_add_vuln_occurrence_pipelines.rb
+++ b/ee/db/migrate/20181004131025_add_vuln_occurrence_pipelines.rb
@@ -1,4 +1,4 @@
-class AddVulnOccurrencePipelines < ActiveRecord::Migration
+class AddVulnOccurrencePipelines < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181012151642_create_users_ops_dashboard_projects.rb b/ee/db/migrate/20181012151642_create_users_ops_dashboard_projects.rb
index 55518ace6662e..a9906dd8658f8 100644
--- a/ee/db/migrate/20181012151642_create_users_ops_dashboard_projects.rb
+++ b/ee/db/migrate/20181012151642_create_users_ops_dashboard_projects.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateUsersOpsDashboardProjects < ActiveRecord::Migration
+class CreateUsersOpsDashboardProjects < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181017131623_add_missing_geo_even_log_indexes.rb b/ee/db/migrate/20181017131623_add_missing_geo_even_log_indexes.rb
index 55fb2ac5f5a10..304bc8af65a10 100644
--- a/ee/db/migrate/20181017131623_add_missing_geo_even_log_indexes.rb
+++ b/ee/db/migrate/20181017131623_add_missing_geo_even_log_indexes.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddMissingGeoEvenLogIndexes < ActiveRecord::Migration
+class AddMissingGeoEvenLogIndexes < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181022131445_add_index_to_namespace_trial_ends_on.rb b/ee/db/migrate/20181022131445_add_index_to_namespace_trial_ends_on.rb
index c70c3820e924c..a93e0ed8b7306 100644
--- a/ee/db/migrate/20181022131445_add_index_to_namespace_trial_ends_on.rb
+++ b/ee/db/migrate/20181022131445_add_index_to_namespace_trial_ends_on.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToNamespaceTrialEndsOn < ActiveRecord::Migration
+class AddIndexToNamespaceTrialEndsOn < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181025000427_add_tracing_settings.rb b/ee/db/migrate/20181025000427_add_tracing_settings.rb
index 3cafbef75b85e..552bbfdcef369 100644
--- a/ee/db/migrate/20181025000427_add_tracing_settings.rb
+++ b/ee/db/migrate/20181025000427_add_tracing_settings.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddTracingSettings < ActiveRecord::Migration
+class AddTracingSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181028092114_create_smartcard_identities.rb b/ee/db/migrate/20181028092114_create_smartcard_identities.rb
index a1efcecfacc19..65fd56dd8c427 100644
--- a/ee/db/migrate/20181028092114_create_smartcard_identities.rb
+++ b/ee/db/migrate/20181028092114_create_smartcard_identities.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class CreateSmartcardIdentities < ActiveRecord::Migration
+class CreateSmartcardIdentities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181028092115_add_index_to_smartcard_identities.rb b/ee/db/migrate/20181028092115_add_index_to_smartcard_identities.rb
index db6cc16525095..0ad53c081b860 100644
--- a/ee/db/migrate/20181028092115_add_index_to_smartcard_identities.rb
+++ b/ee/db/migrate/20181028092115_add_index_to_smartcard_identities.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddIndexToSmartcardIdentities < ActiveRecord::Migration
+class AddIndexToSmartcardIdentities < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/migrate/20181105122803_add_missing_indexes_for_foreign_keys_ee.rb b/ee/db/migrate/20181105122803_add_missing_indexes_for_foreign_keys_ee.rb
index 4fccd3fc20da7..c61730e49df76 100644
--- a/ee/db/migrate/20181105122803_add_missing_indexes_for_foreign_keys_ee.rb
+++ b/ee/db/migrate/20181105122803_add_missing_indexes_for_foreign_keys_ee.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration
+class AddMissingIndexesForForeignKeysEE < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20170427111108_remove_sync_time_column_from_remote_mirrors.rb b/ee/db/post_migrate/20170427111108_remove_sync_time_column_from_remote_mirrors.rb
index d26325c838fd1..90072f4808d21 100644
--- a/ee/db/post_migrate/20170427111108_remove_sync_time_column_from_remote_mirrors.rb
+++ b/ee/db/post_migrate/20170427111108_remove_sync_time_column_from_remote_mirrors.rb
@@ -1,4 +1,4 @@
-class RemoveSyncTimeColumnFromRemoteMirrors < ActiveRecord::Migration
+class RemoveSyncTimeColumnFromRemoteMirrors < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20170510101016_remove_sync_time_from_project_mirrors_and_minimum_mirror_sync_time_from_application_settings.rb b/ee/db/post_migrate/20170510101016_remove_sync_time_from_project_mirrors_and_minimum_mirror_sync_time_from_application_settings.rb
index c5bc5581cb99f..53de74868adea 100644
--- a/ee/db/post_migrate/20170510101016_remove_sync_time_from_project_mirrors_and_minimum_mirror_sync_time_from_application_settings.rb
+++ b/ee/db/post_migrate/20170510101016_remove_sync_time_from_project_mirrors_and_minimum_mirror_sync_time_from_application_settings.rb
@@ -1,4 +1,4 @@
-class RemoveSyncTimeFromProjectMirrorsAndMinimumMirrorSyncTimeFromApplicationSettings < ActiveRecord::Migration
+class RemoveSyncTimeFromProjectMirrorsAndMinimumMirrorSyncTimeFromApplicationSettings < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20170530111134_ensure_project_mirror_data.rb b/ee/db/post_migrate/20170530111134_ensure_project_mirror_data.rb
index d62f9a2452b07..7f9a7d9a9c6cc 100644
--- a/ee/db/post_migrate/20170530111134_ensure_project_mirror_data.rb
+++ b/ee/db/post_migrate/20170530111134_ensure_project_mirror_data.rb
@@ -1,4 +1,4 @@
-class EnsureProjectMirrorData < ActiveRecord::Migration
+class EnsureProjectMirrorData < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20170808163512_remove_plan_from_namespaces.rb b/ee/db/post_migrate/20170808163512_remove_plan_from_namespaces.rb
index e4daea5d92087..71010a85c9a8e 100644
--- a/ee/db/post_migrate/20170808163512_remove_plan_from_namespaces.rb
+++ b/ee/db/post_migrate/20170808163512_remove_plan_from_namespaces.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemovePlanFromNamespaces < ActiveRecord::Migration
+class RemovePlanFromNamespaces < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def change
diff --git a/ee/db/post_migrate/20170811082658_remove_system_hook_from_geo_nodes.rb b/ee/db/post_migrate/20170811082658_remove_system_hook_from_geo_nodes.rb
index 03f3009beb24b..9a05a845a5c51 100644
--- a/ee/db/post_migrate/20170811082658_remove_system_hook_from_geo_nodes.rb
+++ b/ee/db/post_migrate/20170811082658_remove_system_hook_from_geo_nodes.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveSystemHookFromGeoNodes < ActiveRecord::Migration
+class RemoveSystemHookFromGeoNodes < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/post_migrate/20171103152048_geo_drain_redis_queues.rb b/ee/db/post_migrate/20171103152048_geo_drain_redis_queues.rb
index 71d9ef0b02941..411a7bf7acdfa 100644
--- a/ee/db/post_migrate/20171103152048_geo_drain_redis_queues.rb
+++ b/ee/db/post_migrate/20171103152048_geo_drain_redis_queues.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class GeoDrainRedisQueues < ActiveRecord::Migration
+class GeoDrainRedisQueues < ActiveRecord::Migration[4.2]
   DOWNTIME = false
   GEO_NAMESPACE = 'geo:gitlab'.freeze
 
diff --git a/ee/db/post_migrate/20171124165823_remove_geo_nodes_url_part_columns.rb b/ee/db/post_migrate/20171124165823_remove_geo_nodes_url_part_columns.rb
index b4b725da56a5f..8dedcbed1f150 100644
--- a/ee/db/post_migrate/20171124165823_remove_geo_nodes_url_part_columns.rb
+++ b/ee/db/post_migrate/20171124165823_remove_geo_nodes_url_part_columns.rb
@@ -1,4 +1,4 @@
-class RemoveGeoNodesUrlPartColumns < ActiveRecord::Migration
+class RemoveGeoNodesUrlPartColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20171124182517_remove_geo_ssh_repo_sync.rb b/ee/db/post_migrate/20171124182517_remove_geo_ssh_repo_sync.rb
index 581940c488f09..7a2ec7ab05262 100644
--- a/ee/db/post_migrate/20171124182517_remove_geo_ssh_repo_sync.rb
+++ b/ee/db/post_migrate/20171124182517_remove_geo_ssh_repo_sync.rb
@@ -1,4 +1,4 @@
-class RemoveGeoSshRepoSync < ActiveRecord::Migration
+class RemoveGeoSshRepoSync < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20171201140229_cleanup_remote_mirror_available_rename.rb b/ee/db/post_migrate/20171201140229_cleanup_remote_mirror_available_rename.rb
index acab2f524adbc..2971b65f24ad1 100644
--- a/ee/db/post_migrate/20171201140229_cleanup_remote_mirror_available_rename.rb
+++ b/ee/db/post_migrate/20171201140229_cleanup_remote_mirror_available_rename.rb
@@ -1,4 +1,4 @@
-class CleanupRemoteMirrorAvailableRename < ActiveRecord::Migration
+class CleanupRemoteMirrorAvailableRename < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180309215236_remove_last_verication_at_columns_from_project_repository_states.rb b/ee/db/post_migrate/20180309215236_remove_last_verication_at_columns_from_project_repository_states.rb
index 6da9cc82052ae..e03beca48cb69 100644
--- a/ee/db/post_migrate/20180309215236_remove_last_verication_at_columns_from_project_repository_states.rb
+++ b/ee/db/post_migrate/20180309215236_remove_last_verication_at_columns_from_project_repository_states.rb
@@ -1,4 +1,4 @@
-class RemoveLastVericationAtColumnsFromProjectRepositoryStates < ActiveRecord::Migration
+class RemoveLastVericationAtColumnsFromProjectRepositoryStates < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/post_migrate/20180314172513_remove_last_verication_failed_columns_from_project_repository_states.rb b/ee/db/post_migrate/20180314172513_remove_last_verication_failed_columns_from_project_repository_states.rb
index ee36cc32785d7..58f48905e9031 100644
--- a/ee/db/post_migrate/20180314172513_remove_last_verication_failed_columns_from_project_repository_states.rb
+++ b/ee/db/post_migrate/20180314172513_remove_last_verication_failed_columns_from_project_repository_states.rb
@@ -1,4 +1,4 @@
-class RemoveLastVericationFailedColumnsFromProjectRepositoryStates < ActiveRecord::Migration
+class RemoveLastVericationFailedColumnsFromProjectRepositoryStates < ActiveRecord::Migration[4.2]
   DOWNTIME = false
 
   def up
diff --git a/ee/db/post_migrate/20180417102933_drop_repository_storage_events_for_geo_events.rb b/ee/db/post_migrate/20180417102933_drop_repository_storage_events_for_geo_events.rb
index 0767f860e0591..b10de2c22f382 100644
--- a/ee/db/post_migrate/20180417102933_drop_repository_storage_events_for_geo_events.rb
+++ b/ee/db/post_migrate/20180417102933_drop_repository_storage_events_for_geo_events.rb
@@ -1,7 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class DropRepositoryStorageEventsForGeoEvents < ActiveRecord::Migration
+class DropRepositoryStorageEventsForGeoEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   disable_ddl_transaction!
diff --git a/ee/db/post_migrate/20180502130136_migrate_mirror_attributes_data_from_projects_to_import_state.rb b/ee/db/post_migrate/20180502130136_migrate_mirror_attributes_data_from_projects_to_import_state.rb
index ccdf2917acd73..d1f90950f7c3e 100644
--- a/ee/db/post_migrate/20180502130136_migrate_mirror_attributes_data_from_projects_to_import_state.rb
+++ b/ee/db/post_migrate/20180502130136_migrate_mirror_attributes_data_from_projects_to_import_state.rb
@@ -1,4 +1,4 @@
-class MigrateMirrorAttributesDataFromProjectsToImportState < ActiveRecord::Migration
+class MigrateMirrorAttributesDataFromProjectsToImportState < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180509091305_remove_project_mirror_data_created_at_updated_at.rb b/ee/db/post_migrate/20180509091305_remove_project_mirror_data_created_at_updated_at.rb
index 768882d079baa..0ad54357d85ab 100644
--- a/ee/db/post_migrate/20180509091305_remove_project_mirror_data_created_at_updated_at.rb
+++ b/ee/db/post_migrate/20180509091305_remove_project_mirror_data_created_at_updated_at.rb
@@ -1,4 +1,4 @@
-class RemoveProjectMirrorDataCreatedAtUpdatedAt < ActiveRecord::Migration
+class RemoveProjectMirrorDataCreatedAtUpdatedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/ee/db/post_migrate/20180605213516_fix_partial_index_to_project_repository_states_checksum_columns.rb b/ee/db/post_migrate/20180605213516_fix_partial_index_to_project_repository_states_checksum_columns.rb
index e191bc479a49f..3257db11e4ba8 100644
--- a/ee/db/post_migrate/20180605213516_fix_partial_index_to_project_repository_states_checksum_columns.rb
+++ b/ee/db/post_migrate/20180605213516_fix_partial_index_to_project_repository_states_checksum_columns.rb
@@ -1,4 +1,4 @@
-class FixPartialIndexToProjectRepositoryStatesChecksumColumns < ActiveRecord::Migration
+class FixPartialIndexToProjectRepositoryStatesChecksumColumns < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180608150653_add_index_to_projects_on_repository_storage_last_repository_updated_at.rb b/ee/db/post_migrate/20180608150653_add_index_to_projects_on_repository_storage_last_repository_updated_at.rb
index ad9825c41db59..9bcc836a8a82f 100644
--- a/ee/db/post_migrate/20180608150653_add_index_to_projects_on_repository_storage_last_repository_updated_at.rb
+++ b/ee/db/post_migrate/20180608150653_add_index_to_projects_on_repository_storage_last_repository_updated_at.rb
@@ -1,4 +1,4 @@
-class AddIndexToProjectsOnRepositoryStorageLastRepositoryUpdatedAt < ActiveRecord::Migration
+class AddIndexToProjectsOnRepositoryStorageLastRepositoryUpdatedAt < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180618193715_schedule_prune_orphaned_geo_events.rb b/ee/db/post_migrate/20180618193715_schedule_prune_orphaned_geo_events.rb
index e445f7f91e324..e03596047ff1b 100644
--- a/ee/db/post_migrate/20180618193715_schedule_prune_orphaned_geo_events.rb
+++ b/ee/db/post_migrate/20180618193715_schedule_prune_orphaned_geo_events.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class SchedulePruneOrphanedGeoEvents < ActiveRecord::Migration
+class SchedulePruneOrphanedGeoEvents < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180713171825_update_epic_dates_from_milestones.rb b/ee/db/post_migrate/20180713171825_update_epic_dates_from_milestones.rb
index d71840b3d7bed..7268d554bf43d 100644
--- a/ee/db/post_migrate/20180713171825_update_epic_dates_from_milestones.rb
+++ b/ee/db/post_migrate/20180713171825_update_epic_dates_from_milestones.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class UpdateEpicDatesFromMilestones < ActiveRecord::Migration
+class UpdateEpicDatesFromMilestones < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180815043102_remove_wikis_count_and_repositories_count_from_geo_node_statuses.rb b/ee/db/post_migrate/20180815043102_remove_wikis_count_and_repositories_count_from_geo_node_statuses.rb
index 4f8c81f28e7c2..f3ade1bb6e00e 100644
--- a/ee/db/post_migrate/20180815043102_remove_wikis_count_and_repositories_count_from_geo_node_statuses.rb
+++ b/ee/db/post_migrate/20180815043102_remove_wikis_count_and_repositories_count_from_geo_node_statuses.rb
@@ -2,7 +2,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class RemoveWikisCountAndRepositoriesCountFromGeoNodeStatuses < ActiveRecord::Migration
+class RemoveWikisCountAndRepositoriesCountFromGeoNodeStatuses < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20180914195058_schedule_repository_checksum_cleanup.rb b/ee/db/post_migrate/20180914195058_schedule_repository_checksum_cleanup.rb
index a0d302b01f88c..9c710b5b4582e 100644
--- a/ee/db/post_migrate/20180914195058_schedule_repository_checksum_cleanup.rb
+++ b/ee/db/post_migrate/20180914195058_schedule_repository_checksum_cleanup.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class ScheduleRepositoryChecksumCleanup < ActiveRecord::Migration
+class ScheduleRepositoryChecksumCleanup < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/ee/db/post_migrate/20181014131030_enqueue_redact_links_in_epics.rb b/ee/db/post_migrate/20181014131030_enqueue_redact_links_in_epics.rb
index 2a3e7fe89fe2b..33de14ee946e8 100644
--- a/ee/db/post_migrate/20181014131030_enqueue_redact_links_in_epics.rb
+++ b/ee/db/post_migrate/20181014131030_enqueue_redact_links_in_epics.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class EnqueueRedactLinksInEpics < ActiveRecord::Migration
+class EnqueueRedactLinksInEpics < ActiveRecord::Migration[4.2]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/generator_templates/active_record/migration/create_table_migration.rb b/generator_templates/active_record/migration/create_table_migration.rb
index 92e963911d0a9..4a6bea2796ceb 100644
--- a/generator_templates/active_record/migration/create_table_migration.rb
+++ b/generator_templates/active_record/migration/create_table_migration.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class <%= migration_class_name %> < ActiveRecord::Migration
+class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/generator_templates/active_record/migration/migration.rb b/generator_templates/active_record/migration/migration.rb
index 38edab825509f..153280cd4b7ec 100644
--- a/generator_templates/active_record/migration/migration.rb
+++ b/generator_templates/active_record/migration/migration.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class <%= migration_class_name %> < ActiveRecord::Migration
+class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
   include Gitlab::Database::MigrationHelpers
 
   # Set this constant to true if this migration requires downtime.
diff --git a/generator_templates/rails/post_deployment_migration/migration.rb b/generator_templates/rails/post_deployment_migration/migration.rb
index 353709f7c9ca1..4c1685545b558 100644
--- a/generator_templates/rails/post_deployment_migration/migration.rb
+++ b/generator_templates/rails/post_deployment_migration/migration.rb
@@ -3,7 +3,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
-class <%= migration_class_name %> < ActiveRecord::Migration
+class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
   include Gitlab::Database::MigrationHelpers
 
   DOWNTIME = false
diff --git a/lib/rails4_migration_version.rb b/lib/rails4_migration_version.rb
new file mode 100644
index 0000000000000..ae48734dfad06
--- /dev/null
+++ b/lib/rails4_migration_version.rb
@@ -0,0 +1,16 @@
+# rubocop:disable Naming/FileName
+# frozen_string_literal: true
+
+# When switching to rails 5, we added migration version to all migration
+# classes. This patch makes it possible to run versioned migrations
+# also with rails 4
+
+unless Gitlab.rails5?
+  module ActiveRecord
+    class Migration
+      def self.[](version)
+        Migration
+      end
+    end
+  end
+end
-- 
GitLab