mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
18 lines
526 B
JavaScript
18 lines
526 B
JavaScript
![]() |
"use strict";
|
||
|
|
||
|
const Entity = require('./entity');
|
||
|
|
||
|
class Branch extends Entity {
|
||
|
static get tableName() { return "branches"; }
|
||
|
static get primaryKeyName() { return "branchId"; }
|
||
|
|
||
|
async getNote() {
|
||
|
return this.repository.getEntity("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
|
||
|
}
|
||
|
|
||
|
async getParentNote() {
|
||
|
return this.repository.getEntity("SELECT * FROM branches WHERE isDeleted = 0 AND parentNoteId = ?", [this.parentNoteId]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = Branch;
|