表的外键约束错误
var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var row = document.createElement("tr"); var tdname = document.createElement('td'); var tddate = document.createElement('td'); var tdassigned = document.createElement('td'); for (var i in data) { console.log("Hello world!" + i); tdname.appendChild(document.createTextNode(data[i].name)); tddate.appendChild(document.createTextNode(data[i].date)); tdassigned.appendChild(document.createTextNode(data[i].assigned)); row.appendChild(tdname); row.appendChild(tddate); row.appendChild(tdassigned); } tblBody.appendChild(row); tbl.appendChild(tblBody); document.getElementById("tasklist").appendChild(tbl);
。blood_bank
:创建具有外键约束的表
blood_contact
。blood_bank
失败了在数据中找不到引用的表blood_contact
。blood_bank
'FOREIGN KEY(contact
)参考附近的字典contact_fk
(contact
)在更新级联上,外键(contact_id
) 参考blood_fk
(blood_group
)在更新CASCADE上)
这是表格结构:
blood_id