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

189 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_09_09_075500) 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 "original_created_from"
  79. t.datetime "original_created_before"
  80. t.datetime "updated_at", null: false
  81. t.index ["parent_id"], name: "index_posts_on_parent_id"
  82. t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
  83. end
  84. create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  85. t.bigint "user_id", null: false
  86. t.string "key", null: false
  87. t.json "value", null: false
  88. t.datetime "created_at", null: false
  89. t.datetime "updated_at", null: false
  90. t.index ["user_id"], name: "index_settings_on_user_id"
  91. end
  92. create_table "tag_aliases", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  93. t.bigint "tag_id", null: false
  94. t.string "name", null: false
  95. t.datetime "created_at", null: false
  96. t.datetime "updated_at", null: false
  97. t.index ["tag_id"], name: "index_tag_aliases_on_tag_id"
  98. end
  99. create_table "tag_similarities", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  100. t.bigint "tag_id", null: false
  101. t.bigint "target_tag_id", null: false
  102. t.float "cos", null: false
  103. t.index ["tag_id"], name: "index_tag_similarities_on_tag_id"
  104. t.index ["target_tag_id"], name: "index_tag_similarities_on_target_tag_id"
  105. end
  106. create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  107. t.string "name", null: false
  108. t.string "category", default: "general", null: false
  109. t.datetime "created_at", null: false
  110. t.datetime "updated_at", null: false
  111. t.integer "post_count", default: 0, null: false
  112. end
  113. create_table "user_ips", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  114. t.bigint "user_id", null: false
  115. t.bigint "ip_address_id", null: false
  116. t.datetime "created_at", null: false
  117. t.datetime "updated_at", null: false
  118. t.index ["ip_address_id"], name: "index_user_ips_on_ip_address_id"
  119. t.index ["user_id"], name: "index_user_ips_on_user_id"
  120. end
  121. create_table "user_post_views", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  122. t.bigint "user_id", null: false
  123. t.bigint "post_id", null: false
  124. t.datetime "created_at", null: false
  125. t.datetime "updated_at", null: false
  126. t.index ["post_id"], name: "index_user_post_views_on_post_id"
  127. t.index ["user_id"], name: "index_user_post_views_on_user_id"
  128. end
  129. create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  130. t.string "name"
  131. t.string "inheritance_code", limit: 64, null: false
  132. t.string "role", null: false
  133. t.boolean "banned", default: false, null: false
  134. t.datetime "created_at", null: false
  135. t.datetime "updated_at", null: false
  136. end
  137. create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  138. t.string "title", null: false
  139. t.bigint "tag_id"
  140. t.bigint "created_user_id", null: false
  141. t.bigint "updated_user_id", null: false
  142. t.datetime "created_at", null: false
  143. t.datetime "updated_at", null: false
  144. t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
  145. t.index ["tag_id"], name: "index_wiki_pages_on_tag_id"
  146. t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
  147. end
  148. add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
  149. add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
  150. add_foreign_key "nico_tag_relations", "tags"
  151. add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
  152. add_foreign_key "post_similarities", "posts"
  153. add_foreign_key "post_similarities", "posts", column: "target_post_id"
  154. add_foreign_key "post_tags", "posts"
  155. add_foreign_key "post_tags", "tags"
  156. add_foreign_key "post_tags", "users", column: "created_user_id"
  157. add_foreign_key "post_tags", "users", column: "deleted_user_id"
  158. add_foreign_key "posts", "posts", column: "parent_id"
  159. add_foreign_key "posts", "users", column: "uploaded_user_id"
  160. add_foreign_key "settings", "users"
  161. add_foreign_key "tag_aliases", "tags"
  162. add_foreign_key "tag_similarities", "tags"
  163. add_foreign_key "tag_similarities", "tags", column: "target_tag_id"
  164. add_foreign_key "user_ips", "ip_addresses"
  165. add_foreign_key "user_ips", "users"
  166. add_foreign_key "user_post_views", "posts"
  167. add_foreign_key "user_post_views", "users"
  168. add_foreign_key "wiki_pages", "tags"
  169. add_foreign_key "wiki_pages", "users", column: "created_user_id"
  170. add_foreign_key "wiki_pages", "users", column: "updated_user_id"
  171. end