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
Boxiang Sun
gitlab-ce
Commits
4667b20c
Commit
4667b20c
authored
Feb 06, 2019
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add trigram database index on tags
parent
022ee0c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
db/migrate/20190206193120_add_index_to_tags.rb
db/migrate/20190206193120_add_index_to_tags.rb
+18
-0
db/schema.rb
db/schema.rb
+1
-0
No files found.
db/migrate/20190206193120_add_index_to_tags.rb
0 → 100644
View file @
4667b20c
# frozen_string_literal: true
class
AddIndexToTags
<
ActiveRecord
::
Migration
[
5.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_tags_on_name_trigram'
disable_ddl_transaction!
def
up
add_concurrent_index
:tags
,
:name
,
name:
INDEX_NAME
,
using: :gin
,
opclasses:
{
name: :gin_trgm_ops
}
end
def
down
remove_concurrent_index_by_name
(
:tags
,
INDEX_NAME
)
end
end
db/schema.rb
View file @
4667b20c
...
@@ -2053,6 +2053,7 @@ ActiveRecord::Schema.define(version: 20190220150130) do
...
@@ -2053,6 +2053,7 @@ ActiveRecord::Schema.define(version: 20190220150130) do
t
.
string
"name"
t
.
string
"name"
t
.
integer
"taggings_count"
,
default:
0
t
.
integer
"taggings_count"
,
default:
0
t
.
index
[
"name"
],
name:
"index_tags_on_name"
,
unique:
true
,
using: :btree
t
.
index
[
"name"
],
name:
"index_tags_on_name"
,
unique:
true
,
using: :btree
t
.
index
[
"name"
],
name:
"index_tags_on_name_trigram"
,
using: :gin
,
opclasses:
{
"name"
=>
"gin_trgm_ops"
}
end
end
create_table
"term_agreements"
,
force: :cascade
do
|
t
|
create_table
"term_agreements"
,
force: :cascade
do
|
t
|
...
...
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