diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2019-04-29 15:16:03 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-06-17 18:09:05 +0300 |
commit | 8469f59d786be6762908f62d642625790999cb9b (patch) | |
tree | 03f99c605e465673e017e775a623ffa5b62f18d3 /spec/db | |
parent | 0f777a8d49568d3f5ffdd4b75b594f07e9fbd2f0 (diff) |
Backport the EE schema and migrations to CE
This backports all EE schema changes to CE, including EE migrations,
ensuring both use the same schema.
== Updated tests
A spec related to ghost and support bot users had to be modified to make
it pass. The spec in question assumes that the "support_bot" column
exists when defining the spec. In the single codebase setup this is not
the case, as the column is backported in a later migration. Any attempt
to use a different schema version or use of "around" blocks to
conditionally disable specs won't help, as reverting the backport
migration would also drop the "support_bot" column. Removing the
"support_bot" tests entirely appears to be the only solution.
We also need to update some foreign key tests now that we have
backported the EE columns. Fortunately, these changes are very minor.
== Backporting migrations
This commit moves EE specific migrations (except those for the Geo
tracking database) and related files to CE, and also removes any traces
of the ee/db directory.
Some migrations had to be modified or removed, as they no longer work
with the schema being backported. These migrations were all quite old,
so we opted for removing them where modifying them would take too much
time and effort.
Some old migrations were modified in EE, while also existing in CE. In
these cases we took the EE code, and in one case removed them entirely.
It's not worth spending time trying to merge these changes somehow as we
plan to remove old migrations around the release of 12.0, see
https://gitlab.com/gitlab-org/gitlab-ce/issues/59177 for more details.
Diffstat (limited to 'spec/db')
-rw-r--r-- | spec/db/schema_spec.rb | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index 33254d607c9..6cfec5f4017 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -9,9 +9,13 @@ describe 'Database schema' do # Use if you are certain that this column should not have a foreign key IGNORED_FK_COLUMNS = { abuse_reports: %w[reporter_id user_id], - application_settings: %w[performance_bar_allowed_group_id], + application_settings: %w[performance_bar_allowed_group_id slack_app_id snowplow_site_id], + approvers: %w[target_id user_id], + approvals: %w[user_id], + approver_groups: %w[target_id], audit_events: %w[author_id entity_id], award_emoji: %w[awardable_id user_id], + boards: %w[milestone_id], chat_names: %w[chat_id service_id team_id user_id], chat_teams: %w[team_id], ci_builds: %w[erased_by_id runner_id trigger_request_id user_id], @@ -21,15 +25,25 @@ describe 'Database schema' do cluster_providers_gcp: %w[gcp_project_id operation_id], deploy_keys_projects: %w[deploy_key_id], deployments: %w[deployable_id environment_id user_id], + draft_notes: %w[discussion_id], emails: %w[user_id], events: %w[target_id], + epics: %w[updated_by_id last_edited_by_id start_date_sourcing_milestone_id due_date_sourcing_milestone_id], forked_project_links: %w[forked_from_project_id], + geo_event_log: %w[hashed_storage_attachments_event_id], + geo_job_artifact_deleted_events: %w[job_artifact_id], + geo_lfs_object_deleted_events: %w[lfs_object_id], + geo_node_statuses: %w[last_event_id cursor_last_event_id], + geo_nodes: %w[oauth_application_id], + geo_repository_deleted_events: %w[project_id], + geo_upload_deleted_events: %w[upload_id model_id], identities: %w[user_id], issues: %w[last_edited_by_id state_id], jira_tracker_data: %w[jira_issue_transition_id], keys: %w[user_id], label_links: %w[target_id], lfs_objects_projects: %w[lfs_object_id project_id], + ldap_group_links: %w[group_id], members: %w[source_id created_by_id], merge_requests: %w[last_edited_by_id state_id], namespaces: %w[owner_id parent_id], @@ -40,7 +54,7 @@ describe 'Database schema' do oauth_applications: %w[owner_id], project_group_links: %w[group_id], project_statistics: %w[namespace_id], - projects: %w[creator_id namespace_id ci_id], + projects: %w[creator_id namespace_id ci_id mirror_user_id], redirect_routes: %w[source_id], repository_languages: %w[programming_language_id], routes: %w[source_id], @@ -48,14 +62,17 @@ describe 'Database schema' do snippets: %w[author_id], spam_logs: %w[user_id], subscriptions: %w[user_id subscribable_id], + slack_integrations: %w[team_id user_id], taggings: %w[tag_id taggable_id tagger_id], timelogs: %w[user_id], todos: %w[target_id commit_id], uploads: %w[model_id], user_agent_details: %w[subject_id], - users: %w[color_scheme_id created_by_id theme_id], + users: %w[color_scheme_id created_by_id theme_id email_opted_in_source_id], users_star_projects: %w[user_id], - web_hooks: %w[service_id], + vulnerability_identifiers: %w[external_id], + vulnerability_scanners: %w[external_id], + web_hooks: %w[service_id group_id], suggestions: %w[commit_id] }.with_indifferent_access.freeze |