Class: CreateFlexiModelFields

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/flexi_model/install/templates/create_flexi_model_fields.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



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

def change
  create_table 'flexi_model_fields', :force => true do |t|
    t.string 'name'
    t.string 'singular_label'
    t.string 'plural_label'
    t.string 'namespace'
    t.integer 'partition_id'

    t.string 'field_type'
    t.text 'default_value'
  end

  add_index 'flexi_model_fields', [:namespace, :name]
  add_index 'flexi_model_fields', [:namespace, :name, :field_type]
  add_index 'flexi_model_fields', [:namespace, :name, :field_type, :partition_id],
            :unique => true,
            name: 'index_ns_name_ft_pi'
end