如何更改外鍵引用動作? (行爲) - How to change the foreign key referential action? (behavior)

問題:

I have set up a table that contains a column with a foreign key, set to ON DELETE CASCADE (delete child when parent is deleted) 我已經建立了一個表,其中包含帶有外鍵的列,並將其設置爲ON DELETE CASCADE (當刪除父級時刪除子級)

What would the SQL command be to change this to ON DELETE RESTRICT ? 將它更改爲ON DELETE RESTRICT的SQL命令是什麼? (can't delete parent if it has children) (如果有孩子,則不能刪除其父母)


解決方案:

參考: https://stackoom.com/en/question/E5uj
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章