class CreateCustomize < ActiveRecord::Migration def change create_table :customize_characters do |t| t.string :key t.string :value_type t.text :value t.string :related_type t.integer :related_id end add_index :customize_characters, [:related_type, :related_id] create_table :customize_inherit_nodes do |t| t.integer :node_id t.string :node_type t.integer :left t.integer :right t.integer :parent_id end add_index :customize_inherit_nodes, [:node_type, :node_id] add_index :customize_inherit_nodes, :parent_id create_table :customize_formulars do |t| t.string :name t.string :calculator_name t.text :comment t.text :calculator_attributes t.string :related_type t.integer :related_id end add_index :customize_formulars, [:related_type, :related_id] end end