Sha256: 682e5ef4292dd4ee335b017a5572b368a9729ca303eb0872ebd99666a2a2b898

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

# encoding: UTF-8
class CreateAnswers < ActiveRecord::Migration
  def self.up
    create_table :answers do |t|
      # Context
      t.integer :question_id

      # Content
      t.text :text
      t.text :short_text #Used for presenting responses to experts (ie non-survey takers). Just a shorted version of the string
      t.text :help_text
      t.integer :weight # Used to assign a weight to an answer object (used for computing surveys that have numerical results) (I added this to support the Urology questionnaire -BLC)
      t.string :response_class # What kind of additional data does this answer accept?

      # Reference
      t.string :reference_identifier # from paper
      t.string :data_export_identifier # data export
      t.string :common_namespace # maping to a common vocab
      t.string :common_identifier # maping to a common vocab

      # Display
      t.integer :display_order
      t.boolean :is_exclusive # If set it causes some UI trigger to remove (and disable) all the other answer choices selected for a question (needed for the WHR)
      t.boolean :hide_label
      t.integer :display_length # if smaller than answer.length the html input length will be this value

      t.string :custom_class
      t.string :custom_renderer

      t.timestamps

    end
  end

  def self.down
    drop_table :answers
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
upgrade_surveyor-1.4.2 lib/generators/surveyor/templates/db/migrate/create_answers.rb
affectiva-surveyor-1.5.0.pre.disco.2 lib/generators/surveyor/templates/db/migrate/create_answers.rb
hssc_surveyor-1.4.3.pre lib/generators/surveyor/templates/db/migrate/create_answers.rb
hssc_surveyor-1.4.2.pre lib/generators/surveyor/templates/db/migrate/create_answers.rb
hssc_surveyor-1.4.1.pre lib/generators/surveyor/templates/db/migrate/create_answers.rb
surveyor-1.4.0 lib/generators/surveyor/templates/db/migrate/create_answers.rb
surveyor-1.3.0 lib/generators/surveyor/templates/db/migrate/create_answers.rb
surveyor-1.2.0 lib/generators/surveyor/templates/db/migrate/create_answers.rb
surveyor-1.1.0 lib/generators/surveyor/templates/db/migrate/create_answers.rb
surveyor-1.0.1 lib/generators/surveyor/templates/db/migrate/create_answers.rb
surveyor-1.0.0 lib/generators/surveyor/templates/db/migrate/create_answers.rb