2
0
mirror of https://github.com/frappe/books.git synced 2025-01-12 11:04:12 +00:00

fix: Foreign key creation

This commit is contained in:
Faris Ansari 2019-12-12 20:23:24 +05:30
parent 4d616c075f
commit d1bbda829a

View File

@ -97,9 +97,9 @@ module.exports = class Database extends Observable {
}
// link
if (field.fieldtype === 'Link' && field.target && column.foreign) {
if (field.fieldtype === 'Link' && field.target) {
let meta = frappe.getMeta(field.target);
column
table
.foreign(field.fieldname)
.references('name')
.inTable(meta.getBaseDocType())