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
4eeb51dc
Commit
4eeb51dc
authored
Nov 06, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align index name to others
parent
94a8d27e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
db/migrate/20181106135939_add_index_to_deployments.rb
db/migrate/20181106135939_add_index_to_deployments.rb
+3
-3
db/schema.rb
db/schema.rb
+1
-1
No files found.
db/migrate/20181106135939_add_index_to_deployments.rb
View file @
4eeb51dc
...
...
@@ -6,14 +6,14 @@ class AddIndexToDeployments < ActiveRecord::Migration
DOWNTIME
=
false
SHORT_INDEX_NAME_FOR_ENVIRONMENT_ID
=
'index_deployments_on_env_deployed_for_id'
SHORT_INDEX_NAME_FOR_ENVIRONMENT_IID
=
'index_deployments_on_env_deployed_for_iid'
SHORT_INDEX_NAME_FOR_
FINISHED_AT
=
'index_deployments_on
_deployed_for_finished_at'
SHORT_INDEX_NAME_FOR_
PROJECT_FINISHED_AT
=
'index_deployments_on_prj
_deployed_for_finished_at'
disable_ddl_transaction!
def
up
add_concurrent_index
:deployments
,
[
:project_id
,
:action
,
:status
,
:id
]
add_concurrent_index
:deployments
,
[
:project_id
,
:action
,
:status
,
:iid
]
add_concurrent_index
:deployments
,
[
:project_id
,
:action
,
:status
,
:finished_at
],
name:
SHORT_INDEX_NAME_FOR_FINISHED_AT
add_concurrent_index
:deployments
,
[
:project_id
,
:action
,
:status
,
:finished_at
],
name:
SHORT_INDEX_NAME_FOR_
PROJECT_
FINISHED_AT
add_concurrent_index
:deployments
,
[
:environment_id
,
:action
,
:status
,
:id
],
name:
SHORT_INDEX_NAME_FOR_ENVIRONMENT_ID
add_concurrent_index
:deployments
,
[
:environment_id
,
:action
,
:status
,
:iid
],
name:
SHORT_INDEX_NAME_FOR_ENVIRONMENT_IID
add_concurrent_index
:deployments
,
[
:environment_id
,
:action
,
:sha
]
...
...
@@ -22,7 +22,7 @@ class AddIndexToDeployments < ActiveRecord::Migration
def
down
remove_concurrent_index
:deployments
,
[
:project_id
,
:action
,
:status
,
:id
]
remove_concurrent_index
:deployments
,
[
:project_id
,
:action
,
:status
,
:iid
]
remove_concurrent_index_by_name
(
:deployments
,
SHORT_INDEX_NAME_FOR_FINISHED_AT
)
remove_concurrent_index_by_name
(
:deployments
,
SHORT_INDEX_NAME_FOR_
PROJECT_
FINISHED_AT
)
remove_concurrent_index_by_name
(
:deployments
,
SHORT_INDEX_NAME_FOR_ENVIRONMENT_ID
)
remove_concurrent_index_by_name
(
:deployments
,
SHORT_INDEX_NAME_FOR_ENVIRONMENT_IID
)
remove_concurrent_index
:deployments
,
[
:environment_id
,
:action
,
:sha
]
...
...
db/schema.rb
View file @
4eeb51dc
...
...
@@ -839,7 +839,7 @@ ActiveRecord::Schema.define(version: 20181106135939) do
add_index
"deployments"
,
[
"environment_id"
,
"iid"
,
"project_id"
],
name:
"index_deployments_on_environment_id_and_iid_and_project_id"
,
using: :btree
add_index
"deployments"
,
[
"environment_id"
,
"status"
],
name:
"index_deployments_on_environment_id_and_status"
,
using: :btree
add_index
"deployments"
,
[
"id"
],
name:
"partial_index_deployments_for_legacy_successful_deployments"
,
where:
"((finished_at IS NULL) AND (status = 2))"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"action"
,
"status"
,
"finished_at"
],
name:
"index_deployments_on_deployed_for_finished_at"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"action"
,
"status"
,
"finished_at"
],
name:
"index_deployments_on_
prj_
deployed_for_finished_at"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"action"
,
"status"
,
"id"
],
name:
"index_deployments_on_project_id_and_action_and_status_and_id"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"action"
,
"status"
,
"iid"
],
name:
"index_deployments_on_project_id_and_action_and_status_and_iid"
,
using: :btree
add_index
"deployments"
,
[
"project_id"
,
"iid"
],
name:
"index_deployments_on_project_id_and_iid"
,
unique:
true
,
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