Merge remote-tracking branch 'origin/main' into feature/075

This commit is contained in:
2026-01-06 02:09:18 +09:00
15 changed files with 513 additions and 170 deletions
@@ -0,0 +1,5 @@
class RemoveTagFromWikiPages < ActiveRecord::Migration[7.0]
def change
remove_reference :wiki_pages, :tag, if_exists: true
end
end
@@ -0,0 +1,11 @@
class CreateWikiLines < ActiveRecord::Migration[7.0]
def change
create_table :wiki_lines do |t|
t.string :sha256, null: false, limit: 64
t.text :body, null: false
t.timestamps
end
add_index :wiki_lines, :sha256, unique: true
end
end
@@ -0,0 +1,19 @@
class CreateWikiRevisions < ActiveRecord::Migration[7.0]
def change
create_table :wiki_revisions do |t|
t.references :wiki_page, null: false, foreign_key: true
t.references :base_revision, foreign_key: { to_table: :wiki_revisions }
t.references :created_user, null: false, foreign_key: { to_table: :users }
t.integer :kind, null: false, default: 0 # 0: content, 1: redirect
t.references :redirect_page, foreign_key: { to_table: :wiki_pages }
t.string :message
t.integer :lines_count, null: false, default: 0
t.string :tree_sha256, limit: 64
t.timestamps
end
add_index :wiki_revisions, :tree_sha256
add_index :wiki_revisions, [:wiki_page_id, :id]
add_index :wiki_revisions, :kind
end
end
@@ -0,0 +1,12 @@
class CreateWikiRevisionLines < ActiveRecord::Migration[7.0]
def change
create_table :wiki_revision_lines do |t|
t.references :wiki_revision, null: false, foreign_key: true
t.integer :position, null: false
t.references :wiki_line, null: false, foreign_key: true
end
add_index :wiki_revision_lines, [:wiki_revision_id, :position], unique: true
add_index :wiki_revision_lines, [:wiki_revision_id, :wiki_line_id]
end
end