Class: CreateFields

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/migrations/create_fields.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/templates/migrations/create_fields.rb', line 2

def change
  create_table :fields do |t|
    t.references :fieldable, polymorphic: true
    t.string :name
    t.string :field_type
    t.integer :parent_id
    t.integer :position
    t.text :value
    t.timestamps
  end
end