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
Léo-Paul Géneau
gitlab-ce
Commits
46114fca
Commit
46114fca
authored
Sep 18, 2017
by
Greg Stark
Committed by
Greg Stark
Sep 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regular expression used for opclasses to not be confused by partial index clause
parent
727f51b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
config/initializers/postgresql_opclasses_support.rb
config/initializers/postgresql_opclasses_support.rb
+1
-1
db/schema.rb
db/schema.rb
+1
-1
No files found.
config/initializers/postgresql_opclasses_support.rb
View file @
46114fca
...
...
@@ -127,7 +127,7 @@ module ActiveRecord
orders
=
desc_order_columns
.
any?
?
Hash
[
desc_order_columns
.
map
{
|
order_column
|
[
order_column
,
:desc
]}]
:
{}
where
=
inddef
.
scan
(
/WHERE (.+)$/
).
flatten
[
0
]
using
=
inddef
.
scan
(
/USING (.+?) /
).
flatten
[
0
].
to_sym
opclasses
=
Hash
[
inddef
.
scan
(
/\((.+
)\)$
/
).
flatten
[
0
].
split
(
','
).
map
do
|
column_and_opclass
|
opclasses
=
Hash
[
inddef
.
scan
(
/\((.+
?)\)(?:$| WHERE )
/
).
flatten
[
0
].
split
(
','
).
map
do
|
column_and_opclass
|
column
,
opclass
=
column_and_opclass
.
split
(
' '
).
map
(
&
:strip
)
[
column
,
opclass
]
if
opclass
end
.
compact
]
...
...
db/schema.rb
View file @
46114fca
...
...
@@ -256,7 +256,7 @@ ActiveRecord::Schema.define(version: 20170914135630) do
add_index
"ci_builds"
,
[
"commit_id"
,
"status"
,
"type"
],
name:
"index_ci_builds_on_commit_id_and_status_and_type"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"name"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_name_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"type"
,
"ref"
],
name:
"index_ci_builds_on_commit_id_and_type_and_ref"
,
using: :btree
add_index
"ci_builds"
,
[
"id"
],
name:
"index_for_ci_builds_retried_migration"
,
where:
"(retried IS NULL)"
,
using: :btree
,
opclasses:
{
"id)"
=>
"WHERE"
}
add_index
"ci_builds"
,
[
"id"
],
name:
"index_for_ci_builds_retried_migration"
,
where:
"(retried IS NULL)"
,
using: :btree
add_index
"ci_builds"
,
[
"project_id"
],
name:
"index_ci_builds_on_project_id"
,
using: :btree
add_index
"ci_builds"
,
[
"protected"
],
name:
"index_ci_builds_on_protected"
,
using: :btree
add_index
"ci_builds"
,
[
"runner_id"
],
name:
"index_ci_builds_on_runner_id"
,
using: :btree
...
...
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