You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
376 B
10 lines
376 B
class MigrateTidingStatus < ActiveRecord::Migration[5.2]
|
|
def change
|
|
Tiding.where(container_type: "JoinCourse", status: 0).each do |tiding|
|
|
unless CourseMessage.where(course_message_id: tiding.trigger_user_id, course_id: tiding.container_id, course_message_type: "JoinCourseRequest", status: 0).exists?
|
|
tiding.update!(status: 1)
|
|
end
|
|
end
|
|
end
|
|
end
|