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
|
# File 'lib/generators/ecommerce/templates/migration.rb', line 2
def self.up
create_table :products do |t|
t.string :name, :null => false
t.string :permalink, :null => false
t.text :descr
t.column :price, :decimal, :precision => 8, :scale => 2, :default => 0
t.column :sale_price, :decimal, :precision => 8, :scale => 2, :default => 0
t.text :meta_description
t.text :meta_keywords
t.string :tags
t.int :shipping_weight
t.timestamps
end
create_table :photos do |t|
t.integer :product_id
t.string :photo_file_name
t.string :photo_content_type
t.integer :photo_file_size
t.datetime :photo_updated_at
t.timestamps
end
create_table :carts do |t|
t.datetime :purchased_at
t.timestamps
end
create_table :cart_items do |t|
t.integer :cart_id
t.integer :product_id
t.integer :quantity
end
create_table :payment_notifications do |t|
t.text :params
t.integer :cart_id
t.string :status
t.string :transaction_id
t.timestamps
end
end
|