Python full stack (ten) Django framework 8. Foreign key constraints and query operations

One, foreign key constraints

1. Introduction and creation of foreign key relationships

In MySQL, there are two common storage engines for tables , namely InnoDB and MyISAM .
Among them, the InnoDB engine supports foreign key constraints , but MyISAM does not support foreign keys. Therefore, before implementing foreign key constraints, you need to confirm that the storage engine of the table in the current database is InnoDB. You can view the storage engine by viewing the table structure, as follows:

Guess you like

Origin blog.csdn.net/CUFEECR/article/details/108681099