-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use nullify instead on cascade delete
- Loading branch information
syl-p
committed
Feb 16, 2024
1 parent
dd4eee9
commit fdfeaa8
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class AddOnCascadeDeleteOnComments < ActiveRecord::Migration[7.0] | ||
def change | ||
remove_foreign_key :comments, :users | ||
add_foreign_key :comments, :users, on_delete: :cascade | ||
add_foreign_key :comments, :users, on_delete: :nullify | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters