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
b97b4d25
Commit
b97b4d25
authored
Jan 25, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an unique index on pipeline stage name
parent
ce71b1ce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
db/post_migrate/20180125111139_add_unique_pipeline_stage_name_index.rb
...te/20180125111139_add_unique_pipeline_stage_name_index.rb
+17
-0
db/schema.rb
db/schema.rb
+3
-2
No files found.
db/post_migrate/20180125111139_add_unique_pipeline_stage_name_index.rb
0 → 100644
View file @
b97b4d25
class
AddUniquePipelineStageNameIndex
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
remove_concurrent_index
:ci_stages
,
[
:pipeline_id
,
:name
]
add_concurrent_index
:ci_stages
,
[
:pipeline_id
,
:name
],
unique:
true
end
def
down
remove_concurrent_index
:ci_stages
,
[
:pipeline_id
,
:name
],
unique:
true
add_concurrent_index
:ci_stages
,
[
:pipeline_id
,
:name
]
end
end
db/schema.rb
View file @
b97b4d25
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201801
19121225
)
do
ActiveRecord
::
Schema
.
define
(
version:
201801
25111139
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -450,7 +450,8 @@ ActiveRecord::Schema.define(version: 20180119121225) do
t
.
integer
"lock_version"
end
add_index
"ci_stages"
,
[
"pipeline_id"
,
"name"
],
name:
"index_ci_stages_on_pipeline_id_and_name"
,
using: :btree
add_index
"ci_stages"
,
[
"pipeline_id"
,
"name"
],
name:
"index_ci_stages_on_pipeline_id_and_name"
,
unique:
true
,
using: :btree
add_index
"ci_stages"
,
[
"pipeline_id"
,
"name"
],
name:
"index_ci_stages_on_pipeline_id_and_name_unique"
,
unique:
true
,
using: :btree
add_index
"ci_stages"
,
[
"pipeline_id"
],
name:
"index_ci_stages_on_pipeline_id"
,
using: :btree
add_index
"ci_stages"
,
[
"project_id"
],
name:
"index_ci_stages_on_project_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