Class: CreateExpansionValues

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/expansion/templates/create_expansion_values.rb

Class Method Summary collapse

Class Method Details

.downObject



21
22
23
# File 'lib/generators/expansion/templates/create_expansion_values.rb', line 21

def self.down
  drop_table :expansion_values
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/expansion/templates/create_expansion_values.rb', line 2

def self.up
  create_table :expansion_values do |t|
    t.references  :attribute
    t.references  :owner, :polymorphic => true
    t.text        :note
    t.date        :date
    
    t.string      :value_string
    t.integer     :value_integer
    t.float       :value_float
    t.date        :value_date
    t.timestamp   :value_timestamp
    t.text        :value_text
    t.boolean     :value_boolean

    t.timestamps
  end
end