schema.rb 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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: 20121130000006) 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. end
  34. add_index "line_items", ["cart_id"], name: "index_line_items_on_cart_id"
  35. add_index "line_items", ["product_id"], name: "index_line_items_on_product_id"
  36. create_table "products", force: true do |t|
  37. t.string "title"
  38. t.text "description"
  39. t.string "image_url"
  40. t.decimal "price", precision: 8, scale: 2
  41. t.datetime "created_at"
  42. t.datetime "updated_at"
  43. end
  44. end