Class: CreateValidationConditions

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

Class Method Summary collapse

Class Method Details

.downObject



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

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

def self.up
  create_table :validation_conditions do |t|
    # Context
    t.integer :validation_id
    t.string :rule_key

    # Conditional
    t.string :operator

    # Optional external reference
    t.integer :question_id
    t.integer :answer_id

    # Value
    t.datetime :datetime_value
    t.integer :integer_value
    t.float :float_value
    t.string :unit
    t.text :text_value
    t.string :string_value
    t.string :response_other
    t.string :regexp

    t.timestamps
  end
end