From 697aaacb413268b3561be57a826fafdad20edbbc Mon Sep 17 00:00:00 2001 From: gauravano Date: Sat, 7 Jul 2018 12:32:17 +0530 Subject: [PATCH] migration for changing status --- .../20180707065151_change_status_of_comments.rb | 11 +++++++++++ db/schema.rb.example | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180707065151_change_status_of_comments.rb diff --git a/db/migrate/20180707065151_change_status_of_comments.rb b/db/migrate/20180707065151_change_status_of_comments.rb new file mode 100644 index 0000000000..431ecf8ec5 --- /dev/null +++ b/db/migrate/20180707065151_change_status_of_comments.rb @@ -0,0 +1,11 @@ +class ChangeStatusOfComments < ActiveRecord::Migration[5.2] + def up + Comment.all.each do |comment| + comment.status = 1 + comment.save + end + end + + def down + end +end diff --git a/db/schema.rb.example b/db/schema.rb.example index cca8542808..9ee5123215 100644 --- a/db/schema.rb.example +++ b/db/schema.rb.example @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180618184048) do +ActiveRecord::Schema.define(version: 2018_07_07_065151) do create_table "answer_selections", force: true do |t| t.integer "user_id"