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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# File 'lib/generators/e9_vendors/templates/migration.rb', line 2
def self.up
create_table :vendor_members, :force => true do |t|
t.string "name"
t.string "nickname"
t.string "address_1"
t.string "address_2"
t.string "city"
t.string "zipcode"
t.string "country"
t.string "contact_email"
t.string "contact_full_name"
t.string "contact_title"
t.string "contact_phone"
t.string "state"
t.text "website"
t.text "admin_notes"
t.string "logo"
t.string "md5_hash"
t.timestamps
end
create_table :vendor_categories, :force => true do |t|
t.string "name"
t.integer "position"
t.timestamps
end
create_table :vendor_categories_vendors, :force => true, :id => false do |t|
t.references :vendor_category, :vendor
end
create_table :vendor_proxies, :force => true do |t|
t.references :vendor, :vendor_member
t.boolean "display_on_widget", :default => true
t.string "discount_code"
t.string "sales_full_name"
t.string "sales_title"
t.string "sales_phone"
t.string "sales_email"
t.decimal "discount_percentage", :precision => 10, :scale => 2
t.text "landing_page"
t.timestamps
end
create_table :vendors, :force => true do |t|
t.references :vendor_category
t.integer "position"
t.string "name"
t.string "nickname"
t.string "address_1"
t.string "address_2"
t.string "city"
t.string "zipcode"
t.string "country"
t.string "contact_email"
t.string "contact_full_name"
t.string "contact_title"
t.string "contact_phone"
t.string "state"
t.text "website"
t.text "admin_notes"
t.boolean "display_on_widget_contact_form", :default => true
t.string "sales_email"
t.string "sales_full_name"
t.string "sales_title"
t.string "sales_phone"
t.text "short_description"
t.text "long_description"
t.text "landing_page"
t.decimal "discount_percentage", :precision => 10, :scale => 2
t.decimal "member_compensation", :precision => 10, :scale => 2
t.string "logo"
t.timestamps
end
add_column :settings, :e9_vendors_widget_title, :string
add_column :settings, :e9_vendors_widget_form_title, :string
add_column :settings, :e9_vendors_logo_size, :integer
add_column :settings, :e9_vendors_widget_form_text, :text
end
|