gitlab-org--gitlab-foss/db/migrate
Robert Speicher 01f6db4f64 Disallow blank (non-null) values for a Note's line_code attribute
It's unclear how these blank values got added, but GitLab.com had a few:

```
irb(main):002:0> Note.where("line_code IS NOT NULL AND line_code = ''").count
=> 439
```

We've added a migration to convert any existing records to use a NULL
value when blank, and updated Note to set blank values to nil before
validation.
2016-03-11 17:46:50 -05:00
..
20121220064453_init_schema.rb
20130102143055_rename_owner_to_creator_for_project.rb
20130110172407_add_public_to_project.rb
20130123114545_add_issues_tracker_to_project.rb
20130125090214_add_user_permissions.rb
20130131070232_remove_private_flag_from_project.rb
20130206084024_add_description_to_namsespace.rb
20130207104426_add_description_to_teams.rb
20130211085435_add_issues_tracker_id_to_project.rb
20130214154045_rename_state_to_merge_status_in_milestone.rb
20130218140952_add_state_to_issue.rb
20130218141038_add_state_to_merge_request.rb
20130218141117_add_state_to_milestone.rb
20130218141258_convert_closed_to_state_in_issue.rb
20130218141327_convert_closed_to_state_in_merge_request.rb
20130218141344_convert_closed_to_state_in_milestone.rb
20130218141444_remove_merged_from_merge_request.rb
20130218141507_remove_closed_from_issue.rb
20130218141536_remove_closed_from_merge_request.rb
20130218141554_remove_closed_from_milestone.rb
20130220124204_add_new_merge_status_to_merge_request.rb
20130220125544_convert_merge_status_in_merge_request.rb
20130220125545_remove_merge_status_from_merge_request.rb
20130220133245_rename_new_merge_status_to_merge_status_in_milestone.rb
20130304104623_add_state_to_user.rb
20130304104740_convert_blocked_to_state.rb
20130304105317_remove_blocked_from_user.rb
20130315124931_user_color_scheme.rb
20130318212250_add_snippets_to_features.rb
20130319214458_create_forked_project_links.rb
20130323174317_add_private_to_snippets.rb
20130324151736_add_type_to_snippets.rb
20130324172327_change_project_id_to_null_in_snipepts.rb
20130324203535_add_type_value_for_snippets.rb
20130325173941_add_notification_level_to_user.rb
20130326142630_add_index_to_users_authentication_token.rb
20130403003950_add_last_activity_column_into_project.rb
20130404164628_add_notification_level_to_user_project.rb
20130410175022_remove_wiki_table.rb
20130419190306_allow_merges_for_forks.rb
20130506085413_add_type_to_key.rb
20130506090604_create_deploy_keys_projects.rb
20130506095501_remove_project_id_from_key.rb
20130522141856_add_more_fields_to_service.rb
20130528184641_add_system_to_notes.rb
20130611210815_increase_snippet_text_column_size.rb
20130613165816_add_password_expires_at_to_users.rb
20130613173246_add_created_by_id_to_user.rb
20130614132337_add_improted_to_project.rb
20130617095603_create_users_groups.rb
20130621195223_add_notification_level_to_user_group.rb
20130622115340_add_more_db_index.rb
20130624162710_add_fingerprint_to_key.rb
20130804151314_add_st_diff_to_note.rb
20130809124851_add_permission_check_to_user.rb
20130812143708_add_import_url_to_project.rb
20130819182730_add_internal_ids_to_issues_and_mr.rb
20130821090530_remove_deprecated_tables.rb
20130821090531_add_internal_ids_to_milestones.rb
20130909132950_add_description_to_merge_request.rb
20130926081215_change_owner_id_for_group.rb
20131005191208_add_avatar_to_users.rb
20131009115346_add_confirmable_to_users.rb
20131106151520_remove_default_branch.rb
20131112114325_create_broadcast_messages.rb
20131112220935_add_visibility_level_to_projects.rb
20131129154016_add_archived_to_projects.rb
20131130165425_add_color_and_font_to_broadcast_messages.rb
20131202192556_add_event_fields_for_web_hook.rb
20131214224427_add_hide_no_ssh_key_to_users.rb
20131217102743_add_recipients_to_service.rb
20140116231608_add_website_url_to_users.rb
20140122112253_create_merge_request_diffs.rb
20140122114406_migrate_mr_diffs.rb
20140122122549_remove_m_rdiff_fields.rb
20140125162722_add_avatar_to_projects.rb
20140127170938_add_group_avatars.rb
20140209025651_create_emails.rb
20140214102325_add_api_key_to_services.rb
20140304005354_add_index_merge_request_diffs_on_merge_request_id.rb
20140305193308_add_tag_push_hooks_to_project_hook.rb
20140312145357_add_import_status_to_project.rb
20140313092127_migrate_already_imported_projects.rb
20140407135544_fix_namespaces.rb
20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
20140415124820_limits_to_mysql.rb
20140416074002_add_index_on_iid.rb
20140416185734_index_on_current_sign_in_at.rb
20140428105831_add_notes_index_updated_at.rb
20140502115131_add_repo_size_to_db.rb
20140502125220_migrate_repo_size.rb
20140611135229_add_position_to_merge_request.rb
20140625115202_create_users_star_projects.rb
20140729134820_create_labels.rb
20140729140420_create_label_links.rb
20140729145339_migrate_project_tags.rb
20140729152420_migrate_taggable_labels.rb
20140730111702_add_index_to_labels.rb
20140903115954_migrate_to_new_shell.rb
20140907220153_serialize_service_properties.rb
20140914113604_add_members_table.rb
20140914145549_migrate_to_new_members_model.rb
20140914173417_remove_old_member_tables.rb
20141006143943_move_slack_service_to_webhook.rb
20141007100818_add_visibility_level_to_snippet.rb
20141118150935_add_audit_event.rb
20141121133009_add_timestamps_to_members.rb
20141121161704_add_identity_table.rb
20141205134006_add_locked_at_to_merge_request.rb
20141216155758_create_doorkeeper_tables.rb
20141217125223_add_owner_to_application.rb
20141223135007_add_import_data_to_project_table.rb
20141226080412_add_developers_can_push_to_protected_branches.rb
20150108073740_create_application_settings.rb
20150116234544_add_home_page_url_for_application_settings.rb
20150116234545_add_gitlab_access_token_to_user.rb
20150125163100_add_default_branch_protection_setting.rb
20150205211843_add_timestamps_to_identities.rb
20150206181414_add_index_to_created_at.rb
20150206222854_add_notification_email_to_user.rb
20150209222013_add_missing_index.rb
20150211172122_add_template_to_service.rb
20150211174341_allow_null_in_services_project_id.rb
20150213104043_add_twitter_sharing_enabled_to_application_settings.rb
20150213114800_add_hide_no_password_to_user.rb
20150213121042_add_password_automatically_set_to_user.rb
20150217123345_add_bitbucket_access_token_and_secret_to_user.rb
20150219004514_add_events_to_services.rb
20150223022001_set_missing_last_activity_at.rb
20150225065047_add_note_events_to_services.rb
20150301014758_add_restricted_visibility_levels_to_application_settings.rb
20150306023106_fix_namespace_duplication.rb
20150306023112_add_unique_index_to_namespace.rb
20150310194358_add_version_check_to_application_settings.rb
20150313012111_create_subscriptions_table.rb
20150320234437_add_location_to_user.rb
20150324155957_set_incorrect_assignee_id_to_null.rb
20150327122227_add_public_to_key.rb
20150327150017_add_import_data_to_project.rb
20150327223628_add_devise_two_factor_to_users.rb
20150328132231_add_max_attachment_size_to_application_settings.rb
20150331183602_add_devise_two_factor_backupable_to_users.rb
20150406133311_add_invite_data_to_member.rb
20150411000035_fix_identities.rb
20150411180045_rename_buildbox_service.rb
20150413192223_add_public_email_to_users.rb
20150417121913_create_project_import_data.rb
20150417122318_remove_import_data_from_project.rb
20150421120000_remove_periods_at_ends_of_usernames.rb
20150423033240_add_default_project_visibililty_to_application_settings.rb
20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
20150425164647_remove_duplicate_tags.rb
20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb
20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb
20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb
20150425173433_add_default_snippet_visibility_to_app_settings.rb
20150429002313_remove_abandoned_group_members_records.rb
20150502064022_add_restricted_signup_domains_to_application_settings.rb
20150509180749_convert_legacy_reference_notes.rb
20150516060434_add_note_events_to_web_hooks.rb
20150529111607_add_user_oauth_applications_to_application_settings.rb
20150529150354_add_after_sign_out_path_for_application_settings.rb
20150609141121_add_session_expire_delay_for_application_settings.rb
20150610065936_add_dashboard_to_users.rb
20150620233230_add_default_otp_required_for_login_value.rb
20150713160110_add_project_view_to_users.rb
20150717130904_add_commits_count_to_project.rb
20150730122406_add_updated_by_to_issuables_and_notes.rb
20150806104937_create_abuse_reports.rb
20150812080800_add_settings_import_sources.rb
20150814065925_remove_oauth_tokens_from_users.rb
20150817163600_deduplicate_user_identities.rb
20150818213832_add_sent_notifications.rb
20150824002011_add_enable_ssl_verification.rb
20150826001931_add_ci_tables.rb
20150902001023_add_template_to_label.rb
20150914215247_add_ci_tags.rb
20150915001905_enable_ssl_verification_by_default.rb
20150916000405_enable_ssl_verification_for_web_hooks.rb
20150916114643_add_help_page_text_to_application_settings.rb
20150916145038_add_index_for_committed_at_and_id.rb
20150918084513_add_ci_enabled_to_application_settings.rb
20150918161719_remove_invalid_milestones_from_merge_requests.rb
20150920010715_add_consumed_timestep_to_users.rb
20150920161119_add_line_code_to_sent_notification.rb
20150924125150_add_project_id_to_ci_commit.rb
20150924125436_migrate_project_id_for_ci_commits.rb
20150930001110_merge_request_error_field.rb
20150930095736_add_null_to_name_for_ci_projects.rb
20151002112914_add_stage_idx_to_builds.rb
20151002121400_add_index_for_builds.rb
20151002122929_add_ref_and_tag_to_builds.rb
20151002122943_migrate_ref_and_tag_to_build.rb
20151005075649_add_user_id_to_build.rb
20151005150751_add_layout_option_for_users.rb
20151005162154_remove_ci_enabled_from_application_settings.rb
20151007120511_namespaces_projects_path_lower_indexes.rb
20151008110232_add_users_lower_username_email_indexes.rb
20151008123042_add_type_and_description_to_builds.rb
20151008130321_migrate_name_to_description_for_builds.rb
20151008143519_add_admin_notification_email_setting.rb
20151012173029_set_jira_service_api_url.rb
20151013092124_add_artifacts_file_to_builds.rb
20151016131433_add_ci_projects_gl_project_id_index.rb
20151016195451_add_ci_builds_and_projects_indexes.rb
20151016195706_add_notes_line_code_index.rb
20151019111551_fix_build_tags.rb
20151019111703_fail_build_without_names.rb
20151020145526_add_services_template_index.rb
20151020173516_ci_limits_to_mysql.rb
20151020173906_add_ci_builds_index_for_status.rb
20151023112551_fail_build_with_empty_name.rb
20151023144219_remove_satellites.rb
20151026182941_add_project_path_index.rb
20151028152939_add_merge_when_build_succeeds_to_merge_request.rb
20151103001141_add_public_to_group.rb
20151103133339_add_shared_runners_setting.rb
20151103134857_create_lfs_objects.rb
20151103134958_create_lfs_objects_projects.rb
20151104105513_add_file_to_lfs_objects.rb
20151105094515_create_releases.rb
20151106000015_add_is_award_to_notes.rb
20151109100728_add_max_artifacts_size_to_application_settings.rb
20151109134526_add_issues_state_index.rb
20151109134916_add_projects_visibility_level_index.rb
20151110125604_add_import_error_to_project.rb
20151114113410_add_index_for_lfs_oid_and_size.rb
20151116144118_add_unique_for_lfs_oid_index.rb
20151118162244_add_projects_public_index.rb
20151201203948_raise_hook_url_limit.rb Raise hook url limit 2016-01-15 00:35:12 +03:00
20151203162133_add_hide_project_limit_to_users.rb
20151203162134_add_build_events_to_services.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151209144329_migrate_ci_web_hooks.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151209145909_migrate_ci_emails.rb
20151210030143_add_unlock_token_to_user.rb
20151210072243_add_runners_registration_token_to_application_settings.rb
20151210125232_migrate_ci_slack_service.rb
20151210125927_migrate_ci_hip_chat_service.rb
20151210125928_add_ci_to_project.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151210125929_add_project_id_to_ci.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151210125930_migrate_ci_to_project.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151210125931_add_index_to_ci_tables.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151210125932_drop_null_for_ci_tables.rb Make migrations reversible 2015-12-23 19:39:59 +01:00
20151218154042_add_tfa_to_application_settings.rb WIP require two factor authentication 2015-12-24 19:00:18 -02:00
20151221234414_add_tfa_additional_fields.rb Grace period support for TFA 2015-12-24 19:01:30 -02:00
20151224123230_rename_emojis.rb Emoji picker: better alias handling 2015-12-24 11:28:55 +02:00
20151228111122_remove_public_from_namespace.rb remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
20151228150906_influxdb_settings.rb Move InfluxDB settings to ApplicationSetting 2015-12-28 18:00:32 +01:00
20151228175719_add_recaptcha_to_application_settings.rb reCAPTCHA is configurable through Admin Settings, no reload needed. 2015-12-28 18:50:29 -02:00
20151229102248_influxdb_udp_port_setting.rb Write to InfluxDB directly via UDP 2015-12-29 14:53:45 +01:00
20151229112614_influxdb_remote_database_setting.rb Write to InfluxDB directly via UDP 2015-12-29 14:53:45 +01:00
20151230132518_add_artifacts_metadata_to_ci_build.rb Add artifacts metadata uploader filed 2016-01-14 12:48:14 +01:00
20151231152326_add_akismet_to_application_settings.rb Support Akismet spam checking for creation of issues via API 2016-02-02 11:25:44 -02:00
20151231202530_remove_alert_type_from_broadcast_messages.rb Remove alert_type attribute from BroadcastMessage 2016-01-13 11:34:57 -05:00
20160106162223_add_index_milestones_title.rb Added an index on milestones.title 2016-01-07 14:53:02 +01:00
20160106164438_remove_influxdb_credentials.rb Remove InfluxDB username/password 2016-01-06 17:49:56 +01:00
20160109054846_create_spam_logs.rb Support Akismet spam checking for creation of issues via API 2016-02-02 11:25:44 -02:00
20160113111034_add_metrics_sample_interval.rb Make the metrics sampler interval configurable 2016-01-13 12:29:48 +01:00
20160118155830_add_sentry_to_application_settings.rb Add sentry integration 2016-01-18 17:15:10 +01:00
20160118232755_add_ip_blocking_settings_to_application_settings.rb Add IP blocking against DNSBL at sign-up 2016-01-20 15:28:19 +01:00
20160119111158_add_services_category.rb Greatly improve external_issue_tracker performance 2016-01-19 14:03:20 +01:00
20160119112418_add_services_default.rb Greatly improve external_issue_tracker performance 2016-01-19 14:03:20 +01:00
20160119145451_add_ldap_email_to_users.rb Allow LDAP users to change their email if it was not set by the LDAP server 2016-01-19 16:25:38 +01:00
20160120172143_add_base_commit_sha_to_merge_request_diffs.rb Save and use actual diff base commit for MR diff highlighting 2016-01-20 18:44:27 +01:00
20160121030729_add_email_author_in_body_to_application_settings.rb Add option to include the sender name in body of Notify email. fix #7824 2016-02-09 12:58:13 +01:00
20160122185421_add_pending_delete_to_project.rb Update CHANGELOG 2016-01-29 09:23:24 -05:00
20160128212447_remove_ip_blocking_settings_from_application_settings.rb Partially revert "Add IP check against DNSBLs at account sign-up" 2016-01-28 16:28:19 -05:00
20160128233227_change_lfs_objects_size_column.rb Increase LFS objects size column 2016-01-29 08:28:58 -06:00
20160129135155_remove_dot_atom_path_ending_of_projects.rb remove unnecessary lower function on SQL 2016-02-04 18:38:11 +01:00
20160129155512_add_merge_commit_sha_to_merge_requests.rb Save merge commit id when MR is merged 2016-02-19 13:14:49 -05:00
20160202091601_add_erasable_to_ci_build.rb Fix name of build erasable, remove superfluous method from it 2016-02-19 17:24:59 +01:00
20160202164642_add_allow_guest_to_access_builds_project.rb Rename allow_guest_to_access_builds to public_builds 2016-02-04 12:57:46 +01:00
20160204144558_add_real_size_to_merge_request_diffs.rb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
20160209130428_add_index_to_snippet.rb Add index for snippet's updated_at 2016-02-09 15:10:22 +02:00
20160212123307_create_tasks.rb Add task model 2016-02-20 12:10:26 -02:00
20160217100506_add_description_to_label.rb Label description and Label row 2016-02-17 21:52:12 +08:00
20160217174422_add_note_to_tasks.rb Create a pending task when a user is mentioned on a note 2016-02-20 12:12:05 -02:00
20160220123949_rename_tasks_to_todos.rb Rename Tasks to Todos 2016-02-20 12:39:27 -02:00
20160222153918_create_appearances_ce.rb Fix broken migration 2016-02-29 16:41:45 +01:00
20160226114608_add_trigram_indexes_for_searching.rb More detailed trigram migration error message 2016-03-11 15:26:32 -05:00
20160229193553_add_main_language_to_repository.rb adds swp and swo to gitignore and improves migration for project main_language 2016-03-07 21:59:39 +01:00
20160305220806_remove_expires_at_from_snippets.rb Remove Snippet#expires_at 2016-03-05 18:12:17 -05:00
20160307221555_disallow_blank_line_code_on_note.rb Disallow blank (non-null) values for a Note's line_code attribute 2016-03-11 17:46:50 -05:00
20160309140734_fix_todos.rb Remove invalid todos from database 2016-03-09 11:18:13 -03:00
limits_to_mysql.rb Add limit change for 'data' column in 'events' when using MySQL 2016-01-18 21:27:56 +01:00