# typed: true
class CreateIndexedPosts < ActiveRecord::Migration[7.2]
  def change
    create_table :indexed_posts do |t|
      t.integer :postable_id, null: false
      t.string :postable_type, null: false
      t.timestamps
    end

    add_index :indexed_posts, %i[postable_id postable_type], unique: true
    add_index :indexed_posts, :created_at
  end
end
