Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. ENTITY book_lines
  2. {
  3. int book_line_id,
  4. string line,
  5. int source,
  6. int linenum,
  7. int created_at,
  8. int updated_at
  9. PRIMARY(line, source)
  10. }
  11.  
  12. ENTITY books
  13. {
  14. int book_id,
  15. string name,
  16. int created_at,
  17. int updated_at
  18. PRIMARY(name)
  19. }
  20.  
  21. ENTITY wordlists
  22. {
  23. int wordlist_id,
  24. string name,
  25. string description,
  26. int created_at,
  27. int updated_at
  28. PRIMARY(name)
  29. }
  30.  
  31. ENTITY words
  32. {
  33. int word_id,
  34. string word,
  35. string definition,
  36. int created_at,
  37. int updated_at
  38. PRIMARY(word)
  39. }
  40.  
  41. ENTITY words_wordlists
  42. {
  43. int words_wordlist_id,
  44. FOREIGN KEY word_id REF words,
  45. FOREIGN KEY wordlist_id REF wordlists
  46. PRIMARY(words_wordlist_id)
  47. }
  48.  
  49. ENTITY wrong_choices
  50. {
  51. int wrong_choice_id,
  52. int count,
  53. int created_at,
  54. int updated_at,
  55. FOREIGN KEY word_id REF words
  56. PRIMARY(wrong_choice_id)
  57. }
  58.  
  59. ENTITY context_caches
  60. {
  61. int context_cache_id,
  62. FOREIGN KEY word_id REF words,
  63. bool dirty,
  64. int created_at,
  65. int updated_at
  66. PRIMARY(context_cache_id)
  67. }
  68.  
  69. ENTITY contexts
  70. {
  71. int context_id,
  72. string wordline,
  73. string before,
  74. string after,
  75. int created_at,
  76. int updated_at,
  77. FOREIGN KEY bookid REF books,
  78. FOREIGN KEY wordid REF words
  79. PRIMARY(context_id)
  80. }
  81.  
  82. ENTITY contexts_words
  83. {
  84. int contexts_word_id,
  85. FOREIGN KEY context_id REF contexts,
  86. FOREIGN KEY word_id REF words
  87. PRIMARY(contexts_word_id)
  88. }
  89.  
  90. ENTITY game_players
  91. {
  92. int game_player_id,
  93. FOREIGN KEY user_id REF users,
  94. FOREIGN KEY game_id REF games,
  95. int score,
  96. int created_at,
  97. int updated_at
  98. PRIMARY(user_id, game_id)
  99. }
  100.  
  101. ENTITY multiple_choices
  102. {
  103. int multiple_choice_id,
  104. string choice1,
  105. string choice2,
  106. string choice3,
  107. string choice4,
  108. FOREIGN KEY word_id REF words,
  109. int created_at,
  110. int updated_at,
  111. bool is_intersection,
  112. int score
  113. PRIMARY(multiple_choice_id)
  114. }
  115.  
  116. ENTITY searches
  117. {
  118. int searche_id,
  119. int created_at,
  120. int updated_at
  121. PRIMARY(searche_id)
  122. }
  123.  
  124. ENTITY users
  125. {
  126. int user_id,
  127. string login,
  128. string name,
  129. string email,
  130. string crypted_password,
  131. string salt,
  132. int created_at,
  133. int updated_at,
  134. string remember_token,
  135. int remember_token_expires_at,
  136. string activation_code,
  137. int activated_at
  138. PRIMARY(login)
  139. }
  140.  
  141. ENTITY games
  142. {
  143. int game_id,
  144. FOREIGN KEY wordlist_id REF wordlists,
  145. bool finished,
  146. FOREIGN KEY user_id REF users,
  147. int created_at,
  148. int updated_at,
  149. string currentword
  150. PRIMARY(game_id)
  151. }
Add Comment
Please, Sign In to add comment