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

137 lines
6.0 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_02_27_214100) do
  13. create_table "ip_addresses", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  14. t.binary "ip_adress", limit: 16, null: false
  15. t.boolean "banned", default: false, null: false
  16. t.datetime "created_at", null: false
  17. t.datetime "updated_at", null: false
  18. end
  19. create_table "nico_tag_relations", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  20. t.bigint "nico_tag_id", null: false
  21. t.bigint "tag_id", null: false
  22. t.datetime "created_at", null: false
  23. t.datetime "updated_at", null: false
  24. t.index ["nico_tag_id"], name: "index_nico_tag_relations_on_nico_tag_id"
  25. t.index ["tag_id"], name: "index_nico_tag_relations_on_tag_id"
  26. end
  27. create_table "post_tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  28. t.bigint "post_id", null: false
  29. t.bigint "tag_id", null: false
  30. t.bigint "created_user_id"
  31. t.bigint "deleted_user_id"
  32. t.datetime "created_at", null: false
  33. t.datetime "updated_at", null: false
  34. t.index ["created_user_id"], name: "index_post_tags_on_created_user_id"
  35. t.index ["deleted_user_id"], name: "index_post_tags_on_deleted_user_id"
  36. t.index ["post_id"], name: "index_post_tags_on_post_id"
  37. t.index ["tag_id"], name: "index_post_tags_on_tag_id"
  38. end
  39. create_table "posts", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  40. t.string "url", limit: 2000, null: false
  41. t.string "thumbnail", null: false
  42. t.string "thumbnail_base", limit: 2000, null: false
  43. t.bigint "parent_id"
  44. t.bigint "uploaded_user_id"
  45. t.datetime "created_at", null: false
  46. t.datetime "updated_at", null: false
  47. t.index ["parent_id"], name: "index_posts_on_parent_id"
  48. t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
  49. end
  50. create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  51. t.bigint "user_id", null: false
  52. t.string "key", null: false
  53. t.json "value", null: false
  54. t.datetime "created_at", null: false
  55. t.datetime "updated_at", null: false
  56. t.index ["user_id"], name: "index_settings_on_user_id"
  57. end
  58. create_table "tag_aliases", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  59. t.bigint "tag_id", null: false
  60. t.string "name", null: false
  61. t.datetime "created_at", null: false
  62. t.datetime "updated_at", null: false
  63. t.index ["tag_id"], name: "index_tag_aliases_on_tag_id"
  64. end
  65. create_table "tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  66. t.string "name", null: false
  67. t.string "category", default: "general", null: false
  68. t.datetime "created_at", null: false
  69. t.datetime "updated_at", null: false
  70. end
  71. create_table "user_ips", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  72. t.bigint "user_id", null: false
  73. t.bigint "ip_address_id", null: false
  74. t.datetime "created_at", null: false
  75. t.datetime "updated_at", null: false
  76. t.index ["ip_address_id"], name: "index_user_ips_on_ip_address_id"
  77. t.index ["user_id"], name: "index_user_ips_on_user_id"
  78. end
  79. create_table "user_post_views", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  80. t.bigint "user_id", null: false
  81. t.bigint "post_id", null: false
  82. t.boolean "viewed", default: false, null: false
  83. t.datetime "created_at", null: false
  84. t.datetime "updated_at", null: false
  85. t.index ["post_id"], name: "index_user_post_views_on_post_id"
  86. t.index ["user_id"], name: "index_user_post_views_on_user_id"
  87. end
  88. create_table "users", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  89. t.string "name"
  90. t.string "inheritance_code", limit: 64, null: false
  91. t.string "role", null: false
  92. t.boolean "banned", default: false, null: false
  93. t.datetime "created_at", null: false
  94. t.datetime "updated_at", null: false
  95. end
  96. create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
  97. t.string "title", null: false
  98. t.bigint "tag_id"
  99. t.bigint "created_user_id", null: false
  100. t.bigint "updated_user_id", null: false
  101. t.datetime "created_at", null: false
  102. t.datetime "updated_at", null: false
  103. t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
  104. t.index ["tag_id"], name: "index_wiki_pages_on_tag_id"
  105. t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
  106. end
  107. add_foreign_key "nico_tag_relations", "tags"
  108. add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
  109. add_foreign_key "post_tags", "posts"
  110. add_foreign_key "post_tags", "tags"
  111. add_foreign_key "post_tags", "users", column: "created_user_id"
  112. add_foreign_key "post_tags", "users", column: "deleted_user_id"
  113. add_foreign_key "posts", "posts", column: "parent_id"
  114. add_foreign_key "posts", "users", column: "uploaded_user_id"
  115. add_foreign_key "settings", "users"
  116. add_foreign_key "tag_aliases", "tags"
  117. add_foreign_key "user_ips", "ip_addresses"
  118. add_foreign_key "user_ips", "users"
  119. add_foreign_key "user_post_views", "posts"
  120. add_foreign_key "user_post_views", "users"
  121. add_foreign_key "wiki_pages", "tags"
  122. add_foreign_key "wiki_pages", "users", column: "created_user_id"
  123. add_foreign_key "wiki_pages", "users", column: "updated_user_id"
  124. end