ぼざクリタグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

476 lines
24 KiB

  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. # This file is the source Rails uses to define your schema when running `bin/rails
  6. # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
  7. # be faster and is potentially less error prone than running all of your
  8. # migrations from scratch. Old migrations may fail to apply correctly if those
  9. # migrations use external dependencies or application code.
  10. #
  11. # It's strongly recommended that you check this file into your version control system.
  12. ActiveRecord::Schema[8.0].define(version: 2026_04_26_120600) do
  13. create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  14. t.string "name", null: false
  15. t.string "record_type", null: false
  16. t.bigint "record_id", null: false
  17. t.bigint "blob_id", null: false
  18. t.datetime "created_at", null: false
  19. t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
  20. t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
  21. end
  22. create_table "active_storage_blobs", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  23. t.string "key", null: false
  24. t.string "filename", null: false
  25. t.string "content_type"
  26. t.text "metadata"
  27. t.string "service_name", null: false
  28. t.bigint "byte_size", null: false
  29. t.string "checksum"
  30. t.datetime "created_at", null: false
  31. t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
  32. end
  33. create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  34. t.bigint "blob_id", null: false
  35. t.string "variation_digest", null: false
  36. t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
  37. end
  38. create_table "deerjikists", primary_key: ["platform", "code"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  39. t.string "platform", limit: 16, null: false
  40. t.string "code", null: false
  41. t.bigint "tag_id", null: false
  42. t.datetime "created_at", null: false
  43. t.datetime "updated_at", null: false
  44. t.index ["tag_id"], name: "index_deerjikists_on_tag_id"
  45. end
  46. create_table "ip_addresses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  47. t.binary "ip_address", limit: 16, null: false
  48. t.boolean "banned", default: false, null: false
  49. t.datetime "created_at", null: false
  50. t.datetime "updated_at", null: false
  51. t.index ["ip_address"], name: "index_ip_addresses_on_ip_address", unique: true
  52. end
  53. create_table "material_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  54. t.bigint "material_id", null: false
  55. t.integer "version_no", null: false
  56. t.string "url"
  57. t.bigint "parent_id"
  58. t.bigint "tag_id"
  59. t.bigint "created_by_user_id"
  60. t.bigint "updated_by_user_id"
  61. t.datetime "created_at", null: false
  62. t.datetime "updated_at", null: false
  63. t.datetime "discarded_at"
  64. t.index ["created_by_user_id"], name: "index_material_versions_on_created_by_user_id"
  65. t.index ["discarded_at"], name: "index_material_versions_on_discarded_at"
  66. t.index ["material_id", "version_no"], name: "index_material_versions_on_material_id_and_version_no", unique: true
  67. t.index ["material_id"], name: "index_material_versions_on_material_id"
  68. t.index ["parent_id"], name: "index_material_versions_on_parent_id"
  69. t.index ["tag_id"], name: "index_material_versions_on_tag_id"
  70. t.index ["updated_by_user_id"], name: "index_material_versions_on_updated_by_user_id"
  71. t.index ["url"], name: "index_material_versions_on_url"
  72. end
  73. create_table "materials", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  74. t.string "url"
  75. t.bigint "parent_id"
  76. t.bigint "tag_id"
  77. t.bigint "created_by_user_id"
  78. t.bigint "updated_by_user_id"
  79. t.datetime "created_at", null: false
  80. t.datetime "updated_at", null: false
  81. t.datetime "discarded_at"
  82. t.virtual "active_url", type: :string, as: "if((`discarded_at` is null),`url`,NULL)"
  83. t.index ["active_url"], name: "index_materials_on_active_url", unique: true
  84. t.index ["created_by_user_id"], name: "index_materials_on_created_by_user_id"
  85. t.index ["discarded_at"], name: "index_materials_on_discarded_at"
  86. t.index ["parent_id"], name: "index_materials_on_parent_id"
  87. t.index ["tag_id"], name: "index_materials_on_tag_id"
  88. t.index ["updated_by_user_id"], name: "index_materials_on_updated_by_user_id"
  89. end
  90. create_table "nico_tag_relations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  91. t.bigint "nico_tag_id", null: false
  92. t.bigint "tag_id", null: false
  93. t.datetime "created_at", null: false
  94. t.datetime "updated_at", null: false
  95. t.index ["nico_tag_id"], name: "index_nico_tag_relations_on_nico_tag_id"
  96. t.index ["tag_id"], name: "index_nico_tag_relations_on_tag_id"
  97. end
  98. create_table "nico_tag_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  99. t.bigint "tag_id", null: false
  100. t.integer "version_no", null: false
  101. t.string "event_type", null: false
  102. t.string "name", null: false
  103. t.text "linked_tags", null: false
  104. t.datetime "created_at", null: false
  105. t.bigint "created_by_user_id"
  106. t.index ["created_at"], name: "index_nico_tag_versions_on_created_at"
  107. t.index ["created_by_user_id", "created_at"], name: "index_nico_tag_versions_on_created_by_user_id_and_created_at", order: { created_at: :desc }
  108. t.index ["tag_id", "created_at"], name: "index_nico_tag_versions_on_tag_id_and_created_at", order: { created_at: :desc }
  109. t.index ["tag_id", "version_no"], name: "index_nico_tag_versions_on_tag_id_and_version_no", unique: true
  110. t.check_constraint "`version_no` > 0", name: "nico_tag_versions_version_no_positive"
  111. end
  112. create_table "post_similarities", primary_key: ["post_id", "target_post_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  113. t.bigint "post_id", null: false
  114. t.bigint "target_post_id", null: false
  115. t.float "cos", null: false
  116. t.index ["post_id", "cos"], name: "index_post_similarities_on_post_id_and_cos", order: { cos: :desc }
  117. t.index ["target_post_id"], name: "index_post_similarities_on_target_post_id"
  118. end
  119. create_table "post_tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  120. t.bigint "post_id", null: false
  121. t.bigint "tag_id", null: false
  122. t.bigint "created_user_id"
  123. t.bigint "deleted_user_id"
  124. t.datetime "created_at", null: false
  125. t.datetime "updated_at", null: false
  126. t.datetime "discarded_at"
  127. t.virtual "is_active", type: :boolean, as: "(`discarded_at` is null)", stored: true
  128. t.virtual "active_unique_key", type: :string, as: "(case when (`discarded_at` is null) then concat(`post_id`,_utf8mb4':',`tag_id`) else NULL end)", stored: true
  129. t.index ["active_unique_key"], name: "idx_post_tags_active_unique", unique: true
  130. t.index ["created_user_id"], name: "index_post_tags_on_created_user_id"
  131. t.index ["deleted_user_id"], name: "index_post_tags_on_deleted_user_id"
  132. t.index ["discarded_at"], name: "index_post_tags_on_discarded_at"
  133. t.index ["post_id", "discarded_at"], name: "index_post_tags_on_post_id_and_discarded_at"
  134. t.index ["post_id"], name: "index_post_tags_on_post_id"
  135. t.index ["tag_id", "discarded_at"], name: "index_post_tags_on_tag_id_and_discarded_at"
  136. t.index ["tag_id"], name: "index_post_tags_on_tag_id"
  137. end
  138. create_table "post_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  139. t.bigint "post_id", null: false
  140. t.integer "version_no", null: false
  141. t.string "event_type", null: false
  142. t.string "title"
  143. t.string "url", limit: 768, null: false
  144. t.string "thumbnail_base", limit: 2000
  145. t.text "tags", null: false
  146. t.bigint "parent_id"
  147. t.datetime "original_created_from"
  148. t.datetime "original_created_before"
  149. t.datetime "created_at", null: false
  150. t.bigint "created_by_user_id"
  151. t.index ["created_by_user_id"], name: "index_post_versions_on_created_by_user_id"
  152. t.index ["parent_id"], name: "index_post_versions_on_parent_id"
  153. t.index ["post_id", "version_no"], name: "index_post_versions_on_post_id_and_version_no", unique: true
  154. t.index ["post_id"], name: "index_post_versions_on_post_id"
  155. t.check_constraint "`event_type` in (_utf8mb4'create',_utf8mb4'update',_utf8mb4'discard',_utf8mb4'restore')", name: "post_versions_event_type_valid"
  156. t.check_constraint "`version_no` > 0", name: "post_versions_version_no_positive"
  157. end
  158. create_table "posts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  159. t.string "title"
  160. t.string "url", limit: 768, null: false
  161. t.string "thumbnail_base", limit: 2000
  162. t.bigint "parent_id"
  163. t.bigint "uploaded_user_id"
  164. t.datetime "created_at", null: false
  165. t.datetime "original_created_from"
  166. t.datetime "original_created_before"
  167. t.datetime "updated_at", null: false
  168. t.index ["parent_id"], name: "index_posts_on_parent_id"
  169. t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
  170. t.index ["url"], name: "index_posts_on_url", unique: true
  171. end
  172. create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  173. t.bigint "user_id", null: false
  174. t.string "key", null: false
  175. t.json "value", null: false
  176. t.datetime "created_at", null: false
  177. t.datetime "updated_at", null: false
  178. t.index ["user_id"], name: "index_settings_on_user_id"
  179. end
  180. create_table "tag_implications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  181. t.bigint "tag_id", null: false
  182. t.bigint "parent_tag_id", null: false
  183. t.datetime "created_at", null: false
  184. t.datetime "updated_at", null: false
  185. t.index ["parent_tag_id"], name: "index_tag_implications_on_parent_tag_id"
  186. t.index ["tag_id", "parent_tag_id"], name: "index_tag_implications_on_tag_id_and_parent_tag_id", unique: true
  187. t.index ["tag_id"], name: "index_tag_implications_on_tag_id"
  188. end
  189. create_table "tag_name_sanitisation_rules", primary_key: "priority", id: :integer, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  190. t.string "source_pattern", null: false
  191. t.string "replacement", null: false
  192. t.datetime "created_at", null: false
  193. t.datetime "updated_at", null: false
  194. t.datetime "discarded_at"
  195. t.index ["discarded_at"], name: "index_tag_name_sanitisation_rules_on_discarded_at"
  196. t.index ["source_pattern"], name: "index_tag_name_sanitisation_rules_on_source_pattern", unique: true
  197. end
  198. create_table "tag_names", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  199. t.string "name", null: false
  200. t.bigint "canonical_id"
  201. t.datetime "created_at", null: false
  202. t.datetime "updated_at", null: false
  203. t.datetime "discarded_at"
  204. t.index ["canonical_id"], name: "index_tag_names_on_canonical_id"
  205. t.index ["discarded_at"], name: "index_tag_names_on_discarded_at"
  206. t.index ["name"], name: "index_tag_names_on_name", unique: true
  207. end
  208. create_table "tag_similarities", primary_key: ["tag_id", "target_tag_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  209. t.bigint "tag_id", null: false
  210. t.bigint "target_tag_id", null: false
  211. t.float "cos", null: false
  212. t.index ["tag_id", "cos"], name: "index_tag_similarities_on_tag_id_and_cos", order: { cos: :desc }
  213. t.index ["target_tag_id"], name: "index_tag_similarities_on_target_tag_id"
  214. end
  215. create_table "tag_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  216. t.bigint "tag_id", null: false
  217. t.integer "version_no", null: false
  218. t.string "event_type", null: false
  219. t.string "name", null: false
  220. t.string "category", null: false
  221. t.text "aliases", null: false
  222. t.text "parent_tag_ids", null: false
  223. t.datetime "created_at", null: false
  224. t.bigint "created_by_user_id"
  225. t.index ["created_at"], name: "index_tag_versions_on_created_at"
  226. t.index ["created_by_user_id", "created_at"], name: "index_tag_versions_on_created_by_user_id_and_created_at", order: { created_at: :desc }
  227. t.index ["tag_id", "created_at"], name: "index_tag_versions_on_tag_id_and_created_at", order: { created_at: :desc }
  228. t.index ["tag_id", "version_no"], name: "index_tag_versions_on_tag_id_and_version_no", unique: true
  229. t.check_constraint "`version_no` > 0", name: "tag_versions_version_no_positive"
  230. end
  231. create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  232. t.bigint "tag_name_id", null: false
  233. t.string "category", default: "general", null: false
  234. t.datetime "created_at", null: false
  235. t.datetime "updated_at", null: false
  236. t.integer "post_count", default: 0, null: false
  237. t.datetime "discarded_at"
  238. t.index ["discarded_at"], name: "index_tags_on_discarded_at"
  239. t.index ["tag_name_id"], name: "index_tags_on_tag_name_id", unique: true
  240. end
  241. create_table "theatre_comments", primary_key: ["theatre_id", "no"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  242. t.bigint "theatre_id", null: false
  243. t.integer "no", null: false
  244. t.bigint "user_id"
  245. t.text "content", null: false
  246. t.datetime "created_at", null: false
  247. t.datetime "updated_at", null: false
  248. t.datetime "discarded_at"
  249. t.index ["discarded_at"], name: "index_theatre_comments_on_discarded_at"
  250. t.index ["theatre_id"], name: "index_theatre_comments_on_theatre_id"
  251. t.index ["user_id"], name: "index_theatre_comments_on_user_id"
  252. end
  253. create_table "theatre_watching_users", primary_key: ["theatre_id", "user_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  254. t.bigint "theatre_id", null: false
  255. t.bigint "user_id", null: false
  256. t.datetime "expires_at", null: false
  257. t.datetime "created_at", null: false
  258. t.datetime "updated_at", null: false
  259. t.index ["expires_at"], name: "index_theatre_watching_users_on_expires_at"
  260. t.index ["theatre_id", "expires_at"], name: "index_theatre_watching_users_on_theatre_id_and_expires_at"
  261. t.index ["theatre_id"], name: "index_theatre_watching_users_on_theatre_id"
  262. t.index ["user_id"], name: "index_theatre_watching_users_on_user_id"
  263. end
  264. create_table "theatres", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  265. t.string "name"
  266. t.datetime "opens_at", null: false
  267. t.datetime "closes_at"
  268. t.integer "kind", null: false
  269. t.bigint "current_post_id"
  270. t.datetime "current_post_started_at"
  271. t.integer "next_comment_no", default: 1, null: false
  272. t.bigint "host_user_id"
  273. t.bigint "created_by_user_id", null: false
  274. t.datetime "created_at", null: false
  275. t.datetime "updated_at", null: false
  276. t.datetime "discarded_at"
  277. t.index ["closes_at"], name: "index_theatres_on_closes_at"
  278. t.index ["created_by_user_id"], name: "index_theatres_on_created_by_user_id"
  279. t.index ["current_post_id"], name: "index_theatres_on_current_post_id"
  280. t.index ["discarded_at"], name: "index_theatres_on_discarded_at"
  281. t.index ["host_user_id"], name: "index_theatres_on_host_user_id"
  282. t.index ["kind"], name: "index_theatres_on_kind"
  283. t.index ["opens_at"], name: "index_theatres_on_opens_at"
  284. end
  285. create_table "user_ips", primary_key: ["user_id", "ip_address_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  286. t.bigint "user_id", null: false
  287. t.bigint "ip_address_id", null: false
  288. t.datetime "created_at", null: false
  289. t.datetime "updated_at", null: false
  290. t.index ["ip_address_id"], name: "index_user_ips_on_ip_address_id"
  291. end
  292. create_table "user_post_views", primary_key: ["user_id", "post_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  293. t.bigint "user_id", null: false
  294. t.bigint "post_id", null: false
  295. t.datetime "created_at", null: false
  296. t.datetime "updated_at", null: false
  297. t.index ["post_id"], name: "index_user_post_views_on_post_id"
  298. end
  299. create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  300. t.string "name"
  301. t.string "inheritance_code", limit: 64, null: false
  302. t.string "role", null: false
  303. t.boolean "banned", default: false, null: false
  304. t.datetime "created_at", null: false
  305. t.datetime "updated_at", null: false
  306. end
  307. create_table "wiki_assets", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  308. t.bigint "wiki_page_id", null: false
  309. t.integer "no", null: false
  310. t.string "alt_text"
  311. t.binary "sha256", limit: 32, null: false
  312. t.bigint "created_by_user_id", null: false
  313. t.datetime "created_at", null: false
  314. t.datetime "updated_at", null: false
  315. t.index ["created_by_user_id"], name: "index_wiki_assets_on_created_by_user_id"
  316. t.index ["wiki_page_id", "no"], name: "index_wiki_assets_on_wiki_page_id_and_no", unique: true
  317. t.index ["wiki_page_id", "sha256"], name: "index_wiki_assets_on_wiki_page_id_and_sha256", unique: true
  318. end
  319. create_table "wiki_lines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  320. t.string "sha256", limit: 64, null: false
  321. t.text "body", null: false
  322. t.datetime "created_at", null: false
  323. t.datetime "updated_at", null: false
  324. t.index ["sha256"], name: "index_wiki_lines_on_sha256", unique: true
  325. end
  326. create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  327. t.bigint "tag_name_id", null: false
  328. t.text "body", null: false
  329. t.bigint "created_user_id", null: false
  330. t.bigint "updated_user_id", null: false
  331. t.datetime "created_at", null: false
  332. t.datetime "updated_at", null: false
  333. t.datetime "discarded_at"
  334. t.integer "next_asset_no", default: 1, null: false
  335. t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
  336. t.index ["discarded_at"], name: "index_wiki_pages_on_discarded_at"
  337. t.index ["tag_name_id"], name: "index_wiki_pages_on_tag_name_id", unique: true
  338. t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
  339. end
  340. create_table "wiki_revision_lines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  341. t.bigint "wiki_revision_id", null: false
  342. t.integer "position", null: false
  343. t.bigint "wiki_line_id", null: false
  344. t.index ["wiki_line_id"], name: "index_wiki_revision_lines_on_wiki_line_id"
  345. t.index ["wiki_revision_id", "position"], name: "index_wiki_revision_lines_on_wiki_revision_id_and_position", unique: true
  346. t.index ["wiki_revision_id", "wiki_line_id"], name: "index_wiki_revision_lines_on_wiki_revision_id_and_wiki_line_id"
  347. t.index ["wiki_revision_id"], name: "index_wiki_revision_lines_on_wiki_revision_id"
  348. end
  349. create_table "wiki_revisions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  350. t.bigint "wiki_page_id", null: false
  351. t.bigint "base_revision_id"
  352. t.bigint "created_user_id", null: false
  353. t.integer "kind", default: 0, null: false
  354. t.bigint "redirect_page_id"
  355. t.string "message"
  356. t.integer "lines_count", default: 0, null: false
  357. t.string "tree_sha256", limit: 64
  358. t.datetime "created_at", null: false
  359. t.datetime "updated_at", null: false
  360. t.index ["base_revision_id"], name: "index_wiki_revisions_on_base_revision_id"
  361. t.index ["created_user_id"], name: "index_wiki_revisions_on_created_user_id"
  362. t.index ["kind"], name: "index_wiki_revisions_on_kind"
  363. t.index ["redirect_page_id"], name: "index_wiki_revisions_on_redirect_page_id"
  364. t.index ["tree_sha256"], name: "index_wiki_revisions_on_tree_sha256"
  365. t.index ["wiki_page_id", "id"], name: "index_wiki_revisions_on_wiki_page_id_and_id"
  366. t.index ["wiki_page_id"], name: "index_wiki_revisions_on_wiki_page_id"
  367. end
  368. create_table "wiki_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  369. t.bigint "wiki_page_id", null: false
  370. t.integer "version_no", null: false
  371. t.string "event_type", null: false
  372. t.string "title", null: false
  373. t.text "body", null: false
  374. t.text "reason"
  375. t.datetime "created_at", null: false
  376. t.bigint "created_by_user_id"
  377. t.index ["created_by_user_id"], name: "index_wiki_versions_on_created_by_user_id"
  378. t.index ["wiki_page_id", "version_no"], name: "index_wiki_versions_on_wiki_page_id_and_version_no", unique: true
  379. t.index ["wiki_page_id"], name: "index_wiki_versions_on_wiki_page_id"
  380. t.check_constraint "`event_type` in (_utf8mb4'create',_utf8mb4'update',_utf8mb4'discard',_utf8mb4'restore')", name: "wiki_versions_event_type_valid"
  381. t.check_constraint "`version_no` > 0", name: "wiki_versions_version_no_positive"
  382. end
  383. add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
  384. add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
  385. add_foreign_key "material_versions", "materials"
  386. add_foreign_key "material_versions", "materials", column: "parent_id"
  387. add_foreign_key "material_versions", "tags"
  388. add_foreign_key "material_versions", "users", column: "created_by_user_id"
  389. add_foreign_key "material_versions", "users", column: "updated_by_user_id"
  390. add_foreign_key "materials", "materials", column: "parent_id"
  391. add_foreign_key "materials", "tags"
  392. add_foreign_key "materials", "users", column: "created_by_user_id"
  393. add_foreign_key "materials", "users", column: "updated_by_user_id"
  394. add_foreign_key "nico_tag_relations", "tags"
  395. add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
  396. add_foreign_key "nico_tag_versions", "tags"
  397. add_foreign_key "nico_tag_versions", "users", column: "created_by_user_id"
  398. add_foreign_key "post_similarities", "posts"
  399. add_foreign_key "post_similarities", "posts", column: "target_post_id"
  400. add_foreign_key "post_tags", "posts"
  401. add_foreign_key "post_tags", "tags"
  402. add_foreign_key "post_tags", "users", column: "created_user_id"
  403. add_foreign_key "post_tags", "users", column: "deleted_user_id"
  404. add_foreign_key "post_versions", "posts"
  405. add_foreign_key "post_versions", "posts", column: "parent_id"
  406. add_foreign_key "post_versions", "users", column: "created_by_user_id"
  407. add_foreign_key "posts", "posts", column: "parent_id"
  408. add_foreign_key "posts", "users", column: "uploaded_user_id"
  409. add_foreign_key "settings", "users"
  410. add_foreign_key "tag_implications", "tags"
  411. add_foreign_key "tag_implications", "tags", column: "parent_tag_id"
  412. add_foreign_key "tag_names", "tag_names", column: "canonical_id"
  413. add_foreign_key "tag_similarities", "tags"
  414. add_foreign_key "tag_similarities", "tags", column: "target_tag_id"
  415. add_foreign_key "tag_versions", "tags"
  416. add_foreign_key "tag_versions", "users", column: "created_by_user_id"
  417. add_foreign_key "tags", "tag_names"
  418. add_foreign_key "theatre_comments", "theatres"
  419. add_foreign_key "theatre_comments", "users"
  420. add_foreign_key "theatre_watching_users", "theatres"
  421. add_foreign_key "theatre_watching_users", "users"
  422. add_foreign_key "theatres", "posts", column: "current_post_id"
  423. add_foreign_key "theatres", "users", column: "created_by_user_id"
  424. add_foreign_key "theatres", "users", column: "host_user_id"
  425. add_foreign_key "user_ips", "ip_addresses"
  426. add_foreign_key "user_ips", "users"
  427. add_foreign_key "user_post_views", "posts"
  428. add_foreign_key "user_post_views", "users"
  429. add_foreign_key "wiki_assets", "users", column: "created_by_user_id"
  430. add_foreign_key "wiki_assets", "wiki_pages"
  431. add_foreign_key "wiki_pages", "tag_names"
  432. add_foreign_key "wiki_pages", "users", column: "created_user_id"
  433. add_foreign_key "wiki_pages", "users", column: "updated_user_id"
  434. add_foreign_key "wiki_revision_lines", "wiki_lines"
  435. add_foreign_key "wiki_revision_lines", "wiki_revisions"
  436. add_foreign_key "wiki_revisions", "users", column: "created_user_id"
  437. add_foreign_key "wiki_revisions", "wiki_pages"
  438. add_foreign_key "wiki_revisions", "wiki_pages", column: "redirect_page_id"
  439. add_foreign_key "wiki_revisions", "wiki_revisions", column: "base_revision_id"
  440. add_foreign_key "wiki_versions", "users", column: "created_by_user_id"
  441. add_foreign_key "wiki_versions", "wiki_pages"
  442. end