2016-09-02 12:26:13 +00:00
|
|
|
---
|
|
|
|
issues:
|
|
|
|
- subscriptions
|
|
|
|
- award_emoji
|
|
|
|
- author
|
2017-05-04 12:11:15 +00:00
|
|
|
- assignees
|
2016-09-02 12:26:13 +00:00
|
|
|
- updated_by
|
|
|
|
- milestone
|
2020-05-14 12:08:21 +00:00
|
|
|
- iteration
|
2016-09-02 12:26:13 +00:00
|
|
|
- notes
|
2018-08-01 08:58:49 +00:00
|
|
|
- resource_label_events
|
2020-01-02 13:03:23 +00:00
|
|
|
- resource_weight_events
|
2020-02-19 18:09:10 +00:00
|
|
|
- resource_milestone_events
|
2020-05-11 15:09:37 +00:00
|
|
|
- resource_state_events
|
2020-02-28 00:09:08 +00:00
|
|
|
- sent_notifications
|
2019-12-10 12:07:55 +00:00
|
|
|
- sentry_issue
|
2016-09-02 12:26:13 +00:00
|
|
|
- label_links
|
|
|
|
- labels
|
2017-05-05 05:39:26 +00:00
|
|
|
- last_edited_by
|
2016-09-02 12:26:13 +00:00
|
|
|
- todos
|
|
|
|
- user_agent_detail
|
|
|
|
- moved_to
|
2020-04-23 18:09:46 +00:00
|
|
|
- moved_from
|
2019-09-13 13:26:31 +00:00
|
|
|
- duplicated_to
|
2019-11-21 00:06:02 +00:00
|
|
|
- promoted_to_epic
|
2016-09-02 12:26:13 +00:00
|
|
|
- events
|
2016-09-21 11:01:46 +00:00
|
|
|
- merge_requests_closing_issues
|
|
|
|
- metrics
|
2016-12-23 05:44:02 +00:00
|
|
|
- timelogs
|
2017-05-04 12:11:15 +00:00
|
|
|
- issue_assignees
|
2018-03-01 14:42:50 +00:00
|
|
|
- closed_by
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- epic_issue
|
|
|
|
- epic
|
|
|
|
- designs
|
2019-09-05 23:43:06 +00:00
|
|
|
- design_versions
|
2019-10-18 11:11:44 +00:00
|
|
|
- description_versions
|
2019-10-08 00:06:10 +00:00
|
|
|
- prometheus_alerts
|
|
|
|
- prometheus_alert_events
|
2019-10-17 15:06:17 +00:00
|
|
|
- self_managed_prometheus_alert_events
|
2019-10-28 18:06:15 +00:00
|
|
|
- zoom_meetings
|
2019-11-18 12:06:03 +00:00
|
|
|
- vulnerability_links
|
|
|
|
- related_vulnerabilities
|
2019-12-10 15:07:52 +00:00
|
|
|
- user_mentions
|
2020-04-03 09:09:31 +00:00
|
|
|
- system_note_metadata
|
2020-04-23 00:09:41 +00:00
|
|
|
- alert_management_alert
|
2020-04-28 15:09:29 +00:00
|
|
|
- status_page_published_incident
|
2016-09-02 12:26:13 +00:00
|
|
|
events:
|
|
|
|
- author
|
|
|
|
- project
|
2019-09-03 21:29:55 +00:00
|
|
|
- group
|
2016-09-02 12:26:13 +00:00
|
|
|
- target
|
Migrate events into a new format
This commit migrates events data in such a way that push events are
stored much more efficiently. This is done by creating a shadow table
called "events_for_migration", and a table called "push_event_payloads"
which is used for storing push data of push events. The background
migration in this commit will copy events from the "events" table into
the "events_for_migration" table, push events in will also have a row
created in "push_event_payloads".
This approach allows us to reclaim space in the next release by simply
swapping the "events" and "events_for_migration" tables, then dropping
the old events (now "events_for_migration") table.
The new table structure is also optimised for storage space, and does
not include the unused "title" column nor the "data" column (since this
data is moved to "push_event_payloads").
== Newly Created Events
Newly created events are inserted into both "events" and
"events_for_migration", both using the exact same primary key value. The
table "push_event_payloads" in turn has a foreign key to the _shadow_
table. This removes the need for recreating and validating the foreign
key after swapping the tables. Since the shadow table also has a foreign
key to "projects.id" we also don't have to worry about orphaned rows.
This approach however does require some additional storage as we're
duplicating a portion of the events data for at least 1 release. The
exact amount is hard to estimate, but for GitLab.com this is expected to
be between 10 and 20 GB at most. The background migration in this commit
deliberately does _not_ update the "events" table as doing so would put
a lot of pressure on PostgreSQL's auto vacuuming system.
== Supporting Both Old And New Events
Application code has also been adjusted to support push events using
both the old and new data formats. This is done by creating a PushEvent
class which extends the regular Event class. Using Rails' Single Table
Inheritance system we can ensure the right class is used for the right
data, which in this case is based on the value of `events.action`. To
support displaying old and new data at the same time the PushEvent class
re-defines a few methods of the Event class, falling back to their
original implementations for push events in the old format.
Once all existing events have been migrated the various push event
related methods can be removed from the Event model, and the calls to
`super` can be removed from the methods in the PushEvent model.
The UI and event atom feed have also been slightly changed to better
handle this new setup, fortunately only a few changes were necessary to
make this work.
== API Changes
The API only displays push data of events in the new format. Supporting
both formats in the API is a bit more difficult compared to the UI.
Since the old push data was not really well documented (apart from one
example that used an incorrect "action" nmae) I decided that supporting
both was not worth the effort, especially since events will be migrated
in a few days _and_ new events are created in the correct format.
2017-07-10 15:43:57 +00:00
|
|
|
- push_event_payload
|
2016-09-02 12:26:13 +00:00
|
|
|
notes:
|
|
|
|
- award_emoji
|
|
|
|
- project
|
|
|
|
- noteable
|
|
|
|
- author
|
|
|
|
- updated_by
|
2017-05-05 05:39:26 +00:00
|
|
|
- last_edited_by
|
2016-09-02 12:26:13 +00:00
|
|
|
- resolved_by
|
|
|
|
- todos
|
|
|
|
- events
|
2017-03-15 13:19:45 +00:00
|
|
|
- system_note_metadata
|
2018-05-16 15:46:18 +00:00
|
|
|
- note_diff_file
|
2018-12-13 19:17:19 +00:00
|
|
|
- suggestions
|
2020-04-15 12:09:18 +00:00
|
|
|
- diff_note_positions
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- review
|
2016-09-02 12:26:13 +00:00
|
|
|
label_links:
|
|
|
|
- target
|
|
|
|
- label
|
|
|
|
label:
|
|
|
|
- subscriptions
|
|
|
|
- project
|
|
|
|
- lists
|
|
|
|
- label_links
|
|
|
|
- issues
|
|
|
|
- merge_requests
|
2016-10-18 17:31:10 +00:00
|
|
|
- priorities
|
2016-09-02 12:26:13 +00:00
|
|
|
milestone:
|
2017-07-07 15:08:49 +00:00
|
|
|
- group
|
2016-09-02 12:26:13 +00:00
|
|
|
- project
|
|
|
|
- issues
|
|
|
|
- labels
|
|
|
|
- merge_requests
|
|
|
|
- participants
|
|
|
|
- events
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- boards
|
2019-09-16 15:06:26 +00:00
|
|
|
- milestone_releases
|
|
|
|
- releases
|
2016-09-02 12:26:13 +00:00
|
|
|
snippets:
|
|
|
|
- author
|
|
|
|
- project
|
|
|
|
- notes
|
2016-09-21 18:43:29 +00:00
|
|
|
- award_emoji
|
2017-02-01 18:15:59 +00:00
|
|
|
- user_agent_detail
|
2019-12-10 15:07:52 +00:00
|
|
|
- user_mentions
|
2020-02-13 15:08:52 +00:00
|
|
|
- snippet_repository
|
2016-09-02 12:26:13 +00:00
|
|
|
releases:
|
2018-12-12 09:56:43 +00:00
|
|
|
- author
|
2016-09-02 12:26:13 +00:00
|
|
|
- project
|
2019-01-02 01:40:33 +00:00
|
|
|
- links
|
2019-09-16 15:06:26 +00:00
|
|
|
- milestone_releases
|
|
|
|
- milestones
|
2020-03-24 12:09:42 +00:00
|
|
|
- evidences
|
2019-01-02 01:40:33 +00:00
|
|
|
links:
|
|
|
|
- release
|
2016-09-02 12:26:13 +00:00
|
|
|
project_members:
|
|
|
|
- created_by
|
|
|
|
- user
|
|
|
|
- source
|
|
|
|
- project
|
|
|
|
merge_requests:
|
|
|
|
- subscriptions
|
|
|
|
- award_emoji
|
|
|
|
- author
|
|
|
|
- assignee
|
|
|
|
- updated_by
|
|
|
|
- milestone
|
2020-05-14 12:08:21 +00:00
|
|
|
- iteration
|
2016-09-02 12:26:13 +00:00
|
|
|
- notes
|
2018-08-01 08:58:49 +00:00
|
|
|
- resource_label_events
|
2020-02-19 18:09:10 +00:00
|
|
|
- resource_milestone_events
|
2020-05-11 15:09:37 +00:00
|
|
|
- resource_state_events
|
2016-09-02 12:26:13 +00:00
|
|
|
- label_links
|
|
|
|
- labels
|
2017-05-05 05:39:26 +00:00
|
|
|
- last_edited_by
|
2016-09-02 12:26:13 +00:00
|
|
|
- todos
|
|
|
|
- target_project
|
|
|
|
- source_project
|
|
|
|
- merge_user
|
|
|
|
- merge_request_diffs
|
|
|
|
- merge_request_diff
|
2020-01-29 15:08:59 +00:00
|
|
|
- merge_request_context_commits
|
|
|
|
- merge_request_context_commit_diff_files
|
2016-09-02 12:26:13 +00:00
|
|
|
- events
|
2016-09-21 11:01:46 +00:00
|
|
|
- merge_requests_closing_issues
|
2018-07-30 18:52:42 +00:00
|
|
|
- cached_closes_issues
|
2016-09-21 11:01:46 +00:00
|
|
|
- metrics
|
2016-12-23 05:44:02 +00:00
|
|
|
- timelogs
|
2017-03-22 19:36:14 +00:00
|
|
|
- head_pipeline
|
Use latest_merge_request_diff association
Compared to the merge_request_diff association:
1. It's simpler to query. The query uses a foreign key to the
merge_request_diffs table, so no ordering is necessary.
2. It's faster for preloading. The merge_request_diff association has to load
every diff for the MRs in the set, then discard all but the most recent for
each. This association means that Rails can just query for N diffs from N
MRs.
3. It's more complicated to update. This is a bidirectional foreign key, so we
need to update two tables when adding a diff record. This also means we need
to handle this as a special case when importing a GitLab project.
There is some juggling with this association in the merge request model:
* `MergeRequest#latest_merge_request_diff` is _always_ the latest diff.
* `MergeRequest#merge_request_diff` reuses
`MergeRequest#latest_merge_request_diff` unless:
* Arguments are passed. These are typically to force-reload the association.
* It doesn't exist. That means we might be trying to implicitly create a
diff. This only seems to happen in specs.
* The association is already loaded. This is important for the reasons
explained in the comment, which I'll reiterate here: if we a) load a
non-latest diff, then b) get its `merge_request`, then c) get that MR's
`merge_request_diff`, we should get the diff we loaded in c), even though
that's not the latest diff.
Basically, `MergeRequest#merge_request_diff` is the latest diff in most cases,
but not quite all.
2017-11-15 17:22:18 +00:00
|
|
|
- latest_merge_request_diff
|
2019-03-27 08:46:29 +00:00
|
|
|
- pipelines_for_merge_request
|
2019-03-22 16:51:47 +00:00
|
|
|
- merge_request_assignees
|
2019-03-15 17:35:34 +00:00
|
|
|
- suggestions
|
2020-04-15 12:09:18 +00:00
|
|
|
- diff_note_positions
|
2019-11-13 15:07:29 +00:00
|
|
|
- unresolved_notes
|
2019-04-07 18:35:16 +00:00
|
|
|
- assignees
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- reviews
|
|
|
|
- approval_rules
|
|
|
|
- approvals
|
|
|
|
- approvers
|
|
|
|
- approver_users
|
|
|
|
- approver_groups
|
|
|
|
- approved_by_users
|
|
|
|
- draft_notes
|
|
|
|
- merge_train
|
|
|
|
- blocks_as_blocker
|
|
|
|
- blocks_as_blockee
|
|
|
|
- blocking_merge_requests
|
|
|
|
- blocked_merge_requests
|
2019-10-18 11:11:44 +00:00
|
|
|
- description_versions
|
2019-11-29 15:06:43 +00:00
|
|
|
- deployment_merge_requests
|
|
|
|
- deployments
|
2019-12-10 15:07:52 +00:00
|
|
|
- user_mentions
|
2020-04-03 09:09:31 +00:00
|
|
|
- system_note_metadata
|
2019-08-09 09:40:45 +00:00
|
|
|
external_pull_requests:
|
|
|
|
- project
|
2016-09-02 12:26:13 +00:00
|
|
|
merge_request_diff:
|
|
|
|
- merge_request
|
2017-06-16 14:00:58 +00:00
|
|
|
- merge_request_diff_commits
|
2017-06-09 11:48:25 +00:00
|
|
|
- merge_request_diff_files
|
2017-06-16 14:00:58 +00:00
|
|
|
merge_request_diff_commits:
|
|
|
|
- merge_request_diff
|
2017-06-09 11:48:25 +00:00
|
|
|
merge_request_diff_files:
|
|
|
|
- merge_request_diff
|
2020-01-29 15:08:59 +00:00
|
|
|
merge_request_context_commits:
|
|
|
|
- merge_request
|
|
|
|
- diff_files
|
2018-12-05 14:39:15 +00:00
|
|
|
ci_pipelines:
|
2016-09-02 12:26:13 +00:00
|
|
|
- project
|
|
|
|
- user
|
2017-06-05 08:34:30 +00:00
|
|
|
- stages
|
2016-09-02 12:26:13 +00:00
|
|
|
- statuses
|
2019-12-24 15:07:44 +00:00
|
|
|
- latest_statuses_ordered_by_stage
|
2016-09-02 12:26:13 +00:00
|
|
|
- builds
|
2019-01-23 10:10:18 +00:00
|
|
|
- processables
|
2016-09-02 12:26:13 +00:00
|
|
|
- trigger_requests
|
2017-07-26 09:31:09 +00:00
|
|
|
- variables
|
2017-03-19 15:47:37 +00:00
|
|
|
- auto_canceled_by
|
|
|
|
- auto_canceled_pipelines
|
2017-04-06 13:32:56 +00:00
|
|
|
- auto_canceled_jobs
|
2017-04-06 19:37:28 +00:00
|
|
|
- pending_builds
|
2019-12-24 15:07:44 +00:00
|
|
|
- failed_builds
|
2017-04-06 19:37:28 +00:00
|
|
|
- retryable_builds
|
|
|
|
- cancelable_statuses
|
|
|
|
- manual_actions
|
2018-10-02 09:10:58 +00:00
|
|
|
- scheduled_actions
|
2017-04-06 19:37:28 +00:00
|
|
|
- artifacts
|
2017-05-07 22:35:56 +00:00
|
|
|
- pipeline_schedule
|
2019-03-01 05:10:07 +00:00
|
|
|
- merge_requests_as_head_pipeline
|
2018-12-05 06:57:00 +00:00
|
|
|
- merge_request
|
2019-08-09 09:40:45 +00:00
|
|
|
- external_pull_request
|
2018-12-03 06:46:45 +00:00
|
|
|
- deployments
|
|
|
|
- environments
|
2019-02-20 21:29:48 +00:00
|
|
|
- chat_data
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- source_pipeline
|
2020-02-27 18:09:21 +00:00
|
|
|
- ref_status
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- source_bridge
|
|
|
|
- source_job
|
|
|
|
- sourced_pipelines
|
2020-03-06 11:28:26 +00:00
|
|
|
- source_project
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- triggered_by_pipeline
|
|
|
|
- triggered_pipelines
|
2020-01-13 12:08:04 +00:00
|
|
|
- child_pipelines
|
|
|
|
- parent_pipeline
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- downstream_bridges
|
|
|
|
- job_artifacts
|
|
|
|
- vulnerabilities_occurrence_pipelines
|
2019-10-07 06:06:10 +00:00
|
|
|
- vulnerability_findings
|
2019-12-24 00:07:31 +00:00
|
|
|
- pipeline_config
|
2020-02-05 21:09:02 +00:00
|
|
|
- security_scans
|
2020-05-06 15:09:42 +00:00
|
|
|
- daily_build_group_report_results
|
2017-07-26 09:31:09 +00:00
|
|
|
pipeline_variables:
|
|
|
|
- pipeline
|
2017-06-05 08:34:30 +00:00
|
|
|
stages:
|
|
|
|
- project
|
|
|
|
- pipeline
|
|
|
|
- statuses
|
2020-01-17 15:08:37 +00:00
|
|
|
- processables
|
2017-06-05 08:34:30 +00:00
|
|
|
- builds
|
2019-01-23 10:15:14 +00:00
|
|
|
- bridges
|
2020-05-14 18:08:06 +00:00
|
|
|
- latest_statuses
|
2016-09-02 12:26:13 +00:00
|
|
|
statuses:
|
|
|
|
- project
|
|
|
|
- pipeline
|
2017-06-05 08:34:30 +00:00
|
|
|
- stage
|
2016-09-02 12:26:13 +00:00
|
|
|
- user
|
2017-04-06 13:32:56 +00:00
|
|
|
- auto_canceled_by
|
2020-05-21 06:08:25 +00:00
|
|
|
- needs
|
2016-09-02 12:26:13 +00:00
|
|
|
variables:
|
|
|
|
- project
|
|
|
|
triggers:
|
|
|
|
- project
|
|
|
|
- trigger_requests
|
2017-03-05 20:23:57 +00:00
|
|
|
- owner
|
2017-05-07 22:35:56 +00:00
|
|
|
pipeline_schedules:
|
|
|
|
- project
|
|
|
|
- owner
|
|
|
|
- pipelines
|
|
|
|
- last_pipeline
|
2017-07-03 13:13:10 +00:00
|
|
|
- variables
|
2017-05-07 22:35:56 +00:00
|
|
|
pipeline_schedule:
|
|
|
|
- pipelines
|
2017-07-01 10:23:41 +00:00
|
|
|
pipeline_schedule_variables:
|
|
|
|
- pipeline_schedule
|
2018-04-06 03:02:13 +00:00
|
|
|
deploy_tokens:
|
|
|
|
- project_deploy_tokens
|
|
|
|
- projects
|
2016-09-02 12:26:13 +00:00
|
|
|
deploy_keys:
|
|
|
|
- user
|
|
|
|
- deploy_keys_projects
|
|
|
|
- projects
|
|
|
|
services:
|
|
|
|
- project
|
|
|
|
- service_hook
|
2019-05-22 15:47:42 +00:00
|
|
|
- jira_tracker_data
|
|
|
|
- issue_tracker_data
|
2020-03-27 12:07:43 +00:00
|
|
|
- open_project_tracker_data
|
2016-09-02 12:26:13 +00:00
|
|
|
hooks:
|
|
|
|
- project
|
2017-04-27 10:08:57 +00:00
|
|
|
- web_hook_logs
|
2016-09-02 12:26:13 +00:00
|
|
|
protected_branches:
|
|
|
|
- project
|
|
|
|
- merge_access_levels
|
|
|
|
- push_access_levels
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- unprotect_access_levels
|
2017-04-04 01:19:04 +00:00
|
|
|
protected_tags:
|
|
|
|
- project
|
2017-04-04 02:37:22 +00:00
|
|
|
- create_access_levels
|
2016-09-21 11:01:46 +00:00
|
|
|
merge_access_levels:
|
|
|
|
- protected_branch
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- user
|
|
|
|
- group
|
2016-09-21 11:01:46 +00:00
|
|
|
push_access_levels:
|
|
|
|
- protected_branch
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- user
|
|
|
|
- group
|
2017-04-04 02:37:22 +00:00
|
|
|
create_access_levels:
|
2017-05-05 15:59:31 +00:00
|
|
|
- user
|
2017-04-04 01:19:04 +00:00
|
|
|
- protected_tag
|
2017-05-05 15:59:31 +00:00
|
|
|
- group
|
2017-03-23 14:54:59 +00:00
|
|
|
container_repositories:
|
2017-03-24 12:27:18 +00:00
|
|
|
- project
|
2016-12-16 03:24:05 +00:00
|
|
|
- name
|
2016-09-02 12:26:13 +00:00
|
|
|
project:
|
|
|
|
- taggings
|
|
|
|
- base_tags
|
|
|
|
- tag_taggings
|
|
|
|
- tags
|
2016-11-18 10:38:54 +00:00
|
|
|
- chat_services
|
2017-10-04 07:04:45 +00:00
|
|
|
- cluster
|
2017-11-06 17:06:02 +00:00
|
|
|
- clusters
|
2017-11-03 11:26:38 +00:00
|
|
|
- cluster_project
|
2016-09-02 12:26:13 +00:00
|
|
|
- creator
|
2019-08-15 19:19:37 +00:00
|
|
|
- cycle_analytics_stages
|
2016-09-02 12:26:13 +00:00
|
|
|
- group
|
|
|
|
- namespace
|
2019-10-14 12:06:14 +00:00
|
|
|
- management_clusters
|
2016-10-06 17:37:41 +00:00
|
|
|
- boards
|
2016-09-02 12:26:13 +00:00
|
|
|
- last_event
|
|
|
|
- services
|
|
|
|
- campfire_service
|
2018-10-30 11:23:20 +00:00
|
|
|
- discord_service
|
2016-09-02 12:26:13 +00:00
|
|
|
- drone_ci_service
|
|
|
|
- emails_on_push_service
|
2016-10-03 20:16:14 +00:00
|
|
|
- pipelines_email_service
|
2016-11-18 15:16:45 +00:00
|
|
|
- mattermost_slash_commands_service
|
2016-12-18 22:32:53 +00:00
|
|
|
- slack_slash_commands_service
|
2016-09-02 12:26:13 +00:00
|
|
|
- irker_service
|
2017-09-21 20:05:44 +00:00
|
|
|
- packagist_service
|
2016-09-02 12:26:13 +00:00
|
|
|
- pivotaltracker_service
|
2017-03-07 16:57:42 +00:00
|
|
|
- prometheus_service
|
2019-04-09 13:06:36 +00:00
|
|
|
- hipchat_service
|
2016-09-02 12:26:13 +00:00
|
|
|
- flowdock_service
|
|
|
|
- assembla_service
|
|
|
|
- asana_service
|
2016-12-20 21:14:33 +00:00
|
|
|
- slack_service
|
2017-04-03 15:37:23 +00:00
|
|
|
- microsoft_teams_service
|
2016-12-20 21:29:39 +00:00
|
|
|
- mattermost_service
|
2018-06-24 10:12:07 +00:00
|
|
|
- hangouts_chat_service
|
2019-12-02 12:06:45 +00:00
|
|
|
- unify_circuit_service
|
2016-09-02 12:26:13 +00:00
|
|
|
- buildkite_service
|
|
|
|
- bamboo_service
|
|
|
|
- teamcity_service
|
|
|
|
- pushover_service
|
|
|
|
- jira_service
|
|
|
|
- redmine_service
|
2019-02-18 17:08:36 +00:00
|
|
|
- youtrack_service
|
2016-09-02 12:26:13 +00:00
|
|
|
- custom_issue_tracker_service
|
|
|
|
- bugzilla_service
|
|
|
|
- gitlab_issue_tracker_service
|
|
|
|
- external_wiki_service
|
2017-03-02 16:41:41 +00:00
|
|
|
- mock_ci_service
|
2017-04-05 11:04:34 +00:00
|
|
|
- mock_deployment_service
|
|
|
|
- mock_monitoring_service
|
2018-08-31 17:16:34 +00:00
|
|
|
- forked_to_members
|
2016-09-02 12:26:13 +00:00
|
|
|
- forked_from_project
|
|
|
|
- forks
|
|
|
|
- merge_requests
|
|
|
|
- fork_merge_requests
|
|
|
|
- issues
|
|
|
|
- labels
|
|
|
|
- events
|
|
|
|
- milestones
|
2020-05-14 12:08:21 +00:00
|
|
|
- iterations
|
2016-09-02 12:26:13 +00:00
|
|
|
- notes
|
|
|
|
- snippets
|
|
|
|
- hooks
|
|
|
|
- protected_branches
|
2017-04-04 01:19:04 +00:00
|
|
|
- protected_tags
|
2016-09-02 12:26:13 +00:00
|
|
|
- project_members
|
2018-11-29 16:08:14 +00:00
|
|
|
- project_repository
|
2016-09-02 12:26:13 +00:00
|
|
|
- users
|
|
|
|
- requesters
|
|
|
|
- deploy_keys_projects
|
|
|
|
- deploy_keys
|
|
|
|
- users_star_projects
|
|
|
|
- starrers
|
|
|
|
- releases
|
|
|
|
- lfs_objects_projects
|
|
|
|
- lfs_objects
|
|
|
|
- project_group_links
|
|
|
|
- invited_groups
|
|
|
|
- todos
|
|
|
|
- notification_settings
|
|
|
|
- import_data
|
|
|
|
- commit_statuses
|
2018-12-05 14:39:15 +00:00
|
|
|
- ci_pipelines
|
|
|
|
- all_pipelines
|
2018-05-22 12:00:42 +00:00
|
|
|
- stages
|
2020-02-27 18:09:21 +00:00
|
|
|
- ci_refs
|
2016-09-02 12:26:13 +00:00
|
|
|
- builds
|
|
|
|
- runner_projects
|
|
|
|
- runners
|
|
|
|
- variables
|
|
|
|
- triggers
|
2017-05-07 22:35:56 +00:00
|
|
|
- pipeline_schedules
|
2016-09-02 12:26:13 +00:00
|
|
|
- environments
|
2019-11-14 03:06:25 +00:00
|
|
|
- environments_for_dashboard
|
2016-09-02 12:26:13 +00:00
|
|
|
- deployments
|
2016-09-21 18:43:29 +00:00
|
|
|
- project_feature
|
2017-08-30 18:39:23 +00:00
|
|
|
- auto_devops
|
2017-02-01 22:43:36 +00:00
|
|
|
- pages_domains
|
2016-11-21 13:36:40 +00:00
|
|
|
- authorized_users
|
|
|
|
- project_authorizations
|
2018-05-03 12:55:14 +00:00
|
|
|
- remote_mirrors
|
2016-10-31 11:00:53 +00:00
|
|
|
- route
|
2017-05-01 20:46:30 +00:00
|
|
|
- redirect_routes
|
2016-11-22 16:58:10 +00:00
|
|
|
- statistics
|
2017-03-24 12:27:18 +00:00
|
|
|
- container_repositories
|
2017-03-03 18:22:39 +00:00
|
|
|
- uploads
|
2018-10-07 18:31:08 +00:00
|
|
|
- file_uploads
|
2018-05-02 13:35:04 +00:00
|
|
|
- import_state
|
2017-09-05 16:03:24 +00:00
|
|
|
- members_and_requesters
|
2017-09-25 16:54:08 +00:00
|
|
|
- build_trace_section_names
|
2018-04-26 08:25:20 +00:00
|
|
|
- build_trace_chunks
|
2019-09-18 21:06:34 +00:00
|
|
|
- job_artifacts
|
2017-09-28 13:34:09 +00:00
|
|
|
- root_of_fork_network
|
|
|
|
- fork_network_member
|
|
|
|
- fork_network
|
2019-11-28 15:06:57 +00:00
|
|
|
- fork_network_projects
|
2017-09-18 13:03:24 +00:00
|
|
|
- custom_attributes
|
2018-02-07 13:00:53 +00:00
|
|
|
- lfs_file_locks
|
2018-03-05 17:51:40 +00:00
|
|
|
- project_badges
|
2018-02-26 12:32:42 +00:00
|
|
|
- source_of_merge_requests
|
2018-03-13 21:17:29 +00:00
|
|
|
- internal_ids
|
2018-04-06 03:02:13 +00:00
|
|
|
- project_deploy_tokens
|
2018-03-19 16:11:12 +00:00
|
|
|
- deploy_tokens
|
2017-12-20 08:38:58 +00:00
|
|
|
- settings
|
2018-04-12 12:07:44 +00:00
|
|
|
- ci_cd_settings
|
2018-06-25 13:10:26 +00:00
|
|
|
- import_export_upload
|
Add repository languages for projects
Our friends at GitHub show the programming languages for a long time,
and inspired by that this commit means to create about the same
functionality.
Language detection is done through Linguist, as before, where the
difference is that we cache the result in the database. Also, Gitaly can
incrementaly scan a repository. This is done through a shell out, which
creates overhead of about 3s each run. For now this won't be improved.
Scans are triggered by pushed to the default branch, usually `master`.
However, one exception to this rule the charts page. If we're requesting
this expensive data anyway, we just cache it in the database.
Edge cases where there is no repository, or its empty are caught in the
Repository model. This makes use of Redis caching, which is probably
already loaded.
The added model is called RepositoryLanguage, which will make it harder
if/when GitLab supports multiple repositories per project. However, for
now I think this shouldn't be a concern. Also, Language could be
confused with the i18n languages and felt like the current name was
suiteable too.
Design of the Project#Show page is done with help from @dimitrieh. This
change is not visible to the end user unless detections are done.
2018-06-06 11:10:59 +00:00
|
|
|
- repository_languages
|
2018-10-19 03:44:41 +00:00
|
|
|
- pool_repository
|
2018-11-23 03:28:16 +00:00
|
|
|
- kubernetes_namespaces
|
2019-01-07 17:55:21 +00:00
|
|
|
- error_tracking_setting
|
2019-04-26 17:23:26 +00:00
|
|
|
- metrics_setting
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- gitlab_slack_application_service
|
|
|
|
- github_service
|
|
|
|
- protected_environments
|
|
|
|
- mirror_user
|
|
|
|
- push_rule
|
|
|
|
- jenkins_service
|
|
|
|
- index_status
|
|
|
|
- feature_usage
|
|
|
|
- approval_rules
|
2019-09-09 23:52:54 +00:00
|
|
|
- approval_merge_request_rules
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- approvers
|
|
|
|
- approver_users
|
|
|
|
- pages_domains
|
|
|
|
- audit_events
|
|
|
|
- path_locks
|
|
|
|
- approver_groups
|
|
|
|
- repository_state
|
|
|
|
- source_pipelines
|
|
|
|
- sourced_pipelines
|
|
|
|
- prometheus_metrics
|
|
|
|
- vulnerabilities
|
2020-03-20 18:09:31 +00:00
|
|
|
- vulnerability_exports
|
2019-10-07 06:06:10 +00:00
|
|
|
- vulnerability_findings
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- vulnerability_feedback
|
|
|
|
- vulnerability_identifiers
|
|
|
|
- vulnerability_scanners
|
|
|
|
- operations_feature_flags
|
|
|
|
- operations_feature_flags_client
|
2020-04-21 15:21:10 +00:00
|
|
|
- operations_feature_flags_user_lists
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- prometheus_alerts
|
|
|
|
- prometheus_alert_events
|
2019-10-17 15:06:17 +00:00
|
|
|
- self_managed_prometheus_alert_events
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- software_license_policies
|
|
|
|
- project_registry
|
|
|
|
- packages
|
|
|
|
- package_files
|
|
|
|
- tracing_setting
|
|
|
|
- alerting_setting
|
2020-02-10 12:08:59 +00:00
|
|
|
- project_setting
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- webide_pipelines
|
|
|
|
- reviews
|
|
|
|
- incident_management_setting
|
|
|
|
- merge_trains
|
|
|
|
- designs
|
2019-06-18 04:15:17 +00:00
|
|
|
- project_aliases
|
2019-08-09 09:40:45 +00:00
|
|
|
- external_pull_requests
|
2019-09-25 09:06:04 +00:00
|
|
|
- pages_metadatum
|
2019-09-25 12:06:15 +00:00
|
|
|
- alerts_service
|
2019-10-03 21:07:29 +00:00
|
|
|
- grafana_integration
|
2019-10-23 21:06:17 +00:00
|
|
|
- remove_source_branch_after_merge
|
2019-10-30 15:14:17 +00:00
|
|
|
- deleting_user
|
2019-11-14 09:06:15 +00:00
|
|
|
- upstream_projects
|
|
|
|
- downstream_projects
|
|
|
|
- upstream_project_subscriptions
|
|
|
|
- downstream_project_subscriptions
|
2019-11-19 12:06:00 +00:00
|
|
|
- service_desk_setting
|
2019-11-28 15:06:57 +00:00
|
|
|
- import_failures
|
2019-12-11 12:08:10 +00:00
|
|
|
- container_expiration_policy
|
2019-12-19 15:07:55 +00:00
|
|
|
- resource_groups
|
2020-01-08 00:07:43 +00:00
|
|
|
- autoclose_referenced_issues
|
2020-03-04 06:08:23 +00:00
|
|
|
- status_page_setting
|
2020-03-05 18:08:19 +00:00
|
|
|
- requirements
|
2020-03-12 09:09:55 +00:00
|
|
|
- export_jobs
|
2020-05-06 15:09:42 +00:00
|
|
|
- daily_build_group_report_results
|
2020-04-06 06:09:19 +00:00
|
|
|
- jira_imports
|
2020-04-08 12:09:42 +00:00
|
|
|
- compliance_framework_setting
|
2020-04-30 00:09:37 +00:00
|
|
|
- metrics_users_starred_dashboards
|
2020-04-23 00:09:41 +00:00
|
|
|
- alert_management_alerts
|
2020-05-06 06:09:36 +00:00
|
|
|
- repository_storage_moves
|
2020-05-09 00:09:39 +00:00
|
|
|
- freeze_periods
|
2020-05-18 15:08:15 +00:00
|
|
|
- webex_teams_service
|
2016-09-21 18:43:29 +00:00
|
|
|
award_emoji:
|
|
|
|
- awardable
|
2016-10-03 20:16:14 +00:00
|
|
|
- user
|
2016-10-18 17:31:10 +00:00
|
|
|
priorities:
|
2016-11-18 10:38:54 +00:00
|
|
|
- label
|
2018-09-04 09:55:45 +00:00
|
|
|
prometheus_metrics:
|
|
|
|
- project
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
- prometheus_alerts
|
2016-12-23 05:44:02 +00:00
|
|
|
timelogs:
|
2017-01-26 01:16:09 +00:00
|
|
|
- issue
|
|
|
|
- merge_request
|
2016-12-23 05:44:02 +00:00
|
|
|
- user
|
Migrate events into a new format
This commit migrates events data in such a way that push events are
stored much more efficiently. This is done by creating a shadow table
called "events_for_migration", and a table called "push_event_payloads"
which is used for storing push data of push events. The background
migration in this commit will copy events from the "events" table into
the "events_for_migration" table, push events in will also have a row
created in "push_event_payloads".
This approach allows us to reclaim space in the next release by simply
swapping the "events" and "events_for_migration" tables, then dropping
the old events (now "events_for_migration") table.
The new table structure is also optimised for storage space, and does
not include the unused "title" column nor the "data" column (since this
data is moved to "push_event_payloads").
== Newly Created Events
Newly created events are inserted into both "events" and
"events_for_migration", both using the exact same primary key value. The
table "push_event_payloads" in turn has a foreign key to the _shadow_
table. This removes the need for recreating and validating the foreign
key after swapping the tables. Since the shadow table also has a foreign
key to "projects.id" we also don't have to worry about orphaned rows.
This approach however does require some additional storage as we're
duplicating a portion of the events data for at least 1 release. The
exact amount is hard to estimate, but for GitLab.com this is expected to
be between 10 and 20 GB at most. The background migration in this commit
deliberately does _not_ update the "events" table as doing so would put
a lot of pressure on PostgreSQL's auto vacuuming system.
== Supporting Both Old And New Events
Application code has also been adjusted to support push events using
both the old and new data formats. This is done by creating a PushEvent
class which extends the regular Event class. Using Rails' Single Table
Inheritance system we can ensure the right class is used for the right
data, which in this case is based on the value of `events.action`. To
support displaying old and new data at the same time the PushEvent class
re-defines a few methods of the Event class, falling back to their
original implementations for push events in the old format.
Once all existing events have been migrated the various push event
related methods can be removed from the Event model, and the calls to
`super` can be removed from the methods in the PushEvent model.
The UI and event atom feed have also been slightly changed to better
handle this new setup, fortunately only a few changes were necessary to
make this work.
== API Changes
The API only displays push data of events in the new format. Supporting
both formats in the API is a bit more difficult compared to the UI.
Since the old push data was not really well documented (apart from one
example that used an incorrect "action" nmae) I decided that supporting
both was not worth the effort, especially since events will be migrated
in a few days _and_ new events are created in the correct format.
2017-07-10 15:43:57 +00:00
|
|
|
push_event_payload:
|
|
|
|
- event
|
2017-10-31 15:13:09 +00:00
|
|
|
issue_assignees:
|
|
|
|
- issue
|
2017-11-06 17:06:02 +00:00
|
|
|
- assignee
|
2019-04-07 18:35:16 +00:00
|
|
|
merge_request_assignees:
|
|
|
|
- merge_request
|
|
|
|
- assignee
|
2018-02-07 13:00:53 +00:00
|
|
|
lfs_file_locks:
|
|
|
|
- user
|
2018-03-05 17:51:40 +00:00
|
|
|
project_badges:
|
|
|
|
- project
|
2018-05-28 20:18:43 +00:00
|
|
|
metrics:
|
|
|
|
- merge_request
|
|
|
|
- latest_closed_by
|
|
|
|
- merged_by
|
|
|
|
- pipeline
|
2018-09-07 13:39:20 +00:00
|
|
|
resource_label_events:
|
|
|
|
- user
|
|
|
|
- issue
|
|
|
|
- merge_request
|
|
|
|
- epic
|
|
|
|
- label
|
2019-01-07 17:55:21 +00:00
|
|
|
error_tracking_setting:
|
|
|
|
- project
|
2019-03-15 17:35:34 +00:00
|
|
|
suggestions:
|
|
|
|
- note
|
2020-04-15 12:09:18 +00:00
|
|
|
diff_note_positions:
|
|
|
|
- note
|
2019-04-26 17:23:26 +00:00
|
|
|
metrics_setting:
|
|
|
|
- project
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
protected_environments:
|
|
|
|
- project
|
|
|
|
- deploy_access_levels
|
|
|
|
deploy_access_levels:
|
|
|
|
- protected_environment
|
|
|
|
- user
|
|
|
|
- group
|
|
|
|
unprotect_access_levels:
|
|
|
|
- user
|
|
|
|
- protected_branch
|
|
|
|
- group
|
|
|
|
prometheus_alerts:
|
|
|
|
- project
|
|
|
|
- prometheus_alert_events
|
|
|
|
prometheus_alert_events:
|
|
|
|
- project
|
2019-10-17 15:06:17 +00:00
|
|
|
self_managed_prometheus_alert_events:
|
|
|
|
- project
|
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.
2019-04-29 12:16:03 +00:00
|
|
|
epic_issues:
|
|
|
|
- issue
|
|
|
|
- epic
|
|
|
|
tracing_setting:
|
|
|
|
- project
|
|
|
|
reviews:
|
|
|
|
- project
|
|
|
|
- merge_request
|
|
|
|
- author
|
|
|
|
- notes
|
|
|
|
incident_management_setting:
|
|
|
|
- project
|
|
|
|
merge_trains:
|
|
|
|
- project
|
|
|
|
- merge_request
|
2019-08-02 19:35:10 +00:00
|
|
|
boards:
|
|
|
|
- group
|
|
|
|
- lists
|
|
|
|
- destroyable_lists
|
|
|
|
- milestone
|
|
|
|
- board_labels
|
|
|
|
- board_assignee
|
|
|
|
- assignee
|
|
|
|
- labels
|
|
|
|
lists:
|
|
|
|
- user
|
|
|
|
- milestone
|
|
|
|
- board
|
|
|
|
- label
|
2019-08-28 20:18:40 +00:00
|
|
|
- list_user_preferences
|
2019-09-03 09:38:59 +00:00
|
|
|
milestone_releases:
|
|
|
|
- milestone
|
|
|
|
- release
|
2019-10-17 15:06:17 +00:00
|
|
|
evidences:
|
|
|
|
- release
|
2019-09-27 09:06:26 +00:00
|
|
|
design: &design
|
|
|
|
- issue
|
|
|
|
- actions
|
|
|
|
- versions
|
|
|
|
- notes
|
2019-12-10 15:07:52 +00:00
|
|
|
- user_mentions
|
2019-09-27 09:06:26 +00:00
|
|
|
designs: *design
|
|
|
|
actions:
|
|
|
|
- design
|
|
|
|
- version
|
2020-02-21 21:08:57 +00:00
|
|
|
- uploads
|
|
|
|
- file_uploads
|
2019-09-27 09:06:26 +00:00
|
|
|
versions: &version
|
2019-12-17 00:07:59 +00:00
|
|
|
- author
|
2019-09-27 09:06:26 +00:00
|
|
|
- issue
|
|
|
|
- designs
|
|
|
|
- actions
|
2019-10-28 18:06:15 +00:00
|
|
|
zoom_meetings:
|
|
|
|
- issue
|
2019-12-10 12:07:55 +00:00
|
|
|
sentry_issue:
|
|
|
|
- issue
|
2019-09-27 09:06:26 +00:00
|
|
|
design_versions: *version
|
2020-01-14 12:07:41 +00:00
|
|
|
epic:
|
|
|
|
- subscriptions
|
|
|
|
- award_emoji
|
|
|
|
- description_versions
|
|
|
|
- author
|
|
|
|
- assignee
|
|
|
|
- issues
|
|
|
|
- epic_issues
|
|
|
|
- milestone
|
|
|
|
- notes
|
|
|
|
- label_links
|
|
|
|
- labels
|
|
|
|
- todos
|
|
|
|
- metrics
|
|
|
|
- group
|
|
|
|
- parent
|
|
|
|
- children
|
|
|
|
- updated_by
|
|
|
|
- last_edited_by
|
|
|
|
- closed_by
|
|
|
|
- start_date_sourcing_milestone
|
|
|
|
- due_date_sourcing_milestone
|
|
|
|
- start_date_sourcing_epic
|
|
|
|
- due_date_sourcing_epic
|
|
|
|
- events
|
|
|
|
- resource_label_events
|
2020-02-10 12:08:59 +00:00
|
|
|
- user_mentions
|
2020-03-02 09:07:59 +00:00
|
|
|
epic_issue:
|
|
|
|
- epic
|
|
|
|
- issue
|
2020-04-03 09:09:31 +00:00
|
|
|
system_note_metadata:
|
|
|
|
- note
|
|
|
|
- description_version
|
2020-04-28 15:09:29 +00:00
|
|
|
status_page_published_incident:
|
|
|
|
- issue
|