# typed: true
class RemovePkFromDomainFaFavs < ActiveRecord::Migration[7.0]
  def up
    add_index :domain_fa_favs, %i[user_id post_id], unique: true
    remove_column :domain_fa_favs, :id, :bigint, before: :user_id
  end

  def down
    add_column :domain_fa_favs, :id, :bigint, primary_key: true, first: true
    add_index :domain_fa_favs, :id
    remove_index :domain_fa_favs, %i[user_id post_id]
  end
end
