Skip to content

Commit

Permalink
feat: use nullify instead on cascade delete
Browse files Browse the repository at this point in the history
  • Loading branch information
syl-p committed Feb 16, 2024
1 parent dd4eee9 commit fdfeaa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
add_foreign_key "answers", "pias"
add_foreign_key "attachments", "pias"
add_foreign_key "comments", "pias"
add_foreign_key "comments", "users", on_delete: :cascade
add_foreign_key "comments", "users", on_delete: :nullify
add_foreign_key "evaluations", "pias"
add_foreign_key "knowledges", "knowledge_bases"
add_foreign_key "measures", "pias"
Expand Down

0 comments on commit fdfeaa8

Please sign in to comment.