Class: CreateSurveySections

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb

Class Method Summary collapse

Class Method Details

.downObject



27
28
29
# File 'lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb', line 27

def self.down
  drop_table :survey_sections
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/surveyor/templates/db/migrate/create_survey_sections.rb', line 3

def self.up
  create_table :survey_sections do |t|
    # Context
    t.integer :survey_id

    # Content
    t.string :title
    t.text :description

    # 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.string :custom_class

    t.timestamps
  end
end