gitlab-org--gitlab-foss/db/migrate
Stan Hu ed1d4fa477 Remove user OAuth tokens stored in database for Bitbucket, GitHub, and GitLab
and request them each session. Pass these tokens to the project import data.

This prevents the need to encrypt these tokens and clear them in case they
expire or get revoked.

For example, if you deleted and re-created OAuth2 keys for Bitbucket, you would get
an Error 500 with no way to recover:

```
Started GET "/import/bitbucket/status" for x.x.x.x at 2015-08-07 05:24:10 +0000
Processing by Import::BitbucketController#status as HTML
Completed 500 Internal Server Error in 607ms (ActiveRecord: 2.3ms)

NameError (uninitialized constant Import::BitbucketController::Unauthorized):
  app/controllers/import/bitbucket_controller.rb:77:in `rescue in go_to_bitbucket_for_permissions'
  app/controllers/import/bitbucket_controller.rb:74:in `go_to_bitbucket_for_permissions'
  app/controllers/import/bitbucket_controller.rb:86:in `bitbucket_unauthorized'
```

Closes #1871
2015-08-23 09:23:44 -07:00
..
20121220064453_init_schema.rb Squash migrations for years 2011 and 2012 2014-02-04 17:11:30 +02:00
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 Update 20130419190306_allow_merges_for_forks.rb 2013-08-25 21:47:04 +03:00
20130506085413_add_type_to_key.rb
20130506090604_create_deploy_keys_projects.rb
20130506095501_remove_project_id_from_key.rb Remove deprecated finders 2014-01-19 23:39:56 +04:00
20130522141856_add_more_fields_to_service.rb
20130528184641_add_system_to_notes.rb Link issues from comments and automatically close them 2013-08-25 18:58:41 -04:00
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 st_diff field for Note 2013-08-04 19:00:41 +03:00
20130809124851_add_permission_check_to_user.rb Add User#last_credential_check_at 2014-03-11 10:07:22 +02:00
20130812143708_add_import_url_to_project.rb Repository import during project creation often return timeout for medium and large repos. 2013-08-12 18:21:47 +03:00
20130819182730_add_internal_ids_to_issues_and_mr.rb Add iid field to issues and MR 2013-08-19 22:10:21 +03:00
20130821090530_remove_deprecated_tables.rb Drop deprecated tables 2013-08-21 12:08:10 +03:00
20130821090531_add_internal_ids_to_milestones.rb Add iids to milestones. Moved iids logic to separate concern 2013-08-21 12:16:26 +03:00
20130909132950_add_description_to_merge_request.rb Add description to MergeRequest model 2013-09-09 16:32:43 +03:00
20130926081215_change_owner_id_for_group.rb Namespaces.owner_id can be null 2013-09-26 14:48:58 +03:00
20131005191208_add_avatar_to_users.rb avatar upload on profile page 2013-10-09 09:05:09 +02:00
20131009115346_add_confirmable_to_users.rb Enable confirmable and reconfirmable modules for User 2013-10-15 09:56:04 +03:00
20131106151520_remove_default_branch.rb Project#default_branch use repo HEAD instead of DB value now 2013-11-06 18:45:39 +02:00
20131112114325_create_broadcast_messages.rb Broadcast message model + migrations 2013-11-12 13:47:28 +02:00
20131112220935_add_visibility_level_to_projects.rb Adding authenticated public mode (internal). 2013-11-26 22:22:07 -06:00
20131129154016_add_archived_to_projects.rb Archiving old projects; archived projects aren't shown on dashboard 2013-12-16 14:39:14 +01:00
20131130165425_add_color_and_font_to_broadcast_messages.rb Customization and previewing of broadcast messages 2013-12-18 17:43:45 -05:00
20131202192556_add_event_fields_for_web_hook.rb Add new fields to web_hooks table. 2013-12-04 13:37:17 +02:00
20131214224427_add_hide_no_ssh_key_to_users.rb Allow user to hide the message to add an ssh key permanently 2013-12-14 20:21:12 -06:00
20131217102743_add_recipients_to_service.rb Create EmailsOnPushService model 2013-12-17 12:42:40 +02:00
20140116231608_add_website_url_to_users.rb Add website url to user 2014-01-18 19:15:10 +00:00
20140122112253_create_merge_request_diffs.rb Improve db schema for merge request diffs 2014-01-22 15:17:41 +02:00
20140122114406_migrate_mr_diffs.rb Fix merge_request_diffs migrations for postgresql 2014-01-27 18:50:53 +04:00
20140122122549_remove_m_rdiff_fields.rb Fix merge_request_diffs migrations for postgresql 2014-01-27 18:50:53 +04:00
20140125162722_add_avatar_to_projects.rb adding avatar to project settings page added avatar removal show project avatar on dashboard, projects page, project page added rspec and feature tests added project avatar from repository new default project icon added added copying af avatar to forking of project added generated icon fixed avatar fork hound fix style fix test fix 2015-01-24 18:51:16 +01:00
20140127170938_add_group_avatars.rb added group avatars 2014-01-28 08:38:00 +01:00
20140209025651_create_emails.rb Add email aliases for users 2014-02-13 22:59:39 -06:00
20140214102325_add_api_key_to_services.rb Add Gemnasium Service for Gitlab 2014-02-21 16:25:22 +01:00
20140304005354_add_index_merge_request_diffs_on_merge_request_id.rb Add index_merge_request_diffs_on_merge_request_id 2014-03-04 10:38:09 +09:00
20140305193308_add_tag_push_hooks_to_project_hook.rb Added tag_push_events to the web_hooks 2014-03-05 20:44:01 +01:00
20140312145357_add_import_status_to_project.rb Add Project#import_status field 2014-03-12 17:14:28 +02:00
20140313092127_migrate_already_imported_projects.rb Add migration for already imported projects 2014-03-13 11:28:41 +02:00
20140407135544_fix_namespaces.rb Add trailing newline to all text files. 2014-06-21 11:20:22 +02:00
20140414131055_change_state_to_allow_empty_merge_request_diffs.rb Fixed some hound notices 2014-04-14 15:24:37 +02:00
20140415124820_limits_to_mysql.rb Adjust MySQL limits for existing installations 2014-04-23 11:07:36 +02:00
20140416074002_add_index_on_iid.rb Migrate invalid rows with missing iids or duplicates 2014-04-24 19:39:33 +02:00
20140416185734_index_on_current_sign_in_at.rb Add db index for active user display. 2014-04-16 21:05:13 +02:00
20140428105831_add_notes_index_updated_at.rb Add an index for Note#updated_at 2014-04-28 13:02:05 +02:00
20140502115131_add_repo_size_to_db.rb Save repository size to projects table 2014-05-02 16:05:08 +03:00
20140502125220_migrate_repo_size.rb Save repository size to projects table 2014-05-02 16:05:08 +03:00
20140611135229_add_position_to_merge_request.rb Add sorting to merge requests on milestone page 2014-06-11 17:11:52 +03:00
20140625115202_create_users_star_projects.rb Add star count, view logic, more tests. 2014-07-17 22:47:16 +02:00
20140729134820_create_labels.rb Label and LabelLink models for implementing own GitLab labels 2014-07-29 17:10:15 +03:00
20140729140420_create_label_links.rb Label and LabelLink models for implementing own GitLab labels 2014-07-29 17:10:15 +03:00
20140729145339_migrate_project_tags.rb Replace project labels with tags to prevent name conflict with GitLab labels 2014-07-29 18:23:18 +03:00
20140729152420_migrate_taggable_labels.rb Fixes #7571 2014-08-27 21:12:37 +01:00
20140730111702_add_index_to_labels.rb Add indicies to labels 2014-07-30 14:25:27 +03:00
20140903115954_migrate_to_new_shell.rb Use create-hooks instead of rewrite-hooks.sh 2014-09-08 10:16:15 +02:00
20140907220153_serialize_service_properties.rb Make services migration more reliable 2015-02-23 17:56:05 -08:00
20140914113604_add_members_table.rb Fix migration and association for new members table 2014-09-14 20:38:57 +03:00
20140914145549_migrate_to_new_members_model.rb Fix STI+polymorphic for Group <-> GroupMember 2014-09-14 21:52:54 +03:00
20140914173417_remove_old_member_tables.rb Fix migration and association for new members table 2014-09-14 20:38:57 +03:00
20141006143943_move_slack_service_to_webhook.rb Prevent another migration from failing. 2015-02-25 22:55:37 +01:00
20141007100818_add_visibility_level_to_snippet.rb Snippets: public/internal/private 2014-10-09 17:09:53 +03:00
20141118150935_add_audit_event.rb Audit log for user authentication 2015-07-06 12:36:08 +03:00
20141121133009_add_timestamps_to_members.rb Add missing timestamps to the 'members' table 2014-11-21 15:02:23 +01:00
20141121161704_add_identity_table.rb Remove index only if exists 2014-12-23 11:05:50 +02:00
20141205134006_add_locked_at_to_merge_request.rb Add locked_at to merge request 2014-12-05 15:42:26 +02:00
20141216155758_create_doorkeeper_tables.rb Doorkeeper integration 2014-12-24 15:38:07 +02:00
20141217125223_add_owner_to_application.rb Doorkeeper integration 2014-12-24 15:38:07 +02:00
20141223135007_add_import_data_to_project_table.rb Github Importer 2015-01-10 09:51:43 -08:00
20141226080412_add_developers_can_push_to_protected_branches.rb Add migration for developers can push to protected branches flag. 2014-12-26 09:07:02 +01:00
20150108073740_create_application_settings.rb Init ApplicationSettings resource with defaults from config file 2015-01-08 00:22:50 -08:00
20150116234544_add_home_page_url_for_application_settings.rb Allow to specify home page for non logged-in users 2015-01-16 16:01:15 -08:00
20150116234545_add_gitlab_access_token_to_user.rb an ability to clone project with oauth2 token 2015-01-28 15:57:31 -08:00
20150125163100_add_default_branch_protection_setting.rb Allow configuring protection of the default branch upon first push 2015-01-25 17:09:10 +01:00
20150205211843_add_timestamps_to_identities.rb Add timestamps to identity 2015-02-05 13:23:32 -08:00
20150206181414_add_index_to_created_at.rb Add index on order columns 2015-02-06 10:21:48 -08:00
20150206222854_add_notification_email_to_user.rb Allow notification email to be set separately from primary email. 2015-02-07 23:19:17 +01:00
20150209222013_add_missing_index.rb Add index on order columns for services table 2015-02-09 14:21:52 -08:00
20150211172122_add_template_to_service.rb Add template boolean to services. 2015-02-11 09:24:40 -08:00
20150211174341_allow_null_in_services_project_id.rb Remove not null constraint on project_id in services. 2015-02-11 09:47:21 -08:00
20150213104043_add_twitter_sharing_enabled_to_application_settings.rb Add link to share via twitter to "created project" event. 2015-02-13 12:07:59 +01:00
20150213114800_add_hide_no_password_to_user.rb Allow users that signed up via OAuth to set their password in order to use Git over HTTP(S). 2015-02-13 14:44:42 +01:00
20150213121042_add_password_automatically_set_to_user.rb Allow users that signed up via OAuth to set their password in order to use Git over HTTP(S). 2015-02-13 14:44:42 +01:00
20150217123345_add_bitbucket_access_token_and_secret_to_user.rb Add Bitbucket importer. 2015-02-24 15:07:24 +01:00
20150219004514_add_events_to_services.rb Issue #595: Support Slack notifications upon issue and merge request events 2015-03-03 11:14:31 +01:00
20150223022001_set_missing_last_activity_at.rb No need to block db:rollback for safe migration 2015-02-25 19:51:13 -08:00
20150225065047_add_note_events_to_services.rb Added comment notification events to HipChat and Slack services. 2015-03-06 06:54:00 -08:00
20150301014758_add_restricted_visibility_levels_to_application_settings.rb Move restricted visibility settings to the UI 2015-03-07 13:11:08 -07:00
20150306023106_fix_namespace_duplication.rb remove duplication 2015-03-10 20:09:34 +02:00
20150306023112_add_unique_index_to_namespace.rb remove duplication 2015-03-10 20:09:34 +02:00
20150310194358_add_version_check_to_application_settings.rb Add feature to disable version check 2015-03-10 12:51:46 -07:00
20150313012111_create_subscriptions_table.rb tests 2015-03-16 21:38:41 +02:00
20150320234437_add_location_to_user.rb Add location to user profile 2015-03-20 16:52:23 -07:00
20150324155957_set_incorrect_assignee_id_to_null.rb Add migration. 2015-03-24 17:00:56 +01:00
20150327122227_add_public_to_key.rb Allow admin to create public deploy keys that are accessible to any project. 2015-04-03 12:23:20 +02:00
20150327150017_add_import_data_to_project.rb Allow projects to be imported from Google Code. 2015-04-03 15:29:27 +02:00
20150327223628_add_devise_two_factor_to_users.rb Init 2 factor authentication for user model 2015-05-09 17:31:07 -04:00
20150328132231_add_max_attachment_size_to_application_settings.rb Support configurable attachment size via Application Settings 2015-04-02 00:04:08 -07:00
20150331183602_add_devise_two_factor_backupable_to_users.rb Make otp_backup_codes a text field 2015-05-09 17:32:46 -04:00
20150406133311_add_invite_data_to_member.rb Make more migrations reversible 2015-05-13 11:03:29 -04:00
20150411000035_fix_identities.rb Remove unnecessary semicolons 2015-04-14 15:45:15 +02:00
20150411180045_rename_buildbox_service.rb Add migration to rename BuildboxService to BuildkiteService 2015-04-11 14:05:23 -04:00
20150413192223_add_public_email_to_users.rb Allow user to choose which email to be public 2015-04-14 19:42:48 +08:00
20150417121913_create_project_import_data.rb Move import data out of project so it doesn't take ages to load. 2015-04-17 14:49:00 +02:00
20150417122318_remove_import_data_from_project.rb Make more migrations reversible 2015-05-13 11:03:29 -04:00
20150421120000_remove_periods_at_ends_of_usernames.rb Explain namespace clearn regex. 2015-04-24 14:49:23 +02:00
20150423033240_add_default_project_visibililty_to_application_settings.rb Make migrations reversible 2015-05-07 17:29:15 +03:00
20150425164646_gitlab_change_collation_for_tag_names.acts_as_taggable_on_engine.rb Change the MySQL collation type to utf8_bin to ensure case-sensitive tags are supported 2015-05-07 16:33:11 -07:00
20150425164647_remove_duplicate_tags.rb Adding quote_string to migration 2015-05-08 16:54:45 +03:00
20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb Conditionally remove indices that may not exist in pre-GitLab v6.7 installations 2015-05-08 00:43:19 -07:00
20150425164649_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb Fix DB error when trying to tag a repository 2015-04-27 06:09:20 -07:00
20150425164650_add_missing_taggable_index.acts_as_taggable_on_engine.rb Fix DB error when trying to tag a repository 2015-04-27 06:09:20 -07:00
20150425164651_change_collation_for_tag_names.acts_as_taggable_on_engine.rb Fix DB error when trying to tag a repository 2015-04-27 06:09:20 -07:00
20150425173433_add_default_snippet_visibility_to_app_settings.rb Make more migrations reversible 2015-05-13 11:03:29 -04:00
20150429002313_remove_abandoned_group_members_records.rb Make migrations reversible 2015-05-07 17:29:15 +03:00
20150502064022_add_restricted_signup_domains_to_application_settings.rb Add application setting to restrict user signups to e-mail domains 2015-05-02 09:36:52 -07:00
20150509180749_convert_legacy_reference_notes.rb Add migration to convert legacy system notes 2015-05-11 00:01:15 -04:00
20150516060434_add_note_events_to_web_hooks.rb Add support for Webhook note events 2015-05-21 23:48:16 -04:00
20150529111607_add_user_oauth_applications_to_application_settings.rb Add option to disallow users from registering any application to use GitLab as an OAuth provider 2015-05-29 13:29:16 +02:00
20150529150354_add_after_sign_out_path_for_application_settings.rb Allow to configure a URL to show after sign out 2015-05-29 18:20:15 +02:00
20150609141121_add_session_expire_delay_for_application_settings.rb Check if session_expire_delay column exists before adding the column. 2015-07-22 17:04:49 +02:00
20150610065936_add_dashboard_to_users.rb Add dashboard attribute to User model 2015-06-13 17:59:11 -04:00
20150620233230_add_default_otp_required_for_login_value.rb Correct AddDefaultOtpRequiredForLoginValue migration 2015-06-22 11:36:11 -04:00
20150713160110_add_project_view_to_users.rb Allow user to specify content he wants to see on project page 2015-07-13 18:24:15 +02:00
20150717130904_add_commits_count_to_project.rb Store commit count in project table 2015-07-17 15:22:56 +02:00
20150730122406_add_updated_by_to_issuables_and_notes.rb Show who last edited a comment if it wasn't the original author 2015-07-30 14:45:54 +02:00
20150806104937_create_abuse_reports.rb Allow users to send abuse reports 2015-08-06 14:03:27 +02:00
20150812080800_add_settings_import_sources.rb Import sources: settings in the admin interface 2015-08-20 11:28:27 +02:00
20150814065925_remove_oauth_tokens_from_users.rb Remove user OAuth tokens stored in database for Bitbucket, GitHub, and GitLab 2015-08-23 09:23:44 -07:00
20150818213832_add_sent_notifications.rb Reply by email POC 2015-08-18 15:46:36 -07:00
limits_to_mysql.rb Move the adapter check to the migration 2014-04-23 11:08:51 +02:00