Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
commit
0dc47279de
@ -0,0 +1,25 @@
|
||||
class ForgeActivituesDate < ActiveRecord::Migration
|
||||
def up
|
||||
forge_count = ForgeActivity.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... forge_count do i
|
||||
ForgeActivity.page(i).per(30).each do |activity|
|
||||
unless activity.forge_act_type == "ProjectCreateInfo"
|
||||
if activity.forge_act
|
||||
unless activity.forge_act.project
|
||||
# puts activity.id
|
||||
activity.destroy
|
||||
end
|
||||
else
|
||||
# puts activity.id.to_s + "----"
|
||||
activity.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
class DeleteAnonymousJour < ActiveRecord::Migration
|
||||
def up
|
||||
jour_count = Journal.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... jour_count do i
|
||||
Journal.page(i).per(30).each do |jour|
|
||||
jour.destroy if jour.user_id == 2
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in new issue