2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 12:10:06 +00:00

fix: Base doctype in column definition

This commit is contained in:
Faris Ansari 2019-10-19 20:03:08 +05:30
parent bf4b6c6f6b
commit 6c6a49f89a

View File

@ -74,7 +74,8 @@ module.exports = class sqliteDatabase extends Database {
columns.push(def);
if (field.fieldtype === 'Link' && field.target) {
indexes.push(`FOREIGN KEY (${field.fieldname}) REFERENCES ${field.target} ON UPDATE CASCADE ON DELETE RESTRICT`);
let meta = frappe.getMeta(field.target);
indexes.push(`FOREIGN KEY (${field.fieldname}) REFERENCES ${meta.getBaseDocType()} ON UPDATE CASCADE ON DELETE RESTRICT`);
}
}