mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00

styling fix Added enum to promoted attribute definition parser Fix for the dropdown Added enumValues attr Added support for task note type Added support for swimlanes and swimlane dashboard Some minor fixes regarding swimlanes fixed a bug with ckeditor where pasting of links was not possible restructured folders folder-restructuring some more restructuring some folder restructuring fixes for file restructuring restored removed code Sorted the swimlane lists by priority sorting swimlanes and blinking based on priority Added new func for commenting on tasks fixed the workflow end to end fixed the workflow end to end Fixed the style for comments. Added the functionality for marking tasks as Done Added a file to track feature wish-list Added status back to the task header. Also added relevant tags to the node_tree. Fixed the status update on the note tree items. Also added deadline back Adding tags to the Swimlane dashboard Updating the dashboard view Fixed the tags on the swimlane dashboard items Fixed the hide/show for swimlane headers Updated the dashboard, added the collapse and expand feature. Also added deadline to the dashboard and tasks Prevented empty lines to be added as a comment. Also cleared task_deadline on a new task created Adding swimlane props Fixed the swimlane done/deprio, also added the subtasks for the tasks that have children fixed the grouping on swimlanes, added bucket type for the main parent of tasks, added swimlane options to dashboard type, fixed deadlines, updates to how swimlanes are populated Removed the db logs Updated fancytree lib to the latest version Updated gitignore Test adding an enum label type styling fix Added enum to promoted attribute definition parser Fix for the dropdown Added enumValues attr Added support for task note type Added support for swimlanes and swimlane dashboard Some minor fixes regarding swimlanes fixed a bug with ckeditor where pasting of links was not possible restructured folders folder-restructuring some more restructuring some folder restructuring fixes for file restructuring restored removed code Sorted the swimlane lists by priority sorting swimlanes and blinking based on priority Added new func for commenting on tasks fixed the workflow end to end fixed the workflow end to end Fixed the style for comments. Added the functionality for marking tasks as Done Added a file to track feature wish-list Added status back to the task header. Also added relevant tags to the node_tree. Fixed the status update on the note tree items. Also added deadline back Adding tags to the Swimlane dashboard Updating the dashboard view Fixed the tags on the swimlane dashboard items Fixed the hide/show for swimlane headers Updated the dashboard, added the collapse and expand feature. Also added deadline to the dashboard and tasks Prevented empty lines to be added as a comment. Also cleared task_deadline on a new task created Adding swimlane props Fixed the swimlane done/deprio, also added the subtasks for the tasks that have children all the updates as of Apr 24, 2024
63 lines
2.8 KiB
JavaScript
63 lines
2.8 KiB
JavaScript
module.exports = () => {
|
|
const sql = require("../../src/services/sql");
|
|
const utils = require("../../src/services/utils");
|
|
|
|
const existingBlobIds = new Set();
|
|
|
|
for (const noteId of sql.getColumn(`SELECT noteId FROM note_contents`)) {
|
|
const row = sql.getRow(`SELECT noteId, content, dateModified, utcDateModified FROM note_contents WHERE noteId = ?`, [noteId]);
|
|
const blobId = utils.hashedBlobId(row.content);
|
|
|
|
if (!existingBlobIds.has(blobId)) {
|
|
existingBlobIds.add(blobId);
|
|
|
|
sql.insert('blobs', {
|
|
blobId,
|
|
content: row.content,
|
|
dateModified: row.dateModified,
|
|
utcDateModified: row.utcDateModified
|
|
});
|
|
|
|
sql.execute("UPDATE entity_changes SET entityName = 'blobs', entityId = ? WHERE entityName = 'note_contents' AND entityId = ?", [blobId, row.noteId]);
|
|
} else {
|
|
// duplicates
|
|
sql.execute("DELETE FROM entity_changes WHERE entityName = 'note_contents' AND entityId = ?", [row.noteId]);
|
|
}
|
|
|
|
sql.execute('UPDATE notes SET blobId = ? WHERE noteId = ?', [blobId, row.noteId]);
|
|
}
|
|
|
|
for (const noteRevisionId of sql.getColumn(`SELECT noteRevisionId FROM note_revision_contents`)) {
|
|
const row = sql.getRow(`SELECT noteRevisionId, content, utcDateModified FROM note_revision_contents WHERE noteRevisionId = ?`, [noteRevisionId]);
|
|
const blobId = utils.hashedBlobId(row.content);
|
|
|
|
if (!existingBlobIds.has(blobId)) {
|
|
existingBlobIds.add(blobId);
|
|
|
|
sql.insert('blobs', {
|
|
blobId,
|
|
content: row.content,
|
|
dateModified: row.utcDateModified,
|
|
utcDateModified: row.utcDateModified
|
|
});
|
|
|
|
sql.execute("UPDATE entity_changes SET entityName = 'blobs', entityId = ? WHERE entityName = 'note_revision_contents' AND entityId = ?", [blobId, row.noteRevisionId]);
|
|
} else {
|
|
// duplicates
|
|
sql.execute("DELETE FROM entity_changes WHERE entityName = 'note_revision_contents' AND entityId = ?", [row.noteId]);
|
|
}
|
|
|
|
sql.execute('UPDATE note_revisions SET blobId = ? WHERE noteRevisionId = ?', [blobId, row.noteRevisionId]);
|
|
}
|
|
|
|
const notesWithoutBlobIds = sql.getColumn("SELECT noteId FROM notes WHERE blobId IS NULL");
|
|
if (notesWithoutBlobIds.length > 0) {
|
|
throw new Error("BlobIds were not filled correctly in notes: " + JSON.stringify(notesWithoutBlobIds));
|
|
}
|
|
|
|
const noteRevisionsWithoutBlobIds = sql.getColumn("SELECT noteRevisionId FROM note_revisions WHERE blobId IS NULL");
|
|
if (noteRevisionsWithoutBlobIds.length > 0) {
|
|
throw new Error("BlobIds were not filled correctly in note revisions: " + JSON.stringify(noteRevisionsWithoutBlobIds));
|
|
}
|
|
};
|