mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 19:53:05 +08:00
reset issues_count
This commit is contained in:
9
db/migrate/20200716055018_reset_project_issues_counte.rb
Normal file
9
db/migrate/20200716055018_reset_project_issues_counte.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class ResetProjectIssuesCounte < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
projects = Project.select(:id, :issues_count).all
|
||||
projects.each do |p|
|
||||
puts p.id
|
||||
Project.reset_counters( p.id, :issues_count, touch: false )
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user