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:
@ -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
|
10
db/schema.rb
10
db/schema.rb
@ -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"
|
||||
@ -239,14 +239,14 @@ ActiveRecord::Schema.define(version: 20170323130756) do
|
||||
end
|
||||
|
||||
create_table "request_for_comments", force: :cascade do |t|
|
||||
t.integer "user_id", null: false
|
||||
t.integer "exercise_id", null: false
|
||||
t.integer "file_id", null: false
|
||||
t.integer "user_id", null: false
|
||||
t.integer "exercise_id", null: false
|
||||
t.integer "file_id", null: false
|
||||
t.datetime "created_at"
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user