teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

加筆修正

2019/09/16 12:08

投稿

退会済みユーザー
answer CHANGED
@@ -2,4 +2,12 @@
2
2
 
3
3
  参考:
4
4
  [外部キー制約について - Qiita](https://qiita.com/SLEAZOIDS/items/d6fb9c2d131c3fdd1387)
5
- [[MySQL] Cannot add foreign key constraint で怒られた | たきもと.com](https://kengotakimoto.com/)
5
+ [[MySQL] Cannot add foreign key constraint で怒られた | たきもと.com](https://kengotakimoto.com/)
6
+
7
+ ---
8
+
9
+ `show create table ~`して、
10
+ FOREIGN KEYって書いていないから、
11
+ そもそも外部キーじゃない、ってオチじゃないよね?
12
+ 「CONSTRAINT `articles_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE CASCADE,」
13
+ とかなっていれば、このテーブルは外部キーを使ってるなってわかるけど。