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
