mirror of
https://github.com/frappe/books.git
synced 2024-11-13 00:46:28 +00:00
fix: Base doctype in column definition
This commit is contained in:
parent
bf4b6c6f6b
commit
6c6a49f89a
@ -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`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user