Skip to content

Commit

Permalink
Switched competition_id foreign key in microservice_registrations com…
Browse files Browse the repository at this point in the history
…p cascade (#10052)

* switched microservice_registrations comp key to cascade

* switched to on_delete: :cascade

* actually ran the migration oops
  • Loading branch information
dunkOnIT authored Oct 9, 2024
1 parent 79750fa commit bb11a2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

class AddCascadeToMicroserviceCompetitionId < ActiveRecord::Migration[7.2]
def change
remove_foreign_key :microservice_registrations, :Competitions
add_foreign_key :microservice_registrations, :Competitions, 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_09_30_132809) do
ActiveRecord::Schema[7.2].define(version: 2024_10_09_111904) 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 @@ -1318,7 +1318,7 @@

add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "microservice_registrations", "Competitions", column: "competition_id"
add_foreign_key "microservice_registrations", "Competitions", column: "competition_id", on_update: :cascade, on_delete: :cascade
add_foreign_key "microservice_registrations", "users"
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"
Expand Down

0 comments on commit bb11a2d

Please sign in to comment.