删除不存在的留言动态
This commit is contained in:
parent
3e39eacd19
commit
e86778a9c7
|
@ -0,0 +1,17 @@
|
||||||
|
class DeleteJournalsMessage < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
count = JournalsForMessage.all.count / 30 + 2
|
||||||
|
transaction do
|
||||||
|
for i in 1 ... count do
|
||||||
|
JournalsForMessage.page(i).per(30).each do |message|
|
||||||
|
if !message.m_parent_id.nil? and message.parent.nil?
|
||||||
|
message.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20151218110033) do
|
ActiveRecord::Schema.define(:version => 20151224090313) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -1569,7 +1569,6 @@ ActiveRecord::Schema.define(:version => 20151218110033) do
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
|
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
|
||||||
add_index "student_works", ["homework_common_id"], :name => "index"
|
|
||||||
|
|
||||||
create_table "student_works_evaluation_distributions", :force => true do |t|
|
create_table "student_works_evaluation_distributions", :force => true do |t|
|
||||||
t.integer "student_work_id"
|
t.integer "student_work_id"
|
||||||
|
|
Loading…
Reference in New Issue