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
Jérome Perrin
gitlab-ce
Commits
6b9608e1
Commit
6b9608e1
authored
Jun 21, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build stages reference migration
parent
4b0b2f15
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
5 deletions
+39
-5
db/migrate/20170526185602_add_stage_id_to_ci_builds.rb
db/migrate/20170526185602_add_stage_id_to_ci_builds.rb
+0
-4
db/post_migrate/20170526185901_remove_stage_id_index_from_builds.rb
...grate/20170526185901_remove_stage_id_index_from_builds.rb
+17
-0
db/post_migrate/20170526185921_migrate_build_stage_reference.rb
...t_migrate/20170526185921_migrate_build_stage_reference.rb
+2
-0
db/post_migrate/20170621102400_add_stage_id_index_to_builds.rb
...st_migrate/20170621102400_add_stage_id_index_to_builds.rb
+19
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
db/migrate/20170526185602_add_stage_id_to_ci_builds.rb
View file @
6b9608e1
...
...
@@ -7,15 +7,11 @@ class AddStageIdToCiBuilds < ActiveRecord::Migration
def
up
add_column
:ci_builds
,
:stage_id
,
:integer
add_concurrent_foreign_key
:ci_builds
,
:ci_stages
,
column: :stage_id
,
on_delete: :cascade
add_concurrent_index
:ci_builds
,
:stage_id
end
def
down
remove_foreign_key
:ci_builds
,
column: :stage_id
remove_concurrent_index
:ci_builds
,
:stage_id
remove_column
:ci_builds
,
:stage_id
,
:integer
end
end
db/post_migrate/20170526185901_remove_stage_id_index_from_builds.rb
0 → 100644
View file @
6b9608e1
class
RemoveStageIdIndexFromBuilds
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
if
index_exists?
(
:ci_builds
,
:stage_id
)
remove_concurrent_index
(
:ci_builds
,
:stage_id
)
end
end
def
down
# noop
end
end
db/post_migrate/20170526185921_migrate_build_stage_reference.rb
View file @
6b9608e1
...
...
@@ -3,6 +3,8 @@ class MigrateBuildStageReference < ActiveRecord::Migration
DOWNTIME
=
false
disable_ddl_transaction!
def
up
disable_statement_timeout
...
...
db/post_migrate/20170621102400_add_stage_id_index_to_builds.rb
0 → 100644
View file @
6b9608e1
class
AddStageIdIndexToBuilds
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
unless
index_exists?
(
:ci_builds
,
:stage_id
)
add_concurrent_index
(
:ci_builds
,
:stage_id
)
end
end
def
down
if
index_exists?
(
:ci_builds
,
:stage_id
)
remove_concurrent_index
(
:ci_builds
,
:stage_id
)
end
end
end
db/schema.rb
View file @
6b9608e1
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201706
14115405
)
do
ActiveRecord
::
Schema
.
define
(
version:
201706
21102400
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
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