# typed: true
class AddForeignKeyConstraints < ActiveRecord::Migration[7.0]
  def change
    add_foreign_key :http_log_entries,
                    :blob_entries,
                    column: :response_sha256,
                    primary_key: :sha256,
                    validate: true
    add_foreign_key :http_log_entries,
                    :http_log_entry_headers,
                    column: :request_headers_id,
                    primary_key: :id,
                    validate: true
    add_foreign_key :http_log_entries,
                    :http_log_entry_headers,
                    column: :response_headers_id,
                    primary_key: :id,
                    validate: true
    add_foreign_key :blob_entries,
                    :blob_entries,
                    column: :base_sha256,
                    primary_key: :sha256,
                    validate: true
  end
end
