# typed: true
class AddFksToInkbunnyTable < ActiveRecord::Migration[7.2]
  def change
    add_foreign_key :domain_inkbunny_posts,
                    :domain_inkbunny_users,
                    column: :creator_id,
                    validate: true
    add_foreign_key :domain_inkbunny_files,
                    :domain_inkbunny_posts,
                    column: :post_id,
                    validate: true
    add_foreign_key :domain_inkbunny_favs,
                    :domain_inkbunny_users,
                    column: :user_id,
                    validate: true
    add_foreign_key :domain_inkbunny_favs,
                    :domain_inkbunny_posts,
                    column: :post_id,
                    validate: true
    add_foreign_key :domain_inkbunny_files,
                    :http_log_entries,
                    column: :log_entry_id,
                    validate: true
    add_foreign_key :domain_inkbunny_follows,
                    :domain_inkbunny_users,
                    column: :follower_id,
                    validate: true
    add_foreign_key :domain_inkbunny_follows,
                    :domain_inkbunny_users,
                    column: :followed_id,
                    validate: true
    add_foreign_key :domain_inkbunny_pool_joins,
                    :domain_inkbunny_posts,
                    column: :post_id,
                    validate: true
    add_foreign_key :domain_inkbunny_pool_joins,
                    :domain_inkbunny_pools,
                    column: :pool_id,
                    validate: true
  end
end
