Class: CreateFields

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/engine_room/templates/003_create_fields.rb

Class Method Summary collapse

Class Method Details

.downObject



15
16
17
# File 'lib/generators/engine_room/templates/003_create_fields.rb', line 15

def self.down
  drop_table :fields
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/engine_room/templates/003_create_fields.rb', line 2

def self.up
  create_table(:fields) do |t|
    t.integer :section_id,   :null => false
    t.string  :column,       :null => false
    t.string  :field_type,   :null => false
    t.string  :display_type, :null => false
    t.text    :options
    t.text    :help
    t.integer :sort_order
    t.timestamps
  end
end