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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
f6c0ef55
Commit
f6c0ef55
authored
May 08, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditionally remove indices that may not exist in pre-GitLab v6.7 installations
Closes #1593
parent
c4aa7003
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb
..._add_missing_unique_indices.acts_as_taggable_on_engine.rb
+9
-2
No files found.
db/migrate/20150425164648_add_missing_unique_indices.acts_as_taggable_on_engine.rb
View file @
f6c0ef55
...
...
@@ -3,8 +3,15 @@ class AddMissingUniqueIndices < ActiveRecord::Migration
def
self
.
up
add_index
:tags
,
:name
,
unique:
true
remove_index
:taggings
,
:tag_id
remove_index
:taggings
,
[
:taggable_id
,
:taggable_type
,
:context
]
# pre-GitLab v6.7.0 may not have these indices since there were no
# migrations for them
if
index_exists?
(
:taggings
,
:tag_id
)
remove_index
:taggings
,
:tag_id
end
if
index_exists?
(
:taggings
,
[
:taggable_id
,
:taggable_type
,
:context
])
remove_index
:taggings
,
[
:taggable_id
,
:taggable_type
,
:context
]
end
add_index
:taggings
,
[
:tag_id
,
:taggable_id
,
:taggable_type
,
:context
,
:tagger_id
,
:tagger_type
],
unique:
true
,
name:
'taggings_idx'
...
...
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