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
74afe7ef
Commit
74afe7ef
authored
Sep 05, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix migration when running on MySQL databases
parent
6e6c4c55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
db/migrate/20170905202320_add_missing_indexes_to_geo_event_log.rb
...te/20170905202320_add_missing_indexes_to_geo_event_log.rb
+11
-6
No files found.
db/migrate/20170905202320_add_missing_indexes_to_geo_event_log.rb
View file @
74afe7ef
...
...
@@ -6,14 +6,19 @@ class AddMissingIndexesToGeoEventLog < ActiveRecord::Migration
disable_ddl_transaction!
def
up
add_concurrent_index
:geo_event_log
,
:repositories_changed_event_id
add_concurrent_index
:geo_event_log
,
:repository_deleted_event_id
add_concurrent_index
:geo_event_log
,
:repository_renamed_event_id
# MySQL automatically creates an index on a foreign-key constraint; PostgreSQL does not
if
Gitlab
::
Database
.
postgresql?
add_concurrent_index
:geo_event_log
,
:repositories_changed_event_id
add_concurrent_index
:geo_event_log
,
:repository_deleted_event_id
add_concurrent_index
:geo_event_log
,
:repository_renamed_event_id
end
end
def
down
remove_concurrent_index
:geo_event_log
,
:repositories_changed_event_id
if
index_exists?
:geo_event_log
,
:repositories_changed_event_id
remove_concurrent_index
:geo_event_log
,
:repository_deleted_event_id
if
index_exists?
:geo_event_log
,
:repository_deleted_event_id
remove_concurrent_index
:geo_event_log
,
:repository_renamed_event_id
if
index_exists?
:geo_event_log
,
:repository_renamed_event_id
if
Gitlab
::
Database
.
postgresql?
remove_concurrent_index
:geo_event_log
,
:repositories_changed_event_id
if
index_exists?
:geo_event_log
,
:repositories_changed_event_id
remove_concurrent_index
:geo_event_log
,
:repository_deleted_event_id
if
index_exists?
:geo_event_log
,
:repository_deleted_event_id
remove_concurrent_index
:geo_event_log
,
:repository_renamed_event_id
if
index_exists?
:geo_event_log
,
:repository_renamed_event_id
end
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