mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
drop isDeleted index
This commit is contained in:
parent
bf653a9a5c
commit
1b0bb22273
1
db/migrations/0178__drop_isDeleted_index.sql
Normal file
1
db/migrations/0178__drop_isDeleted_index.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
DROP INDEX IDX_notes_isDeleted;
|
145
db/schema.sql
145
db/schema.sql
@ -5,27 +5,7 @@ CREATE TABLE IF NOT EXISTS "api_tokens"
|
|||||||
utcDateCreated TEXT NOT NULL,
|
utcDateCreated TEXT NOT NULL,
|
||||||
isDeleted INT NOT NULL DEFAULT 0,
|
isDeleted INT NOT NULL DEFAULT 0,
|
||||||
hash TEXT DEFAULT "" NOT NULL);
|
hash TEXT DEFAULT "" NOT NULL);
|
||||||
CREATE TABLE IF NOT EXISTS "options"
|
|
||||||
(
|
|
||||||
name TEXT not null PRIMARY KEY,
|
|
||||||
value TEXT,
|
|
||||||
isSynced INTEGER default 0 not null,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT NOT NULL
|
|
||||||
);
|
|
||||||
CREATE TABLE recent_notes
|
|
||||||
(
|
|
||||||
noteId TEXT not null primary key,
|
|
||||||
notePath TEXT not null,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
isDeleted INT
|
|
||||||
);
|
|
||||||
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
|
||||||
`content` TEXT,
|
|
||||||
hash TEXT DEFAULT '' NOT NULL,
|
|
||||||
`utcDateModified` TEXT NOT NULL);
|
|
||||||
CREATE TABLE IF NOT EXISTS "branches" (
|
CREATE TABLE IF NOT EXISTS "branches" (
|
||||||
`branchId` TEXT NOT NULL,
|
`branchId` TEXT NOT NULL,
|
||||||
`noteId` TEXT NOT NULL,
|
`noteId` TEXT NOT NULL,
|
||||||
@ -37,36 +17,16 @@ CREATE TABLE IF NOT EXISTS "branches" (
|
|||||||
`deleteId` TEXT DEFAULT NULL,
|
`deleteId` TEXT DEFAULT NULL,
|
||||||
`utcDateModified` TEXT NOT NULL,
|
`utcDateModified` TEXT NOT NULL,
|
||||||
utcDateCreated TEXT NOT NULL,
|
utcDateCreated TEXT NOT NULL,
|
||||||
hash TEXT DEFAULT "" NOT NULL,
|
|
||||||
PRIMARY KEY(`branchId`));
|
PRIMARY KEY(`branchId`));
|
||||||
CREATE TABLE IF NOT EXISTS "attributes"
|
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
||||||
(
|
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
||||||
attributeId TEXT not null primary key,
|
|
||||||
noteId TEXT not null,
|
|
||||||
type TEXT not null,
|
|
||||||
name TEXT not null,
|
|
||||||
value TEXT default '' not null,
|
|
||||||
position INT default 0 not null,
|
|
||||||
utcDateCreated TEXT not null,
|
|
||||||
utcDateModified TEXT not null,
|
|
||||||
isDeleted INT not null,
|
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
|
||||||
hash TEXT default "" not null,
|
|
||||||
isInheritable int DEFAULT 0 NULL);
|
|
||||||
CREATE TABLE IF NOT EXISTS "entity_changes" (
|
|
||||||
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
||||||
`entityName` TEXT NOT NULL,
|
|
||||||
`entityId` TEXT NOT NULL,
|
|
||||||
`sourceId` TEXT NOT NULL,
|
|
||||||
`isSynced` INTEGER default 0 not null,
|
|
||||||
`utcChangedDate` TEXT NOT NULL);
|
|
||||||
CREATE TABLE IF NOT EXISTS "notes" (
|
CREATE TABLE IF NOT EXISTS "notes" (
|
||||||
`noteId` TEXT NOT NULL,
|
`noteId` TEXT NOT NULL,
|
||||||
`title` TEXT NOT NULL DEFAULT "note",
|
`title` TEXT NOT NULL DEFAULT "note",
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
`isProtected` INT NOT NULL DEFAULT 0,
|
||||||
`type` TEXT NOT NULL DEFAULT 'text',
|
`type` TEXT NOT NULL DEFAULT 'text',
|
||||||
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
`mime` TEXT NOT NULL DEFAULT 'text/html',
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`isDeleted` INT NOT NULL DEFAULT 0,
|
`isDeleted` INT NOT NULL DEFAULT 0,
|
||||||
`deleteId` TEXT DEFAULT NULL,
|
`deleteId` TEXT DEFAULT NULL,
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
`isErased` INT NOT NULL DEFAULT 0,
|
||||||
@ -75,8 +35,23 @@ CREATE TABLE IF NOT EXISTS "notes" (
|
|||||||
`utcDateCreated` TEXT NOT NULL,
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
`utcDateModified` TEXT NOT NULL,
|
`utcDateModified` TEXT NOT NULL,
|
||||||
PRIMARY KEY(`noteId`));
|
PRIMARY KEY(`noteId`));
|
||||||
|
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
||||||
|
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
||||||
|
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
||||||
|
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
||||||
|
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
||||||
|
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
||||||
|
CREATE TABLE IF NOT EXISTS "note_contents" (
|
||||||
|
`noteId` TEXT NOT NULL,
|
||||||
|
`content` TEXT NULL DEFAULT NULL,
|
||||||
|
`dateModified` TEXT NOT NULL,
|
||||||
|
`utcDateModified` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY(`noteId`)
|
||||||
|
);
|
||||||
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||||
`noteId` TEXT NOT NULL,
|
`noteId` TEXT NOT NULL,
|
||||||
|
type TEXT DEFAULT '' NOT NULL,
|
||||||
|
mime TEXT DEFAULT '' NOT NULL,
|
||||||
`title` TEXT,
|
`title` TEXT,
|
||||||
`isErased` INT NOT NULL DEFAULT 0,
|
`isErased` INT NOT NULL DEFAULT 0,
|
||||||
`isProtected` INT NOT NULL DEFAULT 0,
|
`isProtected` INT NOT NULL DEFAULT 0,
|
||||||
@ -84,42 +59,60 @@ CREATE TABLE IF NOT EXISTS "note_revisions" (`noteRevisionId` TEXT NOT NULL PRIM
|
|||||||
`utcDateCreated` TEXT NOT NULL,
|
`utcDateCreated` TEXT NOT NULL,
|
||||||
`utcDateModified` TEXT NOT NULL,
|
`utcDateModified` TEXT NOT NULL,
|
||||||
`dateLastEdited` TEXT NOT NULL,
|
`dateLastEdited` TEXT NOT NULL,
|
||||||
`dateCreated` TEXT NOT NULL,
|
`dateCreated` TEXT NOT NULL);
|
||||||
type TEXT DEFAULT '' NOT NULL,
|
|
||||||
mime TEXT DEFAULT '' NOT NULL,
|
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
||||||
hash TEXT DEFAULT '' NOT NULL);
|
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
||||||
CREATE TABLE IF NOT EXISTS "note_contents" (
|
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
||||||
`noteId` TEXT NOT NULL,
|
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
||||||
`content` TEXT NULL DEFAULT NULL,
|
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
||||||
`hash` TEXT DEFAULT "" NOT NULL,
|
|
||||||
`dateModified` TEXT NOT NULL,
|
CREATE TABLE IF NOT EXISTS "note_revision_contents" (`noteRevisionId` TEXT NOT NULL PRIMARY KEY,
|
||||||
`utcDateModified` TEXT NOT NULL,
|
`content` TEXT,
|
||||||
PRIMARY KEY(`noteId`)
|
`utcDateModified` TEXT NOT NULL);
|
||||||
|
CREATE TABLE IF NOT EXISTS "options"
|
||||||
|
(
|
||||||
|
name TEXT not null PRIMARY KEY,
|
||||||
|
value TEXT,
|
||||||
|
isSynced INTEGER default 0 not null,
|
||||||
|
utcDateCreated TEXT not null,
|
||||||
|
utcDateModified TEXT NOT NULL
|
||||||
);
|
);
|
||||||
CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (`noteId`,`parentNoteId`);
|
CREATE TABLE IF NOT EXISTS "recent_notes"
|
||||||
CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);
|
(
|
||||||
|
noteId TEXT not null primary key,
|
||||||
|
notePath TEXT not null,
|
||||||
|
utcDateCreated TEXT not null,
|
||||||
|
isDeleted INT NOT NULL DEFAULT 0
|
||||||
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS "entity_changes" (
|
||||||
|
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
|
`entityName` TEXT NOT NULL,
|
||||||
|
`entityId` TEXT NOT NULL,
|
||||||
|
`hash` TEXT NOT NULL,
|
||||||
|
`sourceId` TEXT NOT NULL,
|
||||||
|
`isErased` INT NOT NULL,
|
||||||
|
`utcDateChanged` TEXT NOT NULL,
|
||||||
|
`isSynced` INTEGER NOT NULL);
|
||||||
|
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
||||||
|
`entityName`,
|
||||||
|
`entityId`
|
||||||
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS "attributes"
|
||||||
|
(
|
||||||
|
attributeId TEXT not null primary key,
|
||||||
|
noteId TEXT not null,
|
||||||
|
type TEXT not null,
|
||||||
|
name TEXT not null,
|
||||||
|
value TEXT default '' not null,
|
||||||
|
position INT default 0 not null,
|
||||||
|
utcDateModified TEXT not null,
|
||||||
|
isDeleted INT not null,
|
||||||
|
`deleteId` TEXT DEFAULT NULL,
|
||||||
|
isInheritable int DEFAULT 0 NULL);
|
||||||
CREATE INDEX IDX_attributes_name_value
|
CREATE INDEX IDX_attributes_name_value
|
||||||
on attributes (name, value);
|
on attributes (name, value);
|
||||||
CREATE INDEX IDX_attributes_noteId_index
|
CREATE INDEX IDX_attributes_noteId_index
|
||||||
on attributes (noteId);
|
on attributes (noteId);
|
||||||
CREATE INDEX IDX_attributes_value_index
|
CREATE INDEX IDX_attributes_value_index
|
||||||
on attributes (value);
|
on attributes (value);
|
||||||
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
|
|
||||||
`entityName`,
|
|
||||||
`entityId`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_entityChanges_utcChangedDate` ON "entity_changes" (
|
|
||||||
`utcChangedDate`
|
|
||||||
);
|
|
||||||
CREATE INDEX `IDX_notes_isDeleted` ON `notes` (`isDeleted`);
|
|
||||||
CREATE INDEX `IDX_notes_title` ON `notes` (`title`);
|
|
||||||
CREATE INDEX `IDX_notes_type` ON `notes` (`type`);
|
|
||||||
CREATE INDEX `IDX_notes_dateCreated` ON `notes` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_notes_dateModified` ON `notes` (`dateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateModified` ON `notes` (`utcDateModified`);
|
|
||||||
CREATE INDEX `IDX_notes_utcDateCreated` ON `notes` (`utcDateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (`noteId`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);
|
|
||||||
CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);
|
|
||||||
|
@ -4,7 +4,7 @@ const build = require('./build');
|
|||||||
const packageJson = require('../../package');
|
const packageJson = require('../../package');
|
||||||
const {TRILIUM_DATA_DIR} = require('./data_dir');
|
const {TRILIUM_DATA_DIR} = require('./data_dir');
|
||||||
|
|
||||||
const APP_DB_VERSION = 177;
|
const APP_DB_VERSION = 178;
|
||||||
const SYNC_VERSION = 18;
|
const SYNC_VERSION = 18;
|
||||||
const CLIPPER_PROTOCOL_VERSION = "1.0";
|
const CLIPPER_PROTOCOL_VERSION = "1.0";
|
||||||
|
|
||||||
|
@ -16,11 +16,6 @@ class Attribute {
|
|||||||
this.name = row.name;
|
this.name = row.name;
|
||||||
/** @param {int} */
|
/** @param {int} */
|
||||||
this.position = row.position;
|
this.position = row.position;
|
||||||
|
|
||||||
if (typeof row.value !== 'string') {
|
|
||||||
row.value = JSON.stringify(row.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param {string} */
|
/** @param {string} */
|
||||||
this.value = row.value;
|
this.value = row.value;
|
||||||
/** @param {boolean} */
|
/** @param {boolean} */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user