Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
GitLab Community Edition
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hkystyle
GitLab Community Edition
Commits
2bd5dadb
Commit
2bd5dadb
authored
Jun 05, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a gurad caluse to block adding concurrent index for mysql
parent
9a5e1276
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
db/migrate/20180428200509_add_index_to_ci_builds_artifacts_file.rb
...e/20180428200509_add_index_to_ci_builds_artifacts_file.rb
+3
-1
db/schema.rb
db/schema.rb
+2
-1
No files found.
db/migrate/20180428200509_add_index_to_ci_builds_artifacts_file.rb
View file @
2bd5dadb
...
...
@@ -6,10 +6,12 @@ class AddIndexToCiBuildsArtifactsFile < ActiveRecord::Migration
disable_ddl_transaction!
def
up
return
unless
Gitlab
::
Database
.
postgresql?
# We add an temporary index to `ci_builds.artifacts_file` column to avoid statements timeout in legacy artifacts migrations
# This index is to be removed after we have cleaned up background migrations
# https://gitlab.com/gitlab-org/gitlab-ce/issues/46866
add_concurrent_index
:ci_builds
,
:artifacts_file
,
where:
"artifacts_file <> ''"
,
length:
20
add_concurrent_index
:ci_builds
,
:artifacts_file
,
where:
"artifacts_file <> ''"
end
def
down
...
...
db/schema.rb
View file @
2bd5dadb
...
...
@@ -331,7 +331,7 @@ ActiveRecord::Schema.define(version: 20180603190921) do
end
add_index
"ci_builds"
,
[
"artifacts_expire_at"
],
name:
"index_ci_builds_on_artifacts_expire_at"
,
where:
"(artifacts_file <> ''::text)"
,
using: :btree
add_index
"ci_builds"
,
[
"artifacts_file"
],
name:
"index_ci_builds_on_artifacts_file"
,
where:
"(artifacts_file <> ''::text)"
,
length:
20
,
using: :btree
add_index
"ci_builds"
,
[
"artifacts_file"
],
name:
"index_ci_builds_on_artifacts_file"
,
where:
"(artifacts_file <> ''::text)"
,
using: :btree
add_index
"ci_builds"
,
[
"auto_canceled_by_id"
],
name:
"index_ci_builds_on_auto_canceled_by_id"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"stage_idx"
,
"created_at"
],
name:
"index_ci_builds_on_commit_id_and_stage_idx_and_created_at"
,
using: :btree
add_index
"ci_builds"
,
[
"commit_id"
,
"status"
,
"type"
],
name:
"index_ci_builds_on_commit_id_and_status_and_type"
,
using: :btree
...
...
@@ -1727,6 +1727,7 @@ ActiveRecord::Schema.define(version: 20180603190921) do
end
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path"
,
unique:
true
,
using: :btree
add_index
"redirect_routes"
,
[
"path"
],
name:
"index_redirect_routes_on_path_text_pattern_ops"
,
using: :btree
,
opclasses:
{
"path"
=>
"varchar_pattern_ops"
}
add_index
"redirect_routes"
,
[
"source_type"
,
"source_id"
],
name:
"index_redirect_routes_on_source_type_and_source_id"
,
using: :btree
create_table
"releases"
,
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