wedding-planner/db/migrate/20250127190131_fix_cascading_wedding_deletion.rb
Manuel Bustillo a5d3062654
Some checks failed
Run unit tests / rubocop (pull_request) Successful in 48s
Run unit tests / check-licenses (pull_request) Successful in 55s
Run unit tests / copyright_notice (pull_request) Successful in 1m16s
Run unit tests / unit_tests (pull_request) Failing after 3m39s
Run unit tests / build-static-assets (pull_request) Has been skipped
Define and seed an invitation model
2025-01-27 20:08:28 +01:00

9 lines
296 B
Ruby

class FixCascadingWeddingDeletion < ActiveRecord::Migration[8.0]
def change
[:expenses, :groups, :guests, :seats, :tables_arrangements, :users].each do |table|
remove_foreign_key table, column: :wedding_id
add_foreign_key table, :weddings, on_delete: :cascade
end
end
end