# typed: true
class CreateDomainFaFavs < ActiveRecord::Migration[7.0]
  def change
    # pk removed in 20241220174922_remove_pk_from_domain_fa_favs.rb
    create_table :domain_fa_favs do |t|
      t.references :user, null: false
      t.references :post, null: false
    end

    add_column :domain_fa_users, :scanned_favs_at, :datetime
    add_foreign_key :domain_fa_favs, :domain_fa_users, column: :user_id
    add_foreign_key :domain_fa_favs, :domain_fa_posts, column: :post_id
  end
end
