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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c5f1e1a7
Commit
c5f1e1a7
authored
Jul 05, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable statement timeout in stages statuses migration
parent
93d217bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
db/post_migrate/20170630111158_migrate_stages_statuses.rb
db/post_migrate/20170630111158_migrate_stages_statuses.rb
+4
-4
No files found.
db/post_migrate/20170630111158_migrate_stages_statuses.rb
View file @
c5f1e1a7
...
@@ -8,10 +8,6 @@ class MigrateStagesStatuses < ActiveRecord::Migration
...
@@ -8,10 +8,6 @@ class MigrateStagesStatuses < ActiveRecord::Migration
STATUSES
=
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
STATUSES
=
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
}
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
}
class
Stage
<
ActiveRecord
::
Base
self
.
table_name
=
'ci_stages'
end
class
Build
<
ActiveRecord
::
Base
class
Build
<
ActiveRecord
::
Base
self
.
table_name
=
'ci_builds'
self
.
table_name
=
'ci_builds'
...
@@ -67,6 +63,8 @@ class MigrateStagesStatuses < ActiveRecord::Migration
...
@@ -67,6 +63,8 @@ class MigrateStagesStatuses < ActiveRecord::Migration
end
end
def
up
def
up
disable_statement_timeout
status_sql
=
Build
status_sql
=
Build
.
where
(
'ci_builds.commit_id = ci_stages.pipeline_id'
)
.
where
(
'ci_builds.commit_id = ci_stages.pipeline_id'
)
.
where
(
'ci_builds.stage = ci_stages.name'
)
.
where
(
'ci_builds.stage = ci_stages.name'
)
...
@@ -78,6 +76,8 @@ class MigrateStagesStatuses < ActiveRecord::Migration
...
@@ -78,6 +76,8 @@ class MigrateStagesStatuses < ActiveRecord::Migration
end
end
def
down
def
down
disable_statement_timeout
execute
<<-
SQL
.
strip_heredoc
execute
<<-
SQL
.
strip_heredoc
UPDATE ci_stages SET status = null
UPDATE ci_stages SET status = null
SQL
SQL
...
...
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