Skip to content

Commit

Permalink
Make crr lookup foreign key cascade on delete (#10164)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorbg authored Oct 31, 2024
1 parent 95df812 commit 3ca0c3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions db/migrate/20241031120315_crr_foreign_key_cascade.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

class CrrForeignKeyCascade < ActiveRecord::Migration[7.2]
def change
remove_foreign_key :regional_records_lookup, :Results
add_foreign_key :regional_records_lookup, :Results, column: :resultId, on_update: :cascade, on_delete: :cascade
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_10_25_161404) do
ActiveRecord::Schema[7.2].define(version: 2024_10_31_120315) do
create_table "Competitions", id: { type: :string, limit: 32, default: "" }, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", limit: 50, default: "", null: false
t.string "cityName", limit: 50, default: "", null: false
Expand Down Expand Up @@ -1350,7 +1350,7 @@
add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", on_delete: :cascade
add_foreign_key "payment_intents", "users", column: "initiated_by_id"
add_foreign_key "paypal_records", "paypal_records", column: "parent_record_id"
add_foreign_key "regional_records_lookup", "Results", column: "resultId"
add_foreign_key "regional_records_lookup", "Results", column: "resultId", on_update: :cascade, on_delete: :cascade
add_foreign_key "registration_history_changes", "registration_history_entries"
add_foreign_key "sanity_check_exclusions", "sanity_checks"
add_foreign_key "sanity_checks", "sanity_check_categories"
Expand Down

0 comments on commit 3ca0c3c

Please sign in to comment.