schema.rb 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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: 20180407105907) 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 "assignments", force: :cascade do |t|
  23. t.integer "course_id"
  24. t.datetime "due_at"
  25. t.string "name"
  26. t.text "description"
  27. t.datetime "created_at", null: false
  28. t.datetime "updated_at", null: false
  29. t.index ["course_id"], name: "index_assignments_on_course_id"
  30. end
  31. create_table "conversation_participations", force: :cascade do |t|
  32. t.integer "user_id"
  33. t.integer "conversation_id"
  34. t.datetime "viewed_at", null: false
  35. t.datetime "created_at", null: false
  36. t.datetime "updated_at", null: false
  37. t.index ["user_id", "conversation_id"], name: "index_participation_user_conversation", unique: true
  38. end
  39. create_table "conversations", force: :cascade do |t|
  40. t.string "name"
  41. t.datetime "created_at", null: false
  42. t.datetime "updated_at", null: false
  43. end
  44. create_table "course_participations", force: :cascade do |t|
  45. t.integer "course_id"
  46. t.integer "user_id"
  47. t.integer "role"
  48. t.datetime "created_at", null: false
  49. t.datetime "updated_at", null: false
  50. t.index ["course_id"], name: "index_course_participations_on_course_id"
  51. t.index ["user_id", "course_id"], name: "index_course_participations_on_user_id_and_course_id", unique: true
  52. t.index ["user_id"], name: "index_course_participations_on_user_id"
  53. end
  54. create_table "courses", force: :cascade do |t|
  55. t.string "name"
  56. t.integer "school_id"
  57. t.date "starts_on"
  58. t.date "ends_on"
  59. t.datetime "created_at", null: false
  60. t.datetime "updated_at", null: false
  61. t.index ["school_id"], name: "index_courses_on_school_id"
  62. end
  63. create_table "data_files", force: :cascade do |t|
  64. t.string "name"
  65. t.string "repository_type"
  66. t.integer "repository_id"
  67. t.string "uuid"
  68. t.datetime "created_at", null: false
  69. t.datetime "updated_at", null: false
  70. t.index ["repository_type", "repository_id"], name: "index_data_files_on_repository_type_and_repository_id"
  71. end
  72. create_table "group_participations", force: :cascade do |t|
  73. t.integer "user_id"
  74. t.string "group_type"
  75. t.integer "group_id"
  76. t.datetime "created_at", null: false
  77. t.datetime "updated_at", null: false
  78. t.index ["group_type", "group_id"], name: "index_group_participations_on_group_type_and_group_id"
  79. t.index ["user_id"], name: "index_group_participations_on_user_id"
  80. end
  81. create_table "lectures", force: :cascade do |t|
  82. t.integer "course_id"
  83. t.datetime "starts_at"
  84. t.datetime "ends_at"
  85. t.text "description"
  86. t.string "location"
  87. t.datetime "created_at", null: false
  88. t.datetime "updated_at", null: false
  89. t.index ["course_id"], name: "index_lectures_on_course_id"
  90. end
  91. create_table "messages", force: :cascade do |t|
  92. t.integer "user_id"
  93. t.integer "conversation_id"
  94. t.text "content"
  95. t.datetime "created_at", null: false
  96. t.datetime "updated_at", null: false
  97. t.index ["conversation_id", "created_at"], name: "index_messages_on_conversation_id_and_created_at"
  98. t.index ["conversation_id"], name: "index_messages_on_conversation_id"
  99. t.index ["user_id"], name: "index_messages_on_user_id"
  100. end
  101. create_table "news_posts", force: :cascade do |t|
  102. t.string "name"
  103. t.text "content"
  104. t.integer "user_id"
  105. t.string "news_feed_type"
  106. t.integer "news_feed_id"
  107. t.datetime "created_at", null: false
  108. t.datetime "updated_at", null: false
  109. t.index ["news_feed_type", "news_feed_id"], name: "index_news_posts_on_news_feed_type_and_news_feed_id"
  110. t.index ["user_id"], name: "index_news_posts_on_user_id"
  111. end
  112. create_table "schools", force: :cascade do |t|
  113. t.string "name"
  114. t.datetime "created_at", null: false
  115. t.datetime "updated_at", null: false
  116. end
  117. create_table "submissions", force: :cascade do |t|
  118. t.string "title"
  119. t.string "description"
  120. t.integer "assignment_id"
  121. t.datetime "created_at", null: false
  122. t.datetime "updated_at", null: false
  123. t.index ["assignment_id"], name: "index_submissions_on_assignment_id"
  124. end
  125. create_table "users", force: :cascade do |t|
  126. t.string "name"
  127. t.string "login"
  128. t.string "email"
  129. t.datetime "created_at", null: false
  130. t.datetime "updated_at", null: false
  131. t.string "password_digest"
  132. t.string "remember_digest"
  133. t.integer "gender", default: 0
  134. t.string "phone"
  135. t.date "birth_date"
  136. t.string "picture"
  137. t.integer "school_id"
  138. t.boolean "admin", default: false
  139. t.index ["login"], name: "index_users_on_login", unique: true
  140. t.index ["school_id"], name: "index_users_on_school_id"
  141. end
  142. end