Created
December 9, 2015 09:15
-
-
Save BenMQ/f6fbc9508f352831f5ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangeTextResponseAnswerAnswerTextColumnType < ActiveRecord::Migration | |
def up | |
# set column to not nullable and default to empty string | |
change_column_default :course_assessment_answer_text_responses, :answer_text, '' | |
change_column_null :course_assessment_answer_text_responses, :answer_text, false, '' | |
end | |
def down | |
change_column_default :course_assessment_answer_text_responses, :answer_text, nil | |
change_column_null :course_assessment_answer_text_responses, :answer_text, true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment