schema.rb 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This file is auto-generated from the current state of the database. Instead
  2. # of editing this file, please use the migrations feature of Active Record to
  3. # incrementally modify your database, and then regenerate this schema definition.
  4. #
  5. # Note that this schema.rb definition is the authoritative source for your
  6. # database schema. If you need to create the application database on another
  7. # system, you should be using db:schema:load, not running all the migrations
  8. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  9. # you'll amass, the slower it'll run and the greater likelihood for issues).
  10. #
  11. # It's strongly recommended that you check this file into your version control system.
  12. ActiveRecord::Schema.define(version: 20170405123115) do
  13. create_table "appointments", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
  14. t.integer "person_id"
  15. t.integer "unit_id"
  16. t.string "name"
  17. t.string "line"
  18. t.string "description"
  19. t.string "room"
  20. t.datetime "created_at", null: false
  21. t.datetime "updated_at", null: false
  22. t.index ["person_id"], name: "index_appointments_on_person_id", using: :btree
  23. t.index ["unit_id"], name: "index_appointments_on_unit_id", using: :btree
  24. end
  25. create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
  26. t.string "login"
  27. t.string "firstname"
  28. t.string "lastname"
  29. t.string "patronymic"
  30. t.string "displayname"
  31. t.string "displayname_latin"
  32. t.string "photo_url"
  33. t.datetime "created_at", null: false
  34. t.datetime "updated_at", null: false
  35. t.boolean "show_email", null: false
  36. end
  37. create_table "phone_configs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
  38. t.string "extension"
  39. t.string "phone_mac"
  40. t.datetime "created_at", null: false
  41. t.datetime "updated_at", null: false
  42. t.index ["extension"], name: "index_phone_configs_on_extension", unique: true, using: :btree
  43. t.index ["phone_mac"], name: "index_phone_configs_on_phone_mac", using: :btree
  44. end
  45. create_table "units", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
  46. t.string "code"
  47. t.string "name"
  48. t.string "fullname"
  49. t.string "shortname"
  50. t.integer "parent_id"
  51. t.datetime "created_at", null: false
  52. t.datetime "updated_at", null: false
  53. end
  54. add_foreign_key "appointments", "people"
  55. add_foreign_key "appointments", "units"
  56. end