feat: Wiki の管理方法変更(#188) (#195)
Merge branch 'feature/188' of https://git.miteruzo.com/miteruzo/btrc-hub into feature/188 #188 Merge branch 'main' into feature/188 #188 #188 #188 #188 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #195
This commit was merged in pull request #195.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user