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
332d3d0e
Commit
332d3d0e
authored
Apr 25, 2018
by
Shinya Maeda
Committed by
Kamil Trzciński
May 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change column name to iid_per_project. Add index to project_id and iid
parent
3248ca04
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
db/migrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb
...igrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb
+2
-2
db/migrate/20180425205249_add_index_constraints_to_pipeline_iid.rb
...e/20180425205249_add_index_constraints_to_pipeline_iid.rb
+15
-0
db/schema.rb
db/schema.rb
+3
-2
No files found.
db/migrate/20180424160449_add_pipeline_iid_to_ci_pipelines.rb
View file @
332d3d0e
...
...
@@ -6,10 +6,10 @@ class AddPipelineIidToCiPipelines < ActiveRecord::Migration
disable_ddl_transaction!
def
up
add_column
:ci_pipelines
,
:iid
,
:integer
add_column
:ci_pipelines
,
:iid
_per_project
,
:integer
end
def
down
remove_column
:ci_pipelines
,
:iid
,
:integer
remove_column
:ci_pipelines
,
:iid
_per_project
,
:integer
end
end
db/migrate/20180425205249_add_index_constraints_to_pipeline_iid.rb
0 → 100644
View file @
332d3d0e
class
AddIndexConstraintsToPipelineIid
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:ci_pipelines
,
[
:project_id
,
:iid_per_project
],
unique:
true
,
where:
'iid_per_project IS NOT NULL'
end
def
down
remove_concurrent_index
:ci_pipelines
,
[
:project_id
,
:iid_per_project
]
end
end
db/schema.rb
View file @
332d3d0e
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180425
13100
9
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180425
20524
9
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -434,11 +434,12 @@ ActiveRecord::Schema.define(version: 20180425131009) do
t
.
integer
"config_source"
t
.
boolean
"protected"
t
.
integer
"failure_reason"
t
.
integer
"iid"
t
.
integer
"iid
_per_project
"
end
add_index
"ci_pipelines"
,
[
"auto_canceled_by_id"
],
name:
"index_ci_pipelines_on_auto_canceled_by_id"
,
using: :btree
add_index
"ci_pipelines"
,
[
"pipeline_schedule_id"
],
name:
"index_ci_pipelines_on_pipeline_schedule_id"
,
using: :btree
add_index
"ci_pipelines"
,
[
"project_id"
,
"iid_per_project"
],
name:
"index_ci_pipelines_on_project_id_and_iid_per_project"
,
unique:
true
,
where:
"(iid_per_project IS NOT NULL)"
,
using: :btree
add_index
"ci_pipelines"
,
[
"project_id"
,
"ref"
,
"status"
,
"id"
],
name:
"index_ci_pipelines_on_project_id_and_ref_and_status_and_id"
,
using: :btree
add_index
"ci_pipelines"
,
[
"project_id"
,
"sha"
],
name:
"index_ci_pipelines_on_project_id_and_sha"
,
using: :btree
add_index
"ci_pipelines"
,
[
"project_id"
],
name:
"index_ci_pipelines_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