Class: CreateSurveys

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

Class Method Summary collapse

Class Method Details

.downObject



29
30
31
# File 'lib/generators/surveyor/templates/db/migrate/create_surveys.rb', line 29

def self.down
  drop_table :surveys
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
26
27
# File 'lib/generators/surveyor/templates/db/migrate/create_surveys.rb', line 3

def self.up
  create_table :surveys do |t|
    # Content
    t.string :title
    t.text :description

    # Reference
    t.string :access_code
    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

    # Expiry
    t.datetime :active_at
    t.datetime :inactive_at

    # Display
    t.string :css_url

    t.string :custom_class

    t.timestamps
  end
end