Skip to content

Instantly share code, notes, and snippets.

@y2468101216
Created November 28, 2017 12:12
Show Gist options
  • Save y2468101216/2a953a4a549995813a9c889a202d4de9 to your computer and use it in GitHub Desktop.
Save y2468101216/2a953a4a549995813a9c889a202d4de9 to your computer and use it in GitHub Desktop.

Should We Use Foreign Key

正面

  1. 不會有孤兒資料
  2. 確保對資料庫操作時有基本的防護
  3. 產生資料庫結構圖會更加一目了然

負面

  1. insert update delete 的成本會更大
  2. ORM 可部份取代他的功能。
@gy0857478
Copy link

工作上其實不太常用到,可能我太菜XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment