schema.rb 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #---
  2. # Excerpted from "Agile Web Development with Rails",
  3. # published by The Pragmatic Bookshelf.
  4. # Copyrights apply to this code. It may not be used to create training material,
  5. # courses, books, articles, and the like. Contact us if you are in doubt.
  6. # We make no guarantees that this code is fit for any purpose.
  7. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  8. #---
  9. # encoding: UTF-8
  10. # This file is auto-generated from the current state of the database. Instead
  11. # of editing this file, please use the migrations feature of Active Record to
  12. # incrementally modify your database, and then regenerate this schema definition.
  13. #
  14. # Note that this schema.rb definition is the authoritative source for your
  15. # database schema. If you need to create the application database on another
  16. # system, you should be using db:schema:load, not running all the migrations
  17. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  18. # you'll amass, the slower it'll run and the greater likelihood for issues).
  19. #
  20. # It's strongly recommended that you check this file into your version control system.
  21. ActiveRecord::Schema.define(version: 20121130000008) do
  22. create_table "carts", force: true do |t|
  23. t.datetime "created_at"
  24. t.datetime "updated_at"
  25. end
  26. create_table "line_items", force: true do |t|
  27. t.integer "product_id"
  28. t.integer "cart_id"
  29. t.datetime "created_at"
  30. t.datetime "updated_at"
  31. t.integer "quantity", default: 1
  32. t.decimal "price"
  33. t.integer "order_id"
  34. end
  35. add_index "line_items", ["cart_id"], name: "index_line_items_on_cart_id"
  36. add_index "line_items", ["order_id"], name: "index_line_items_on_order_id"
  37. add_index "line_items", ["product_id"], name: "index_line_items_on_product_id"
  38. create_table "orders", force: true do |t|
  39. t.string "name"
  40. t.text "address"
  41. t.string "email"
  42. t.string "pay_type"
  43. t.datetime "created_at"
  44. t.datetime "updated_at"
  45. end
  46. create_table "products", force: true do |t|
  47. t.string "title"
  48. t.text "description"
  49. t.string "image_url"
  50. t.decimal "price", precision: 8, scale: 2
  51. t.datetime "created_at"
  52. t.datetime "updated_at"
  53. end
  54. end