Files
redux-scraper/db/migrate/20230207204901_add_foreign_key_constraints.rb
2025-01-01 03:29:53 +00:00

26 lines
898 B
Ruby

# 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