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

167 lines
7.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_06_29_140234) 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_tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  53. t.bigint "post_id", null: false
  54. t.bigint "tag_id", null: false
  55. t.bigint "created_user_id"
  56. t.bigint "deleted_user_id"
  57. t.datetime "created_at", null: false
  58. t.datetime "updated_at", null: false
  59. t.index ["created_user_id"], name: "index_post_tags_on_created_user_id"
  60. t.index ["deleted_user_id"], name: "index_post_tags_on_deleted_user_id"
  61. t.index ["post_id"], name: "index_post_tags_on_post_id"
  62. t.index ["tag_id"], name: "index_post_tags_on_tag_id"
  63. end
  64. create_table "posts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  65. t.string "title", null: false
  66. t.string "url", limit: 2000, null: false
  67. t.string "thumbnail_base", limit: 2000, null: false
  68. t.bigint "parent_id"
  69. t.bigint "uploaded_user_id"
  70. t.datetime "created_at", null: false
  71. t.datetime "updated_at", null: false
  72. t.index ["parent_id"], name: "index_posts_on_parent_id"
  73. t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
  74. end
  75. create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  76. t.bigint "user_id", null: false
  77. t.string "key", null: false
  78. t.json "value", null: false
  79. t.datetime "created_at", null: false
  80. t.datetime "updated_at", null: false
  81. t.index ["user_id"], name: "index_settings_on_user_id"
  82. end
  83. create_table "tag_aliases", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  84. t.bigint "tag_id", null: false
  85. t.string "name", null: false
  86. t.datetime "created_at", null: false
  87. t.datetime "updated_at", null: false
  88. t.index ["tag_id"], name: "index_tag_aliases_on_tag_id"
  89. end
  90. create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  91. t.string "name", null: false
  92. t.string "category", default: "general", null: false
  93. t.datetime "created_at", null: false
  94. t.datetime "updated_at", null: false
  95. t.integer "post_count", default: 0, null: false
  96. end
  97. create_table "user_ips", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  98. t.bigint "user_id", null: false
  99. t.bigint "ip_address_id", null: false
  100. t.datetime "created_at", null: false
  101. t.datetime "updated_at", null: false
  102. t.index ["ip_address_id"], name: "index_user_ips_on_ip_address_id"
  103. t.index ["user_id"], name: "index_user_ips_on_user_id"
  104. end
  105. create_table "user_post_views", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  106. t.bigint "user_id", null: false
  107. t.bigint "post_id", null: false
  108. t.datetime "created_at", null: false
  109. t.datetime "updated_at", null: false
  110. t.index ["post_id"], name: "index_user_post_views_on_post_id"
  111. t.index ["user_id"], name: "index_user_post_views_on_user_id"
  112. end
  113. create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  114. t.string "name"
  115. t.string "inheritance_code", limit: 64, null: false
  116. t.string "role", null: false
  117. t.boolean "banned", default: false, null: false
  118. t.datetime "created_at", null: false
  119. t.datetime "updated_at", null: false
  120. end
  121. create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  122. t.string "title", null: false
  123. t.bigint "tag_id"
  124. t.bigint "created_user_id", null: false
  125. t.bigint "updated_user_id", null: false
  126. t.datetime "created_at", null: false
  127. t.datetime "updated_at", null: false
  128. t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
  129. t.index ["tag_id"], name: "index_wiki_pages_on_tag_id"
  130. t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
  131. end
  132. add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
  133. add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
  134. add_foreign_key "nico_tag_relations", "tags"
  135. add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
  136. add_foreign_key "post_tags", "posts"
  137. add_foreign_key "post_tags", "tags"
  138. add_foreign_key "post_tags", "users", column: "created_user_id"
  139. add_foreign_key "post_tags", "users", column: "deleted_user_id"
  140. add_foreign_key "posts", "posts", column: "parent_id"
  141. add_foreign_key "posts", "users", column: "uploaded_user_id"
  142. add_foreign_key "settings", "users"
  143. add_foreign_key "tag_aliases", "tags"
  144. add_foreign_key "user_ips", "ip_addresses"
  145. add_foreign_key "user_ips", "users"
  146. add_foreign_key "user_post_views", "posts"
  147. add_foreign_key "user_post_views", "users"
  148. add_foreign_key "wiki_pages", "tags"
  149. add_foreign_key "wiki_pages", "users", column: "created_user_id"
  150. add_foreign_key "wiki_pages", "users", column: "updated_user_id"
  151. end