cart creation backend logic is at place / adding items in progress
This commit is contained in:
10
front-api/db/migrate/20150206034839_create_carts.rb
Normal file
10
front-api/db/migrate/20150206034839_create_carts.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateCarts < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :carts do |t|
|
||||
t.integer :user_id
|
||||
t.boolean :ordered, default: false
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
10
front-api/db/migrate/20150206035042_create_item_in_carts.rb
Normal file
10
front-api/db/migrate/20150206035042_create_item_in_carts.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateItemInCarts < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :item_in_carts do |t|
|
||||
t.integer :cart_id
|
||||
t.integer :item_id
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddCountToItemInCart < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :item_in_carts, :count, :integer
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddAnonymousUserIdToCart < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :carts, :anonymous_id_string, :string
|
||||
end
|
||||
end
|
||||
@@ -11,17 +11,33 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150131134330) do
|
||||
ActiveRecord::Schema.define(version: 20150206041455) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "carts", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.boolean "ordered", default: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "anonymous_id_string"
|
||||
end
|
||||
|
||||
create_table "categories", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.integer "section_id"
|
||||
t.string "image_url"
|
||||
end
|
||||
|
||||
create_table "item_in_carts", force: :cascade do |t|
|
||||
t.integer "cart_id"
|
||||
t.integer "item_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "count"
|
||||
end
|
||||
|
||||
create_table "items", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "code", limit: 10
|
||||
@@ -56,8 +72,10 @@ ActiveRecord::Schema.define(version: 20150131134330) do
|
||||
end
|
||||
|
||||
create_table "sub_categories", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.integer "category_id"
|
||||
t.string "name"
|
||||
t.integer "category_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "units", force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user