mirror of
https://github.com/frappe/books.git
synced 2024-12-25 20:11:15 +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);
|
columns.push(def);
|
||||||
|
|
||||||
if (field.fieldtype === 'Link' && field.target) {
|
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