From 6f06094fc1542bfd5802f96d574ff8df14ed5b3b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 24 Aug 2019 14:11:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190824032658_migrate_subject_shixun_count.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db/migrate/20190824032658_migrate_subject_shixun_count.rb diff --git a/db/migrate/20190824032658_migrate_subject_shixun_count.rb b/db/migrate/20190824032658_migrate_subject_shixun_count.rb new file mode 100644 index 000000000..bef29346e --- /dev/null +++ b/db/migrate/20190824032658_migrate_subject_shixun_count.rb @@ -0,0 +1,9 @@ +class MigrateSubjectShixunCount < ActiveRecord::Migration[5.2] + def change + Subject.reset_column_information + Subject.all.each do |subject| + Subject.reset_counters subject.id, :stage_shixuns + Subject.reset_counters subject.id, :shixuns + end + end +end