schema.rb 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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: 20180210170344) do
  13. create_table "administrations", force: :cascade do |t|
  14. t.integer "user_id"
  15. t.integer "school_id"
  16. t.datetime "created_at", null: false
  17. t.datetime "updated_at", null: false
  18. t.index ["school_id"], name: "index_administrations_on_school_id"
  19. t.index ["user_id", "school_id"], name: "index_administrations_on_user_id_and_school_id", unique: true
  20. t.index ["user_id"], name: "index_administrations_on_user_id"
  21. end
  22. create_table "conversation_participations", force: :cascade do |t|
  23. t.integer "user_id"
  24. t.integer "conversation_id"
  25. t.datetime "viewed_at", null: false
  26. t.datetime "created_at", null: false
  27. t.datetime "updated_at", null: false
  28. t.index ["user_id", "conversation_id"], name: "index_participation_user_conversation", unique: true
  29. end
  30. create_table "conversations", force: :cascade do |t|
  31. t.string "name"
  32. t.datetime "created_at", null: false
  33. t.datetime "updated_at", null: false
  34. end
  35. create_table "messages", force: :cascade do |t|
  36. t.integer "user_id"
  37. t.integer "conversation_id"
  38. t.text "content"
  39. t.datetime "created_at", null: false
  40. t.datetime "updated_at", null: false
  41. t.index ["conversation_id", "created_at"], name: "index_messages_on_conversation_id_and_created_at"
  42. t.index ["conversation_id"], name: "index_messages_on_conversation_id"
  43. t.index ["user_id"], name: "index_messages_on_user_id"
  44. end
  45. create_table "schools", force: :cascade do |t|
  46. t.string "name"
  47. t.datetime "created_at", null: false
  48. t.datetime "updated_at", null: false
  49. end
  50. create_table "users", force: :cascade do |t|
  51. t.string "name"
  52. t.string "login"
  53. t.string "email"
  54. t.datetime "created_at", null: false
  55. t.datetime "updated_at", null: false
  56. t.string "password_digest"
  57. t.string "remember_digest"
  58. t.integer "gender", default: 0
  59. t.string "phone"
  60. t.date "birth_date"
  61. t.string "picture"
  62. t.integer "school_id"
  63. t.boolean "admin", default: false
  64. t.index ["login"], name: "index_users_on_login", unique: true
  65. t.index ["school_id"], name: "index_users_on_school_id"
  66. end
  67. end