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

187 lines
8.5 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: 2025_07_29_210600) 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 "ip_addresses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  39. t.binary "ip_adress", limit: 16, null: false
  40. t.boolean "banned", default: false, null: false
  41. t.datetime "created_at", null: false
  42. t.datetime "updated_at", null: false
  43. end
  44. create_table "nico_tag_relations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  45. t.bigint "nico_tag_id", null: false
  46. t.bigint "tag_id", null: false
  47. t.datetime "created_at", null: false
  48. t.datetime "updated_at", null: false
  49. t.index ["nico_tag_id"], name: "index_nico_tag_relations_on_nico_tag_id"
  50. t.index ["tag_id"], name: "index_nico_tag_relations_on_tag_id"
  51. end
  52. create_table "post_similarities", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  53. t.bigint "post_id", null: false
  54. t.bigint "target_post_id", null: false
  55. t.float "cos", null: false
  56. t.index ["post_id"], name: "index_post_similarities_on_post_id"
  57. t.index ["target_post_id"], name: "index_post_similarities_on_target_post_id"
  58. end
  59. create_table "post_tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  60. t.bigint "post_id", null: false
  61. t.bigint "tag_id", null: false
  62. t.bigint "created_user_id"
  63. t.bigint "deleted_user_id"
  64. t.datetime "created_at", null: false
  65. t.datetime "updated_at", null: false
  66. t.index ["created_user_id"], name: "index_post_tags_on_created_user_id"
  67. t.index ["deleted_user_id"], name: "index_post_tags_on_deleted_user_id"
  68. t.index ["post_id"], name: "index_post_tags_on_post_id"
  69. t.index ["tag_id"], name: "index_post_tags_on_tag_id"
  70. end
  71. create_table "posts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  72. t.string "title", null: false
  73. t.string "url", limit: 2000, null: false
  74. t.string "thumbnail_base", limit: 2000, null: false
  75. t.bigint "parent_id"
  76. t.bigint "uploaded_user_id"
  77. t.datetime "created_at", null: false
  78. t.datetime "updated_at", null: false
  79. t.index ["parent_id"], name: "index_posts_on_parent_id"
  80. t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
  81. end
  82. create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  83. t.bigint "user_id", null: false
  84. t.string "key", null: false
  85. t.json "value", null: false
  86. t.datetime "created_at", null: false
  87. t.datetime "updated_at", null: false
  88. t.index ["user_id"], name: "index_settings_on_user_id"
  89. end
  90. create_table "tag_aliases", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  91. t.bigint "tag_id", null: false
  92. t.string "name", null: false
  93. t.datetime "created_at", null: false
  94. t.datetime "updated_at", null: false
  95. t.index ["tag_id"], name: "index_tag_aliases_on_tag_id"
  96. end
  97. create_table "tag_similarities", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  98. t.bigint "tag_id", null: false
  99. t.bigint "target_tag_id", null: false
  100. t.float "cos", null: false
  101. t.index ["tag_id"], name: "index_tag_similarities_on_tag_id"
  102. t.index ["target_tag_id"], name: "index_tag_similarities_on_target_tag_id"
  103. end
  104. create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  105. t.string "name", null: false
  106. t.string "category", default: "general", null: false
  107. t.datetime "created_at", null: false
  108. t.datetime "updated_at", null: false
  109. t.integer "post_count", default: 0, null: false
  110. end
  111. create_table "user_ips", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  112. t.bigint "user_id", null: false
  113. t.bigint "ip_address_id", null: false
  114. t.datetime "created_at", null: false
  115. t.datetime "updated_at", null: false
  116. t.index ["ip_address_id"], name: "index_user_ips_on_ip_address_id"
  117. t.index ["user_id"], name: "index_user_ips_on_user_id"
  118. end
  119. create_table "user_post_views", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  120. t.bigint "user_id", null: false
  121. t.bigint "post_id", null: false
  122. t.datetime "created_at", null: false
  123. t.datetime "updated_at", null: false
  124. t.index ["post_id"], name: "index_user_post_views_on_post_id"
  125. t.index ["user_id"], name: "index_user_post_views_on_user_id"
  126. end
  127. create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  128. t.string "name"
  129. t.string "inheritance_code", limit: 64, null: false
  130. t.string "role", null: false
  131. t.boolean "banned", default: false, null: false
  132. t.datetime "created_at", null: false
  133. t.datetime "updated_at", null: false
  134. end
  135. create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  136. t.string "title", null: false
  137. t.bigint "tag_id"
  138. t.bigint "created_user_id", null: false
  139. t.bigint "updated_user_id", null: false
  140. t.datetime "created_at", null: false
  141. t.datetime "updated_at", null: false
  142. t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
  143. t.index ["tag_id"], name: "index_wiki_pages_on_tag_id"
  144. t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
  145. end
  146. add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
  147. add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
  148. add_foreign_key "nico_tag_relations", "tags"
  149. add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
  150. add_foreign_key "post_similarities", "posts"
  151. add_foreign_key "post_similarities", "posts", column: "target_post_id"
  152. add_foreign_key "post_tags", "posts"
  153. add_foreign_key "post_tags", "tags"
  154. add_foreign_key "post_tags", "users", column: "created_user_id"
  155. add_foreign_key "post_tags", "users", column: "deleted_user_id"
  156. add_foreign_key "posts", "posts", column: "parent_id"
  157. add_foreign_key "posts", "users", column: "uploaded_user_id"
  158. add_foreign_key "settings", "users"
  159. add_foreign_key "tag_aliases", "tags"
  160. add_foreign_key "tag_similarities", "tags"
  161. add_foreign_key "tag_similarities", "tags", column: "target_tag_id"
  162. add_foreign_key "user_ips", "ip_addresses"
  163. add_foreign_key "user_ips", "users"
  164. add_foreign_key "user_post_views", "posts"
  165. add_foreign_key "user_post_views", "users"
  166. add_foreign_key "wiki_pages", "tags"
  167. add_foreign_key "wiki_pages", "users", column: "created_user_id"
  168. add_foreign_key "wiki_pages", "users", column: "updated_user_id"
  169. end