/db/schema.rb

https://github.com/mustang1365/start_and_win · Ruby · 304 lines · 252 code · 40 blank · 12 comment · 0 complexity · ef3fe4db115eece5b15493d32e24a600 MD5 · raw file

  1. # encoding: UTF-8
  2. # This file is auto-generated from the current state of the database. Instead
  3. # of editing this file, please use the migrations feature of Active Record to
  4. # incrementally modify your database, and then regenerate this schema definition.
  5. #
  6. # Note that this schema.rb definition is the authoritative source for your
  7. # database schema. If you need to create the application database on another
  8. # system, you should be using db:schema:load, not running all the migrations
  9. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  10. # you'll amass, the slower it'll run and the greater likelihood for issues).
  11. #
  12. # It's strongly recommended to check this file into your version control system.
  13. ActiveRecord::Schema.define(:version => 20120309203933) do
  14. create_table "authentications", :force => true do |t|
  15. t.integer "user_id", :null => false
  16. t.string "provider", :null => false
  17. t.string "uid", :null => false
  18. t.datetime "created_at"
  19. t.datetime "updated_at"
  20. end
  21. create_table "ckeditor_assets", :force => true do |t|
  22. t.string "data_file_name", :null => false
  23. t.string "data_content_type"
  24. t.integer "data_file_size"
  25. t.integer "assetable_id"
  26. t.string "assetable_type", :limit => 30
  27. t.string "type", :limit => 30
  28. t.datetime "created_at"
  29. t.datetime "updated_at"
  30. end
  31. add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable"
  32. add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type"
  33. create_table "competition_to_questions", :force => true do |t|
  34. t.integer "question_id"
  35. t.integer "competition_id"
  36. t.datetime "created_at"
  37. t.datetime "updated_at"
  38. end
  39. create_table "competitions", :force => true do |t|
  40. t.string "title"
  41. t.text "description"
  42. t.integer "image_id"
  43. t.boolean "system", :default => false
  44. t.integer "user_id"
  45. t.decimal "win_points", :precision => 8, :scale => 2, :default => 0.0
  46. t.decimal "participation_points", :precision => 8, :scale => 2, :default => 0.0
  47. t.datetime "created_at"
  48. t.datetime "updated_at"
  49. t.integer "difficulty_level_id"
  50. t.decimal "competition_points", :precision => 8, :scale => 2, :default => 0.0
  51. t.float "rating", :default => 0.0
  52. end
  53. add_index "competitions", ["difficulty_level_id"], :name => "difficulty_level_index"
  54. create_table "difficulty_level_settings", :force => true do |t|
  55. t.integer "iq_level"
  56. t.integer "difficulty_level_id"
  57. t.datetime "created_at"
  58. t.datetime "updated_at"
  59. t.decimal "competition_max_points", :precision => 8, :scale => 2, :default => 0.0
  60. t.decimal "question_max_points", :precision => 8, :scale => 2, :default => 0.0
  61. t.decimal "competition_max_win_points", :precision => 8, :scale => 2, :default => 0.0
  62. t.decimal "question_max_win_points", :precision => 8, :scale => 2, :default => 0.0
  63. end
  64. create_table "difficulty_levels", :force => true do |t|
  65. t.string "name"
  66. t.datetime "created_at"
  67. t.datetime "updated_at"
  68. end
  69. create_table "education_levels", :force => true do |t|
  70. t.string "name"
  71. t.datetime "created_at"
  72. t.datetime "updated_at"
  73. end
  74. create_table "experience_settings", :force => true do |t|
  75. t.string "competition_name"
  76. t.float "iq_for_participant", :default => 0.0
  77. t.float "iq_for_creator", :default => 0.0
  78. t.datetime "created_at"
  79. t.datetime "updated_at"
  80. end
  81. create_table "financial_accounts", :force => true do |t|
  82. t.integer "user_id"
  83. t.decimal "points_amount", :precision => 8, :scale => 0
  84. t.decimal "reserved_points", :precision => 8, :scale => 0
  85. t.datetime "created_at"
  86. t.datetime "updated_at"
  87. t.integer "model_id"
  88. t.string "model_type"
  89. end
  90. add_index "financial_accounts", ["model_id", "model_type"], :name => "financial_account_model_index"
  91. add_index "financial_accounts", ["user_id"], :name => "f_user_index"
  92. create_table "images", :force => true do |t|
  93. t.text "image_content"
  94. t.datetime "created_at"
  95. t.datetime "updated_at"
  96. end
  97. create_table "main_categories", :force => true do |t|
  98. t.string "title"
  99. t.datetime "created_at"
  100. t.datetime "updated_at"
  101. end
  102. create_table "message_copies", :force => true do |t|
  103. t.integer "recipient_id"
  104. t.integer "sender_id"
  105. t.integer "message_id"
  106. t.boolean "deleted", :default => false
  107. t.datetime "read_at"
  108. t.datetime "created_at"
  109. t.datetime "updated_at"
  110. end
  111. add_index "message_copies", ["message_id"], :name => "copy_message_index"
  112. add_index "message_copies", ["recipient_id"], :name => "copy_recipient_index"
  113. add_index "message_copies", ["sender_id"], :name => "copy_sender_index"
  114. create_table "messages", :force => true do |t|
  115. t.text "body"
  116. t.string "subject"
  117. t.datetime "created_at"
  118. t.datetime "updated_at"
  119. end
  120. create_table "model_to_main_categories", :force => true do |t|
  121. t.integer "main_category_id"
  122. t.integer "model_id"
  123. t.string "model_type"
  124. t.datetime "created_at"
  125. t.datetime "updated_at"
  126. end
  127. add_index "model_to_main_categories", ["main_category_id"], :name => "main_category_index"
  128. add_index "model_to_main_categories", ["model_id", "model_type"], :name => "model_cat_index"
  129. create_table "model_to_main_category_to_sub_categories", :id => false, :force => true do |t|
  130. t.integer "sub_category_id"
  131. t.integer "model_to_main_category_id"
  132. t.datetime "created_at"
  133. t.datetime "updated_at"
  134. end
  135. add_index "model_to_main_category_to_sub_categories", ["model_to_main_category_id"], :name => "model_to_main_category_index"
  136. add_index "model_to_main_category_to_sub_categories", ["sub_category_id"], :name => "sub_category_index"
  137. create_table "news_points", :force => true do |t|
  138. t.string "title"
  139. t.text "description"
  140. t.datetime "end_date"
  141. t.datetime "created_at"
  142. t.datetime "updated_at"
  143. t.integer "image_id"
  144. end
  145. create_table "play_conditions", :force => true do |t|
  146. t.integer "model_id"
  147. t.string "model_type"
  148. t.decimal "participation_points", :precision => 8, :scale => 2, :default => 0.0
  149. t.decimal "points_to_play", :precision => 8, :scale => 2, :default => 0.0
  150. t.integer "difficulty_level_id"
  151. t.datetime "created_at"
  152. t.datetime "updated_at"
  153. t.decimal "win_points", :precision => 8, :scale => 2, :default => 0.0
  154. t.integer "time_limit", :default => 10
  155. end
  156. add_index "play_conditions", ["difficulty_level_id"], :name => "play_difficulty_level_index"
  157. add_index "play_conditions", ["model_id", "model_type"], :name => "play_model_index"
  158. create_table "play_results", :force => true do |t|
  159. t.integer "user_id"
  160. t.string "competition_type"
  161. t.integer "competition_id"
  162. t.string "answers"
  163. t.boolean "won", :default => false
  164. t.boolean "payed", :default => false
  165. t.integer "rating_id"
  166. t.datetime "created_at"
  167. t.datetime "updated_at"
  168. end
  169. add_index "play_results", ["competition_type", "competition_id"], :name => "result_competition_index"
  170. add_index "play_results", ["rating_id"], :name => "result_rating_index"
  171. add_index "play_results", ["user_id"], :name => "result_user_index"
  172. create_table "private_files", :force => true do |t|
  173. t.text "file_content"
  174. t.datetime "created_at"
  175. t.datetime "updated_at"
  176. end
  177. create_table "profiles", :force => true do |t|
  178. t.integer "photo_id"
  179. t.integer "user_id"
  180. t.text "short_description"
  181. t.integer "education_level_id"
  182. t.datetime "created_at"
  183. t.datetime "updated_at"
  184. end
  185. add_index "profiles", ["education_level_id"], :name => "education_level_index"
  186. add_index "profiles", ["photo_id"], :name => "photo_index"
  187. add_index "profiles", ["user_id"], :name => "users_index"
  188. create_table "questions", :force => true do |t|
  189. t.string "text"
  190. t.datetime "created_at"
  191. t.datetime "updated_at"
  192. t.string "status", :default => "Активный"
  193. t.integer "user_id"
  194. t.float "rating", :default => 0.0
  195. end
  196. create_table "rating_rates", :force => true do |t|
  197. t.float "begin_rating", :default => 0.0
  198. t.float "end_rating", :default => 0.0
  199. t.float "rate_of_payment", :default => 0.0
  200. t.datetime "created_at"
  201. t.datetime "updated_at"
  202. end
  203. create_table "ratings", :force => true do |t|
  204. t.float "total_score", :default => 0.0
  205. t.integer "general_score", :default => 5
  206. t.integer "difficulty_score", :default => 5
  207. t.integer "time_score", :default => 5
  208. t.datetime "created_at"
  209. t.datetime "updated_at"
  210. end
  211. create_table "sub_categories", :force => true do |t|
  212. t.string "title"
  213. t.integer "main_category_id"
  214. t.datetime "created_at"
  215. t.datetime "updated_at"
  216. end
  217. create_table "transactions", :force => true do |t|
  218. t.integer "sender_id"
  219. t.integer "recipient_id"
  220. t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0
  221. t.string "point_type"
  222. t.datetime "created_at"
  223. t.datetime "updated_at"
  224. t.text "description"
  225. t.integer "model_id"
  226. t.string "model_type"
  227. end
  228. add_index "transactions", ["model_id", "model_type"], :name => "transaction_model_index"
  229. add_index "transactions", ["recipient_id"], :name => "transactions_recipient_index"
  230. add_index "transactions", ["sender_id"], :name => "transactions_sender_index"
  231. create_table "users", :force => true do |t|
  232. t.string "login"
  233. t.string "email"
  234. t.string "crypted_password"
  235. t.string "salt"
  236. t.datetime "created_at"
  237. t.datetime "updated_at"
  238. t.string "remember_me_token"
  239. t.datetime "remember_me_token_expires_at"
  240. t.string "reset_password_token"
  241. t.datetime "reset_password_token_expires_at"
  242. t.datetime "reset_password_email_sent_at"
  243. t.datetime "last_login_at"
  244. t.datetime "last_logout_at"
  245. t.datetime "last_activity_at"
  246. t.integer "failed_logins_count", :default => 0
  247. t.datetime "lock_expires_at"
  248. t.boolean "admin"
  249. t.decimal "iq_level", :precision => 8, :scale => 2, :default => 0.0
  250. t.string "first_name", :default => "", :null => false
  251. t.string "last_name", :default => "", :null => false
  252. t.string "gender", :default => "", :null => false
  253. end
  254. add_index "users", ["last_logout_at", "last_activity_at"], :name => "index_users_on_last_logout_at_and_last_activity_at"
  255. add_index "users", ["remember_me_token"], :name => "index_users_on_remember_me_token"
  256. add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token"
  257. create_table "variants", :force => true do |t|
  258. t.string "text"
  259. t.integer "question_id"
  260. t.boolean "answer", :default => false
  261. t.datetime "created_at"
  262. t.datetime "updated_at"
  263. end
  264. end