2
0
mirror of https://github.com/frappe/books.git synced 2025-01-13 03:11:30 +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 // link
if (field.fieldtype === 'Link' && field.target && column.foreign) { if (field.fieldtype === 'Link' && field.target) {
let meta = frappe.getMeta(field.target); let meta = frappe.getMeta(field.target);
column table
.foreign(field.fieldname) .foreign(field.fieldname)
.references('name') .references('name')
.inTable(meta.getBaseDocType()) .inTable(meta.getBaseDocType())