#2 ぼちぼち
This commit is contained in:
@@ -4,8 +4,8 @@ class CreatePosts < ActiveRecord::Migration[7.0]
|
||||
t.string :url, limit: 2000, null: false
|
||||
t.string :thumbnail, limit: 255, null: false
|
||||
t.string :thumbnail_base, limit: 2000, null: false
|
||||
t.references :post, foreign_key: { to_table: :posts }
|
||||
t.references :uploaded_by, foreign_key: { to_table: :users }
|
||||
t.references :parent, foreign_key: { to_table: :posts }
|
||||
t.references :uploaded_user, foreign_key: { to_table: :users }
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,8 +3,8 @@ class CreatePostTags < ActiveRecord::Migration[7.0]
|
||||
create_table :post_tags do |t|
|
||||
t.references :post, null: false, foreign_key: { to_table: :posts }
|
||||
t.references :tag, null: false, foreign_key: { to_table: :tags }
|
||||
t.references :created_by, foreign_key: { to_table: :users }
|
||||
t.references :deleted_by, foreign_key: { to_table: :users }
|
||||
t.references :created_user, foreign_key: { to_table: :users }
|
||||
t.references :deleted_user, foreign_key: { to_table: :users }
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,8 +3,8 @@ class CreateWikiPages < ActiveRecord::Migration[7.0]
|
||||
create_table :wiki_pages do |t|
|
||||
t.string :title, limit: 255, null: false
|
||||
t.references :tag, foreign_key: { to_table: :tags }
|
||||
t.references :created_by, null: false, foreign_key: { to_table: :users }
|
||||
t.references :updated_by, null: false, foreign_key: { to_table: :users }
|
||||
t.references :created_user, null: false, foreign_key: { to_table: :users }
|
||||
t.references :updated_user, null: false, foreign_key: { to_table: :users }
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
Generated
+18
-18
@@ -30,12 +30,12 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_27_214100) do
|
||||
create_table "post_tags", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
|
||||
t.bigint "post_id", null: false
|
||||
t.bigint "tag_id", null: false
|
||||
t.bigint "created_by_id"
|
||||
t.bigint "deleted_by_id"
|
||||
t.bigint "created_user_id"
|
||||
t.bigint "deleted_user_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["created_by_id"], name: "index_post_tags_on_created_by_id"
|
||||
t.index ["deleted_by_id"], name: "index_post_tags_on_deleted_by_id"
|
||||
t.index ["created_user_id"], name: "index_post_tags_on_created_user_id"
|
||||
t.index ["deleted_user_id"], name: "index_post_tags_on_deleted_user_id"
|
||||
t.index ["post_id"], name: "index_post_tags_on_post_id"
|
||||
t.index ["tag_id"], name: "index_post_tags_on_tag_id"
|
||||
end
|
||||
@@ -44,12 +44,12 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_27_214100) do
|
||||
t.string "url", limit: 2000, null: false
|
||||
t.string "thumbnail", null: false
|
||||
t.string "thumbnail_base", limit: 2000, null: false
|
||||
t.bigint "post_id"
|
||||
t.bigint "uploaded_by_id"
|
||||
t.bigint "parent_id"
|
||||
t.bigint "uploaded_user_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["post_id"], name: "index_posts_on_post_id"
|
||||
t.index ["uploaded_by_id"], name: "index_posts_on_uploaded_by_id"
|
||||
t.index ["parent_id"], name: "index_posts_on_parent_id"
|
||||
t.index ["uploaded_user_id"], name: "index_posts_on_uploaded_user_id"
|
||||
end
|
||||
|
||||
create_table "settings", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
|
||||
@@ -107,23 +107,23 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_27_214100) do
|
||||
create_table "wiki_pages", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
|
||||
t.string "title", null: false
|
||||
t.bigint "tag_id"
|
||||
t.bigint "created_by_id", null: false
|
||||
t.bigint "updated_by_id", null: false
|
||||
t.bigint "created_user_id", null: false
|
||||
t.bigint "updated_user_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["created_by_id"], name: "index_wiki_pages_on_created_by_id"
|
||||
t.index ["created_user_id"], name: "index_wiki_pages_on_created_user_id"
|
||||
t.index ["tag_id"], name: "index_wiki_pages_on_tag_id"
|
||||
t.index ["updated_by_id"], name: "index_wiki_pages_on_updated_by_id"
|
||||
t.index ["updated_user_id"], name: "index_wiki_pages_on_updated_user_id"
|
||||
end
|
||||
|
||||
add_foreign_key "nico_tag_relations", "tags"
|
||||
add_foreign_key "nico_tag_relations", "tags", column: "nico_tag_id"
|
||||
add_foreign_key "post_tags", "posts"
|
||||
add_foreign_key "post_tags", "tags"
|
||||
add_foreign_key "post_tags", "users", column: "created_by_id"
|
||||
add_foreign_key "post_tags", "users", column: "deleted_by_id"
|
||||
add_foreign_key "posts", "posts"
|
||||
add_foreign_key "posts", "users", column: "uploaded_by_id"
|
||||
add_foreign_key "post_tags", "users", column: "created_user_id"
|
||||
add_foreign_key "post_tags", "users", column: "deleted_user_id"
|
||||
add_foreign_key "posts", "posts", column: "parent_id"
|
||||
add_foreign_key "posts", "users", column: "uploaded_user_id"
|
||||
add_foreign_key "settings", "users"
|
||||
add_foreign_key "tag_aliases", "tags"
|
||||
add_foreign_key "user_ips", "ip_addresses"
|
||||
@@ -131,6 +131,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_27_214100) do
|
||||
add_foreign_key "user_post_views", "posts"
|
||||
add_foreign_key "user_post_views", "users"
|
||||
add_foreign_key "wiki_pages", "tags"
|
||||
add_foreign_key "wiki_pages", "users", column: "created_by_id"
|
||||
add_foreign_key "wiki_pages", "users", column: "updated_by_id"
|
||||
add_foreign_key "wiki_pages", "users", column: "created_user_id"
|
||||
add_foreign_key "wiki_pages", "users", column: "updated_user_id"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user