mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
it's now possible to mark relation as inheritable (previously this was hardcoded for specific relation names)
This commit is contained in:
@@ -8,7 +8,7 @@ const sql = require('../services/sql');
|
||||
class Relation extends Entity {
|
||||
static get tableName() { return "relations"; }
|
||||
static get primaryKeyName() { return "relationId"; }
|
||||
static get hashedProperties() { return ["relationId", "sourceNoteId", "name", "targetNoteId", "dateModified", "dateCreated"]; }
|
||||
static get hashedProperties() { return ["relationId", "sourceNoteId", "name", "targetNoteId", "isInheritable", "dateModified", "dateCreated"]; }
|
||||
|
||||
async getSourceNote() {
|
||||
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.sourceNoteId]);
|
||||
@@ -25,6 +25,10 @@ class Relation extends Entity {
|
||||
this.position = 1 + await sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM relations WHERE sourceNoteId = ?`, [this.sourceNoteId]);
|
||||
}
|
||||
|
||||
if (!this.isInheritable) {
|
||||
this.isInheritable = false;
|
||||
}
|
||||
|
||||
if (!this.isDeleted) {
|
||||
this.isDeleted = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user