Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e31e70d4
Commit
e31e70d4
authored
Nov 15, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove indexes for FK
parent
bef905a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb
...te/20181030154446_add_missing_indexes_for_foreign_keys.rb
+26
-1
No files found.
db/migrate/20181030154446_add_missing_indexes_for_foreign_keys.rb
View file @
e31e70d4
...
...
@@ -33,6 +33,31 @@ class AddMissingIndexesForForeignKeys < ActiveRecord::Migration
end
def
down
# no-op
# MySQL requires index for FK,
# thus removal of indexes does fail
return
if
Gitlab
::
Database
.
mysql?
remove_concurrent_index
(
:application_settings
,
:usage_stats_set_by_user_id
)
remove_concurrent_index
(
:ci_pipeline_schedules
,
:owner_id
)
remove_concurrent_index
(
:ci_trigger_requests
,
:trigger_id
)
remove_concurrent_index
(
:ci_triggers
,
:owner_id
)
remove_concurrent_index
(
:clusters_applications_helm
,
:cluster_id
,
unique:
true
)
remove_concurrent_index
(
:clusters_applications_ingress
,
:cluster_id
,
unique:
true
)
remove_concurrent_index
(
:clusters_applications_jupyter
,
:cluster_id
,
unique:
true
)
remove_concurrent_index
(
:clusters_applications_jupyter
,
:oauth_application_id
)
remove_concurrent_index
(
:clusters_applications_prometheus
,
:cluster_id
,
unique:
true
)
remove_concurrent_index
(
:fork_network_members
,
:forked_from_project_id
)
remove_concurrent_index
(
:internal_ids
,
:namespace_id
)
remove_concurrent_index
(
:internal_ids
,
:project_id
)
remove_concurrent_index
(
:issues
,
:closed_by_id
)
remove_concurrent_index
(
:label_priorities
,
:label_id
)
remove_concurrent_index
(
:merge_request_metrics
,
:merged_by_id
)
remove_concurrent_index
(
:merge_request_metrics
,
:latest_closed_by_id
)
remove_concurrent_index
(
:oauth_openid_requests
,
:access_grant_id
)
remove_concurrent_index
(
:project_deploy_tokens
,
:deploy_token_id
)
remove_concurrent_index
(
:protected_tag_create_access_levels
,
:group_id
)
remove_concurrent_index
(
:subscriptions
,
:project_id
)
remove_concurrent_index
(
:user_statuses
,
:user_id
)
remove_concurrent_index
(
:users
,
:accepted_term_id
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment