-
Notifications
You must be signed in to change notification settings - Fork 0
/
20120220172742_move_to_configurable_gateways.rb
54 lines (43 loc) · 1.25 KB
/
20120220172742_move_to_configurable_gateways.rb
1
2
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class MoveToConfigurableGateways < ActiveRecord::Migration
def up
drop_table :gateways
drop_table :gateway_options
drop_table :gateway_option_values
drop_table :gateway_configurations
create_table :gateways, :force => true do |t|
t.string :type, :name
t.text :description
t.boolean :active, :default => true
t.string :environment, :default => 'development'
t.string :server, :default => 'test'
t.boolean :test_mode, :default => true
t.timestamps
end
end
def down
drop_table :gateways
create_table :gateway_configurations, :force => true do |t|
t.references :gateway
t.timestamps
end
create_table :gateway_option_values, :force => true do |t|
t.text :value
t.references :gateway_configuration
t.references :gateway_option
t.timestamps
end
create_table :gateway_options, :force => true do |t|
t.string :name
t.text :description
t.boolean :textarea, :default => false
t.references :gateway
t.timestamps
end
create_table :gateways, :force => true do |t|
t.string :clazz, :name
t.text :description
t.boolean :active
t.timestamps
end
end
end