gitlab-org--gitlab-foss/db/post_migrate
Yorick Peterse 6ef87a2083
Merge issuable "reopened" state into "opened"
Having two states that essentially mean the same thing is very much like
having a boolean "true" and boolean "mostly-true": it's rather silly.
This commit merges the "reopened" state into the "opened" state while
taking care of system notes still showing messages along the lines of
"Alice reopened this issue".

A big benefit from having only two states (opened and closed) is that
indexing and querying becomes simpler and more performant. For example,
to get all the opened queries we no longer have to query both states:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state IN ('opened', 'reopened');

Instead we can query a single state directly, which can be much faster:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state = 'opened';

Further, only having two states makes indexing easier as we will only
ever filter (and thus scan an index) using a single value. Partial
indexes could help but aren't supported on MySQL, complicating the
development process and not being helpful for MySQL.
2017-07-28 13:31:51 +02:00
..
.gitkeep
20160824121037_change_personal_access_tokens_default_back_to_empty_array.rb
20161011222551_remove_inactive_jira_service_properties.rb
20161109150329_fix_project_records_with_invalid_visibility.rb Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
20161128170531_drop_user_activities_table.rb
20161221140236_remove_unneeded_services.rb
20161221153951_rename_reserved_project_names.rb Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
20170104150317_requeue_pending_delete_projects.rb Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
20170106142508_fill_authorized_projects.rb Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
20170106172224_remove_project_authorizations_id_column.rb
20170131214021_reset_users_authorized_projects_populated.rb
20170206040400_remove_inactive_default_email_services.rb
20170206101007_remove_trackable_columns_from_timelogs.rb
20170206101030_validate_foreign_keys_on_timelogs.rb
20170209140523_validate_foreign_keys_on_oauth_openid_requests.rb
20170211073944_disable_invalid_service_templates.rb
20170214111112_delete_deprecated_gitlab_ci_service.rb
20170215200045_remove_theme_id_from_users.rb
20170301205640_migrate_build_events_to_pipeline_events.rb
20170306170512_migrate_legacy_manual_actions.rb
20170309171644_reset_relative_position_for_issue.rb Disable transactions in migrations that should not use it 2017-06-21 14:35:06 +02:00
20170313133418_rename_more_reserved_project_names.rb Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
20170317162059_update_upload_paths_to_system.rb Disable transactions in migrations that should not use it 2017-06-21 14:35:06 +02:00
20170324160416_migrate_user_activities_to_users_last_activity_on.rb Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
20170404170532_remove_notes_original_discussion_id.rb
20170406111121_clean_upload_symlinks.rb Merge branch 'bvl-remove-appearance-symlink' into 'security-9-3' 2017-07-19 22:28:17 -05:00
20170406142253_migrate_user_project_view.rb Disable transactions in migrations that should not use it 2017-06-21 14:35:06 +02:00
20170408033905_remove_old_cache_directories.rb
20170412174900_rename_reserved_dynamic_paths.rb
20170425121605_migrate_trigger_schedules_to_pipeline_schedules.rb
20170425130047_drop_ci_trigger_schedules_table.rb
20170502070007_enable_auto_cancel_pending_pipelines_for_all.rb Disable statement timeout in CI pipelines migration 2017-06-19 14:45:50 +02:00
20170502101023_cleanup_namespaceless_pending_delete_projects.rb Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
20170503004427_update_retried_for_ci_build.rb
20170503120310_remove_users_authorized_projects_populated.rb
20170508170547_add_head_pipeline_for_each_merge_request.rb Merge branch 'master' into fix/gb/improve-updating-column-in-batches-helper 2017-06-22 12:37:38 +02:00
20170510101043_add_foreign_key_on_pipeline_schedule_owner.rb
20170511100900_cleanup_rename_web_hooks_build_events_to_job_events.rb
20170511101000_cleanup_rename_services_build_events_to_job_events.rb
20170516165238_cleanup_trigger_for_issues.rb
20170516181025_add_constraints_to_issue_assignees_table.rb
20170518200835_rename_users_with_renamed_namespace.rb
20170518231126_fix_wrongly_renamed_routes.rb
20170523083112_migrate_old_artifacts.rb
20170525140254_rename_all_reserved_paths_again.rb Disable statement timeout 2017-06-26 17:49:30 +02:00
20170526185842_migrate_pipeline_stages.rb
20170526185858_create_index_in_pipeline_stages.rb
20170526185901_remove_stage_id_index_from_builds.rb Fix adding/removing foreign keys on MySQL 2017-06-21 13:18:38 +02:00
20170526185921_migrate_build_stage_reference.rb Fix migration specs that can not run within transaction 2017-06-21 16:21:12 +02:00
20170526190000_migrate_build_stage_reference_again.rb Bump build stage id reference migration identifier 2017-06-21 13:55:28 +02:00
20170531203055_cleanup_users_ldap_email_rename.rb
20170606202615_move_appearance_to_system_dir.rb
20170607121233_convert_custom_notification_settings_to_columns.rb
20170609183112_remove_position_from_issuables.rb Migration - Remove position field from issues and merge requests 2017-06-16 12:03:15 -03:00
20170612071012_move_personal_snippets_files.rb Merge branch '33359-pers-snippet-files-location' into 'security-9-3' 2017-07-19 22:28:27 -05:00
20170613111224_clean_appearance_symlinks.rb Merge branch 'bvl-remove-appearance-symlink' into 'security-9-3' 2017-07-19 22:28:17 -05:00
20170621102400_add_stage_id_index_to_builds.rb Improve stage_id in ci_builds foreign key migration 2017-07-03 20:24:32 +02:00
20170628080858_migrate_stage_id_reference_in_background.rb Do not schedule bg migration when it is not needed 2017-07-07 15:50:33 +02:00
20170629180131_cleanup_application_settings_signin_enabled_rename.rb Fixes needed when GitLab sign-in is not enabled 2017-07-13 10:08:27 -04:00
20170717111152_cleanup_move_system_upload_folder_symlink.rb Move the `uploads/system` folder to `uploads/-/system` 2017-07-18 15:38:54 +02:00
20170717150329_enqueue_migrate_system_uploads_to_new_folder.rb Add a background migration to rename `uploads` in the uploads table 2017-07-18 15:38:54 +02:00
20170719150301_merge_issuable_reopened_into_opened_state.rb Merge issuable "reopened" state into "opened" 2017-07-28 13:31:51 +02:00