Class: CreateCustomize

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

Instance Method Summary collapse

Instance Method Details

#changeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/customize/templates/migration.rb', line 3

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