16 lines
280 B
Ruby
16 lines
280 B
Ruby
|
class DeleteValidProject < ActiveRecord::Migration
|
||
|
def up
|
||
|
projects = Project.where("project_type =?", 1)
|
||
|
begin
|
||
|
projects.each do |p|
|
||
|
p.delete
|
||
|
end
|
||
|
rescue => e
|
||
|
logger.error "Delete project failed ====>#{e}"
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
end
|
||
|
end
|