ぼざクリタグ広場 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.
 
 
 
 
 

482 lines
25 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_27_214800) 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_implications", primary_key: ["post_id", "parent_post_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  113. t.bigint "post_id", null: false
  114. t.bigint "parent_post_id", null: false
  115. t.datetime "created_at", null: false
  116. t.datetime "updated_at", null: false
  117. t.index ["parent_post_id"], name: "index_post_implications_on_parent_post_id"
  118. t.check_constraint "`post_id` <> `parent_post_id`", name: "chk_post_implications_no_self"
  119. end
  120. create_table "post_similarities", primary_key: ["post_id", "target_post_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  121. t.bigint "post_id", null: false
  122. t.bigint "target_post_id", null: false
  123. t.float "cos", null: false
  124. t.index ["post_id", "cos"], name: "index_post_similarities_on_post_id_and_cos", order: { cos: :desc }
  125. t.index ["target_post_id"], name: "index_post_similarities_on_target_post_id"
  126. end
  127. create_table "post_tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  128. t.bigint "post_id", null: false
  129. t.bigint "tag_id", null: false
  130. t.bigint "created_user_id"
  131. t.bigint "deleted_user_id"
  132. t.datetime "created_at", null: false
  133. t.datetime "updated_at", null: false
  134. t.datetime "discarded_at"
  135. t.virtual "is_active", type: :boolean, as: "(`discarded_at` is null)", stored: true
  136. 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
  137. t.index ["active_unique_key"], name: "idx_post_tags_active_unique", unique: true
  138. t.index ["created_user_id"], name: "index_post_tags_on_created_user_id"
  139. t.index ["deleted_user_id"], name: "index_post_tags_on_deleted_user_id"
  140. t.index ["discarded_at"], name: "index_post_tags_on_discarded_at"
  141. t.index ["post_id", "discarded_at"], name: "index_post_tags_on_post_id_and_discarded_at"
  142. t.index ["post_id"], name: "index_post_tags_on_post_id"
  143. t.index ["tag_id", "discarded_at"], name: "index_post_tags_on_tag_id_and_discarded_at"
  144. t.index ["tag_id"], name: "index_post_tags_on_tag_id"
  145. end
  146. create_table "post_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  147. t.bigint "post_id", null: false
  148. t.integer "version_no", null: false
  149. t.string "event_type", null: false
  150. t.string "title"
  151. t.string "url", limit: 768, null: false
  152. t.string "thumbnail_base", limit: 2000
  153. t.text "tags", null: false
  154. t.text "parent_post_ids", null: false
  155. t.datetime "original_created_from"
  156. t.datetime "original_created_before"
  157. t.datetime "created_at", null: false
  158. t.bigint "created_by_user_id"
  159. t.index ["created_by_user_id"], name: "index_post_versions_on_created_by_user_id"
  160. t.index ["post_id", "version_no"], name: "index_post_versions_on_post_id_and_version_no", unique: true
  161. t.index ["post_id"], name: "index_post_versions_on_post_id"
  162. t.check_constraint "`event_type` in (_utf8mb4'create',_utf8mb4'update',_utf8mb4'discard',_utf8mb4'restore')", name: "post_versions_event_type_valid"
  163. t.check_constraint "`version_no` > 0", name: "post_versions_version_no_positive"
  164. end
  165. create_table "posts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  166. t.string "title"
  167. t.string "url", limit: 768, null: false
  168. t.string "thumbnail_base", limit: 2000
  169. t.bigint "uploaded_user_id"
  170. t.datetime "created_at", null: false
  171. t.datetime "original_created_from"
  172. t.datetime "original_created_before"
  173. t.datetime "updated_at", null: false
  174. t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
  175. t.index ["url"], name: "index_posts_on_url", unique: true
  176. end
  177. create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  178. t.bigint "user_id", null: false
  179. t.string "key", null: false
  180. t.json "value", null: false
  181. t.datetime "created_at", null: false
  182. t.datetime "updated_at", null: false
  183. t.index ["user_id"], name: "index_settings_on_user_id"
  184. end
  185. create_table "tag_implications", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  186. t.bigint "tag_id", null: false
  187. t.bigint "parent_tag_id", null: false
  188. t.datetime "created_at", null: false
  189. t.datetime "updated_at", null: false
  190. t.index ["parent_tag_id"], name: "index_tag_implications_on_parent_tag_id"
  191. t.index ["tag_id", "parent_tag_id"], name: "index_tag_implications_on_tag_id_and_parent_tag_id", unique: true
  192. t.index ["tag_id"], name: "index_tag_implications_on_tag_id"
  193. end
  194. create_table "tag_name_sanitisation_rules", primary_key: "priority", id: :integer, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  195. t.string "source_pattern", null: false
  196. t.string "replacement", null: false
  197. t.datetime "created_at", null: false
  198. t.datetime "updated_at", null: false
  199. t.datetime "discarded_at"
  200. t.index ["discarded_at"], name: "index_tag_name_sanitisation_rules_on_discarded_at"
  201. t.index ["source_pattern"], name: "index_tag_name_sanitisation_rules_on_source_pattern", unique: true
  202. end
  203. create_table "tag_names", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  204. t.string "name", null: false
  205. t.bigint "canonical_id"
  206. t.datetime "created_at", null: false
  207. t.datetime "updated_at", null: false
  208. t.datetime "discarded_at"
  209. t.index ["canonical_id"], name: "index_tag_names_on_canonical_id"
  210. t.index ["discarded_at"], name: "index_tag_names_on_discarded_at"
  211. t.index ["name"], name: "index_tag_names_on_name", unique: true
  212. end
  213. create_table "tag_similarities", primary_key: ["tag_id", "target_tag_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  214. t.bigint "tag_id", null: false
  215. t.bigint "target_tag_id", null: false
  216. t.float "cos", null: false
  217. t.index ["tag_id", "cos"], name: "index_tag_similarities_on_tag_id_and_cos", order: { cos: :desc }
  218. t.index ["target_tag_id"], name: "index_tag_similarities_on_target_tag_id"
  219. end
  220. create_table "tag_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  221. t.bigint "tag_id", null: false
  222. t.integer "version_no", null: false
  223. t.string "event_type", null: false
  224. t.string "name", null: false
  225. t.string "category", null: false
  226. t.text "aliases", null: false
  227. t.text "parent_tag_ids", null: false
  228. t.datetime "created_at", null: false
  229. t.bigint "created_by_user_id"
  230. t.index ["created_at"], name: "index_tag_versions_on_created_at"
  231. t.index ["created_by_user_id", "created_at"], name: "index_tag_versions_on_created_by_user_id_and_created_at", order: { created_at: :desc }
  232. t.index ["tag_id", "created_at"], name: "index_tag_versions_on_tag_id_and_created_at", order: { created_at: :desc }
  233. t.index ["tag_id", "version_no"], name: "index_tag_versions_on_tag_id_and_version_no", unique: true
  234. t.check_constraint "`version_no` > 0", name: "tag_versions_version_no_positive"
  235. end
  236. create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  237. t.bigint "tag_name_id", null: false
  238. t.string "category", default: "general", null: false
  239. t.datetime "created_at", null: false
  240. t.datetime "updated_at", null: false
  241. t.integer "post_count", default: 0, null: false
  242. t.datetime "discarded_at"
  243. t.index ["discarded_at"], name: "index_tags_on_discarded_at"
  244. t.index ["tag_name_id"], name: "index_tags_on_tag_name_id", unique: true
  245. end
  246. create_table "theatre_comments", primary_key: ["theatre_id", "no"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  247. t.bigint "theatre_id", null: false
  248. t.integer "no", null: false
  249. t.bigint "user_id"
  250. t.text "content", null: false
  251. t.datetime "created_at", null: false
  252. t.datetime "updated_at", null: false
  253. t.datetime "discarded_at"
  254. t.index ["discarded_at"], name: "index_theatre_comments_on_discarded_at"
  255. t.index ["theatre_id"], name: "index_theatre_comments_on_theatre_id"
  256. t.index ["user_id"], name: "index_theatre_comments_on_user_id"
  257. end
  258. create_table "theatre_watching_users", primary_key: ["theatre_id", "user_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  259. t.bigint "theatre_id", null: false
  260. t.bigint "user_id", null: false
  261. t.datetime "expires_at", null: false
  262. t.datetime "created_at", null: false
  263. t.datetime "updated_at", null: false
  264. t.index ["expires_at"], name: "index_theatre_watching_users_on_expires_at"
  265. t.index ["theatre_id", "expires_at"], name: "index_theatre_watching_users_on_theatre_id_and_expires_at"
  266. t.index ["theatre_id"], name: "index_theatre_watching_users_on_theatre_id"
  267. t.index ["user_id"], name: "index_theatre_watching_users_on_user_id"
  268. end
  269. create_table "theatres", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  270. t.string "name"
  271. t.datetime "opens_at", null: false
  272. t.datetime "closes_at"
  273. t.integer "kind", null: false
  274. t.bigint "current_post_id"
  275. t.datetime "current_post_started_at"
  276. t.integer "next_comment_no", default: 1, null: false
  277. t.bigint "host_user_id"
  278. t.bigint "created_by_user_id", null: false
  279. t.datetime "created_at", null: false
  280. t.datetime "updated_at", null: false
  281. t.datetime "discarded_at"
  282. t.index ["closes_at"], name: "index_theatres_on_closes_at"
  283. t.index ["created_by_user_id"], name: "index_theatres_on_created_by_user_id"
  284. t.index ["current_post_id"], name: "index_theatres_on_current_post_id"
  285. t.index ["discarded_at"], name: "index_theatres_on_discarded_at"
  286. t.index ["host_user_id"], name: "index_theatres_on_host_user_id"
  287. t.index ["kind"], name: "index_theatres_on_kind"
  288. t.index ["opens_at"], name: "index_theatres_on_opens_at"
  289. end
  290. create_table "user_ips", primary_key: ["user_id", "ip_address_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  291. t.bigint "user_id", null: false
  292. t.bigint "ip_address_id", null: false
  293. t.datetime "created_at", null: false
  294. t.datetime "updated_at", null: false
  295. t.index ["ip_address_id"], name: "index_user_ips_on_ip_address_id"
  296. end
  297. create_table "user_post_views", primary_key: ["user_id", "post_id"], charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  298. t.bigint "user_id", null: false
  299. t.bigint "post_id", null: false
  300. t.datetime "created_at", null: false
  301. t.datetime "updated_at", null: false
  302. t.index ["post_id"], name: "index_user_post_views_on_post_id"
  303. end
  304. create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  305. t.string "name"
  306. t.string "inheritance_code", limit: 64, null: false
  307. t.string "role", null: false
  308. t.boolean "banned", default: false, null: false
  309. t.datetime "created_at", null: false
  310. t.datetime "updated_at", null: false
  311. end
  312. create_table "wiki_assets", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  313. t.bigint "wiki_page_id", null: false
  314. t.integer "no", null: false
  315. t.string "alt_text"
  316. t.binary "sha256", limit: 32, null: false
  317. t.bigint "created_by_user_id", null: false
  318. t.datetime "created_at", null: false
  319. t.datetime "updated_at", null: false
  320. t.index ["created_by_user_id"], name: "index_wiki_assets_on_created_by_user_id"
  321. t.index ["wiki_page_id", "no"], name: "index_wiki_assets_on_wiki_page_id_and_no", unique: true
  322. t.index ["wiki_page_id", "sha256"], name: "index_wiki_assets_on_wiki_page_id_and_sha256", unique: true
  323. end
  324. create_table "wiki_lines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  325. t.string "sha256", limit: 64, null: false
  326. t.text "body", null: false
  327. t.datetime "created_at", null: false
  328. t.datetime "updated_at", null: false
  329. t.index ["sha256"], name: "index_wiki_lines_on_sha256", unique: true
  330. end
  331. create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  332. t.bigint "tag_name_id", null: false
  333. t.text "body", null: false
  334. t.bigint "created_user_id", null: false
  335. t.bigint "updated_user_id", null: false
  336. t.datetime "created_at", null: false
  337. t.datetime "updated_at", null: false
  338. t.datetime "discarded_at"
  339. t.integer "next_asset_no", default: 1, null: false
  340. t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
  341. t.index ["discarded_at"], name: "index_wiki_pages_on_discarded_at"
  342. t.index ["tag_name_id"], name: "index_wiki_pages_on_tag_name_id", unique: true
  343. t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
  344. end
  345. create_table "wiki_revision_lines", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  346. t.bigint "wiki_revision_id", null: false
  347. t.integer "position", null: false
  348. t.bigint "wiki_line_id", null: false
  349. t.index ["wiki_line_id"], name: "index_wiki_revision_lines_on_wiki_line_id"
  350. t.index ["wiki_revision_id", "position"], name: "index_wiki_revision_lines_on_wiki_revision_id_and_position", unique: true
  351. t.index ["wiki_revision_id", "wiki_line_id"], name: "index_wiki_revision_lines_on_wiki_revision_id_and_wiki_line_id"
  352. t.index ["wiki_revision_id"], name: "index_wiki_revision_lines_on_wiki_revision_id"
  353. end
  354. create_table "wiki_revisions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  355. t.bigint "wiki_page_id", null: false
  356. t.bigint "base_revision_id"
  357. t.bigint "created_user_id", null: false
  358. t.integer "kind", default: 0, null: false
  359. t.bigint "redirect_page_id"
  360. t.string "message"
  361. t.integer "lines_count", default: 0, null: false
  362. t.string "tree_sha256", limit: 64
  363. t.datetime "created_at", null: false
  364. t.datetime "updated_at", null: false
  365. t.index ["base_revision_id"], name: "index_wiki_revisions_on_base_revision_id"
  366. t.index ["created_user_id"], name: "index_wiki_revisions_on_created_user_id"
  367. t.index ["kind"], name: "index_wiki_revisions_on_kind"
  368. t.index ["redirect_page_id"], name: "index_wiki_revisions_on_redirect_page_id"
  369. t.index ["tree_sha256"], name: "index_wiki_revisions_on_tree_sha256"
  370. t.index ["wiki_page_id", "id"], name: "index_wiki_revisions_on_wiki_page_id_and_id"
  371. t.index ["wiki_page_id"], name: "index_wiki_revisions_on_wiki_page_id"
  372. end
  373. create_table "wiki_versions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  374. t.bigint "wiki_page_id", null: false
  375. t.integer "version_no", null: false
  376. t.string "event_type", null: false
  377. t.string "title", null: false
  378. t.text "body", null: false
  379. t.text "reason"
  380. t.datetime "created_at", null: false
  381. t.bigint "created_by_user_id"
  382. t.index ["created_by_user_id"], name: "index_wiki_versions_on_created_by_user_id"
  383. t.index ["wiki_page_id", "version_no"], name: "index_wiki_versions_on_wiki_page_id_and_version_no", unique: true
  384. t.index ["wiki_page_id"], name: "index_wiki_versions_on_wiki_page_id"
  385. t.check_constraint "`event_type` in (_utf8mb4'create',_utf8mb4'update',_utf8mb4'discard',_utf8mb4'restore')", name: "wiki_versions_event_type_valid"
  386. t.check_constraint "`version_no` > 0", name: "wiki_versions_version_no_positive"
  387. end
  388. add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
  389. add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
  390. add_foreign_key "material_versions", "materials"
  391. add_foreign_key "material_versions", "materials", column: "parent_id"
  392. add_foreign_key "material_versions", "tags"
  393. add_foreign_key "material_versions", "users", column: "created_by_user_id"
  394. add_foreign_key "material_versions", "users", column: "updated_by_user_id"
  395. add_foreign_key "materials", "materials", column: "parent_id"
  396. add_foreign_key "materials", "tags"
  397. add_foreign_key "materials", "users", column: "created_by_user_id"
  398. add_foreign_key "materials", "users", column: "updated_by_user_id"
  399. add_foreign_key "nico_tag_relations", "tags"
  400. add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
  401. add_foreign_key "nico_tag_versions", "tags"
  402. add_foreign_key "nico_tag_versions", "users", column: "created_by_user_id"
  403. add_foreign_key "post_implications", "posts"
  404. add_foreign_key "post_implications", "posts", column: "parent_post_id"
  405. add_foreign_key "post_similarities", "posts"
  406. add_foreign_key "post_similarities", "posts", column: "target_post_id"
  407. add_foreign_key "post_tags", "posts"
  408. add_foreign_key "post_tags", "tags"
  409. add_foreign_key "post_tags", "users", column: "created_user_id"
  410. add_foreign_key "post_tags", "users", column: "deleted_user_id"
  411. add_foreign_key "post_versions", "posts"
  412. add_foreign_key "post_versions", "users", column: "created_by_user_id"
  413. add_foreign_key "posts", "users", column: "uploaded_user_id"
  414. add_foreign_key "settings", "users"
  415. add_foreign_key "tag_implications", "tags"
  416. add_foreign_key "tag_implications", "tags", column: "parent_tag_id"
  417. add_foreign_key "tag_names", "tag_names", column: "canonical_id"
  418. add_foreign_key "tag_similarities", "tags"
  419. add_foreign_key "tag_similarities", "tags", column: "target_tag_id"
  420. add_foreign_key "tag_versions", "tags"
  421. add_foreign_key "tag_versions", "users", column: "created_by_user_id"
  422. add_foreign_key "tags", "tag_names"
  423. add_foreign_key "theatre_comments", "theatres"
  424. add_foreign_key "theatre_comments", "users"
  425. add_foreign_key "theatre_watching_users", "theatres"
  426. add_foreign_key "theatre_watching_users", "users"
  427. add_foreign_key "theatres", "posts", column: "current_post_id"
  428. add_foreign_key "theatres", "users", column: "created_by_user_id"
  429. add_foreign_key "theatres", "users", column: "host_user_id"
  430. add_foreign_key "user_ips", "ip_addresses"
  431. add_foreign_key "user_ips", "users"
  432. add_foreign_key "user_post_views", "posts"
  433. add_foreign_key "user_post_views", "users"
  434. add_foreign_key "wiki_assets", "users", column: "created_by_user_id"
  435. add_foreign_key "wiki_assets", "wiki_pages"
  436. add_foreign_key "wiki_pages", "tag_names"
  437. add_foreign_key "wiki_pages", "users", column: "created_user_id"
  438. add_foreign_key "wiki_pages", "users", column: "updated_user_id"
  439. add_foreign_key "wiki_revision_lines", "wiki_lines"
  440. add_foreign_key "wiki_revision_lines", "wiki_revisions"
  441. add_foreign_key "wiki_revisions", "users", column: "created_user_id"
  442. add_foreign_key "wiki_revisions", "wiki_pages"
  443. add_foreign_key "wiki_revisions", "wiki_pages", column: "redirect_page_id"
  444. add_foreign_key "wiki_revisions", "wiki_revisions", column: "base_revision_id"
  445. add_foreign_key "wiki_versions", "users", column: "created_by_user_id"
  446. add_foreign_key "wiki_versions", "wiki_pages"
  447. end