BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
872bbb9f
Commit
872bbb9f
authored
Apr 13, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup required migrations
parent
daa29729
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
10 deletions
+7
-10
20160331204039_add_action_to_ci_commit.rb
db/migrate/20160331204039_add_action_to_ci_commit.rb
+0
-5
20160411122626_add_duration_to_ci_commit.rb
db/migrate/20160411122626_add_duration_to_ci_commit.rb
+0
-5
20160412173416_add_fields_to_ci_commit.rb
db/migrate/20160412173416_add_fields_to_ci_commit.rb
+1
-0
20160412173417_update_ci_commit.rb
db/migrate/20160412173417_update_ci_commit.rb
+4
-0
20160412173418_add_ci_commit_indexes.rb
db/migrate/20160412173418_add_ci_commit_indexes.rb
+2
-0
No files found.
db/migrate/20160331204039_add_action_to_ci_commit.rb
deleted
100644 → 0
View file @
daa29729
class
AddActionToCiCommit
<
ActiveRecord
::
Migration
def
change
add_column
:ci_commits
,
:action
,
:string
end
end
db/migrate/20160411122626_add_duration_to_ci_commit.rb
deleted
100644 → 0
View file @
daa29729
class
AddDurationToCiCommit
<
ActiveRecord
::
Migration
def
change
add_column
:ci_commits
,
:duration
,
:integer
end
end
db/migrate/20160
331153918
_add_fields_to_ci_commit.rb
→
db/migrate/20160
412173416
_add_fields_to_ci_commit.rb
View file @
872bbb9f
...
...
@@ -3,5 +3,6 @@ class AddFieldsToCiCommit < ActiveRecord::Migration
add_column
:ci_commits
,
:status
,
:string
add_column
:ci_commits
,
:started_at
,
:timestamp
add_column
:ci_commits
,
:finished_at
,
:timestamp
add_column
:ci_commits
,
:duration
,
:integer
end
end
db/migrate/2016041217
5
417_update_ci_commit.rb
→
db/migrate/2016041217
3
417_update_ci_commit.rb
View file @
872bbb9f
class
UpdateCiCommit
<
ActiveRecord
::
Migration
# This migration can be run online, but needs to be executed for the second time after restarting Unicorn workers
# Otherwise Offline migration should be used.
def
change
execute
(
"UPDATE ci_commits SET status=
#{
status
}
, ref=
#{
ref
}
, tag=
#{
tag
}
WHERE status IS NULL"
)
end
private
def
status
builds
=
'(SELECT COUNT(*) FROM ci_builds WHERE ci_builds.commit_id=ci_commits.id)'
success
=
"(SELECT COUNT(*) FROM ci_builds WHERE ci_builds.commit_id=ci_commits.id AND status='success')"
...
...
db/migrate/2016041217
4954
_add_ci_commit_indexes.rb
→
db/migrate/2016041217
3418
_add_ci_commit_indexes.rb
View file @
872bbb9f
...
...
@@ -7,6 +7,8 @@ class AddCiCommitIndexes < ActiveRecord::Migration
add_index
:ci_commits
,
[
:status
],
index_options
end
private
def
index_options
{
algorithm: :concurrently
}
if
Gitlab
::
Database
.
postgresql?
end
...
...
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