From 417d0793f896682646db75978a1835aafbdfbe8e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 23 Jul 2019 23:28:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A9=BA=E7=99=BD=E7=9A=84?= =?UTF-8?q?=E7=AD=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3152256_delete_contents_is_null_for_challenge_answers.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20190723152256_delete_contents_is_null_for_challenge_answers.rb diff --git a/db/migrate/20190723152256_delete_contents_is_null_for_challenge_answers.rb b/db/migrate/20190723152256_delete_contents_is_null_for_challenge_answers.rb new file mode 100644 index 000000000..a85152894 --- /dev/null +++ b/db/migrate/20190723152256_delete_contents_is_null_for_challenge_answers.rb @@ -0,0 +1,6 @@ +class DeleteContentsIsNullForChallengeAnswers < ActiveRecord::Migration[5.2] + def change + contents = ChallengeAnswer.where("contents = ''") + contents.delete_all + end +end