parent
5519ef78e2
commit
a0ceb9b11c
@ -0,0 +1,5 @@
|
|||||||
|
class AddJournalsCountToProject < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :projects, :journals_count, :integer, :default => false
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,12 @@
|
|||||||
|
class StaticsIssueJournal < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Project.all.each do |project|
|
||||||
|
if !project.project_score.nil? && !project.project_score.issue_journal_num.nil?
|
||||||
|
project.update_attribute(:journals_count, project.project_score.issue_journal_num)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,19 @@
|
|||||||
|
class StaticsRepositoryCommits < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
g = Gitlab.client
|
||||||
|
Project.all.each do |project|
|
||||||
|
unless project.gpid.nil?
|
||||||
|
begin
|
||||||
|
puts project.id
|
||||||
|
count = g.project(project.gpid).commit_count
|
||||||
|
rescue
|
||||||
|
logger.error("The project's rep is not exit!")
|
||||||
|
end
|
||||||
|
project.update_attribute(:commits_count, count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue