socialforge/db/migrate/20140703085204_clear_course...

12 lines
287 B
Ruby

class ClearCourseData < ActiveRecord::Migration
def up
# 清理课程表垃圾数据
# 之前删除项目未删除课程的数据
sql = 'delete from courses where name is null and extra not in (select identifier from projects)'
execute(sql)
end
def down
end
end