set request_for_comment.solved default to false and set all null values in database for that attribute to false

This commit is contained in:
Ralf Teusner
2017-04-03 19:51:32 +02:00
parent 58f76f53e6
commit b1f9f1cc92
2 changed files with 11 additions and 5 deletions

View File

@ -0,0 +1,6 @@
class SetDefaultForRequestForCommentSolved < ActiveRecord::Migration
def change
change_column_default :request_for_comments, :solved, false
RequestForComment.where(solved: nil).update_all(solved: false)
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170323130756) do
ActiveRecord::Schema.define(version: 20170403162848) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -246,7 +246,7 @@ ActiveRecord::Schema.define(version: 20170323130756) do
t.datetime "updated_at"
t.string "user_type", limit: 255
t.text "question"
t.boolean "solved"
t.boolean "solved", default: false
t.integer "submission_id"
end