Backend Development

[DJango] Foreign key constraint is incorrectly formed

yuwal6 2022. 7. 12. 18:34

DB Migrate 중에 위 에러가 발생했다.

외래키로 연결되는 각각의 테이블의 charset, collation이 달라서 생긴 문제로 해당 값을 통일해주면 해결된다.

ALTER TABLE your_table_name
DEFAULT CHARSET=your_table_char_set;