然后用命令行 alter table 表名 add foreign key(字段名) references 要关联的表名(要关联的字段名) 回复: 对于有主外键关系的情况,创建数据的顺序是先在主表中添加数据,然后在其它表...
基于10个网页-相关网页
Run rake db:migrate to create the SUBSCRIPTIONS table and add foreign key columns to SUBJECTS.
运行 rake db:migrate 以创建 SUBSCRIPTIONS 表并将外键列添加到 SUBJECTS 中。
You also need to add a foreign key 'user_id' to the DOCUMENTS table so you know the user who uploaded a particular document.
另外还需要添加一个外键' user_id '到documents表中,以便知道哪个用户上传某个特定的文档。
In this section, the file containing the generated DDLs is further edited to add the required foreign key statements. This is in order to define the tables relationships.
在本节中,我们将进一步编辑包含生成的DDL的文件,以添加所需的外键语句,从而定义表关系。
应用推荐