diff --git a/packages/lib/JoplinDatabase.ts b/packages/lib/JoplinDatabase.ts index 8a400a54f..2a92f4317 100644 --- a/packages/lib/JoplinDatabase.ts +++ b/packages/lib/JoplinDatabase.ts @@ -127,6 +127,7 @@ INSERT INTO version (version) VALUES (1); const migrations: Migration[] = [ migration42, migration43, + // migration44, ]; export interface TableField { diff --git a/packages/lib/models/NoteResource.ts b/packages/lib/models/NoteResource.ts index 92767c76b..8ec2c3720 100644 --- a/packages/lib/models/NoteResource.ts +++ b/packages/lib/models/NoteResource.ts @@ -1,5 +1,5 @@ import BaseModel from '../BaseModel'; -import { SqlQuery } from '../database'; +import { SqlQuery } from '../services/database/types'; import BaseItem from './BaseItem'; // - If is_associated = 1, note_resources indicates which note_id is currently associated with the given resource_id diff --git a/packages/lib/models/Resource.ts b/packages/lib/models/Resource.ts index 6119ba255..d8844dabf 100644 --- a/packages/lib/models/Resource.ts +++ b/packages/lib/models/Resource.ts @@ -442,4 +442,10 @@ export default class Resource extends BaseItem { }, { changeSource: ItemChange.SOURCE_SYNC }); } + // public static async save(o: ResourceEntity, options: SaveOptions = null): Promise { + // const resource:ResourceEntity = await super.save(o, options); + // if (resource.updated_time) resource.bl + // return resource; + // } + } diff --git a/packages/lib/models/utils/types.ts b/packages/lib/models/utils/types.ts index eac98bd9b..2dc32688a 100644 --- a/packages/lib/models/utils/types.ts +++ b/packages/lib/models/utils/types.ts @@ -1,4 +1,4 @@ -import { SqlQuery } from '../../database'; +import { SqlQuery } from '../../services/database/types'; export enum PaginationOrderDir { ASC = 'ASC', diff --git a/packages/lib/services/database/types.ts b/packages/lib/services/database/types.ts index d7575b659..663d32dd4 100644 --- a/packages/lib/services/database/types.ts +++ b/packages/lib/services/database/types.ts @@ -150,6 +150,7 @@ export interface FolderEntity { 'title'?: string; 'updated_time'?: number; 'user_created_time'?: number; + 'user_data'?: string; 'user_updated_time'?: number; 'type_'?: number; } @@ -270,6 +271,7 @@ export interface ResourceEntity { 'title'?: string; 'updated_time'?: number; 'user_created_time'?: number; + 'user_data'?: string; 'user_updated_time'?: number; 'type_'?: number; } @@ -330,6 +332,7 @@ export interface TagEntity { 'title'?: string; 'updated_time'?: number; 'user_created_time'?: number; + 'user_data'?: string; 'user_updated_time'?: number; 'type_'?: number; } @@ -363,6 +366,7 @@ export const databaseSchema: DatabaseTables = { title: { type: 'string' }, updated_time: { type: 'number' }, user_created_time: { type: 'number' }, + user_data: { type: 'string' }, user_updated_time: { type: 'number' }, type_: { type: 'number' }, }, @@ -376,6 +380,7 @@ export const databaseSchema: DatabaseTables = { title: { type: 'string' }, updated_time: { type: 'number' }, user_created_time: { type: 'number' }, + user_data: { type: 'string' }, user_updated_time: { type: 'number' }, type_: { type: 'number' }, }, @@ -477,6 +482,7 @@ export const databaseSchema: DatabaseTables = { title: { type: 'string' }, updated_time: { type: 'number' }, user_created_time: { type: 'number' }, + user_data: { type: 'string' }, user_updated_time: { type: 'number' }, type_: { type: 'number' }, }, diff --git a/packages/lib/services/plugins/api/noteListType.ts b/packages/lib/services/plugins/api/noteListType.ts index 0f9cbb577..112999c9a 100644 --- a/packages/lib/services/plugins/api/noteListType.ts +++ b/packages/lib/services/plugins/api/noteListType.ts @@ -3,7 +3,7 @@ import { Size } from './types'; // AUTO-GENERATED by generate-database-type -type ListRendererDatabaseDependency = 'folder.created_time' | 'folder.encryption_applied' | 'folder.encryption_cipher_text' | 'folder.icon' | 'folder.id' | 'folder.is_shared' | 'folder.master_key_id' | 'folder.parent_id' | 'folder.share_id' | 'folder.title' | 'folder.updated_time' | 'folder.user_created_time' | 'folder.user_updated_time' | 'folder.type_' | 'note.altitude' | 'note.application_data' | 'note.author' | 'note.body' | 'note.conflict_original_id' | 'note.created_time' | 'note.encryption_applied' | 'note.encryption_cipher_text' | 'note.id' | 'note.is_conflict' | 'note.is_shared' | 'note.is_todo' | 'note.latitude' | 'note.longitude' | 'note.markup_language' | 'note.master_key_id' | 'note.order' | 'note.parent_id' | 'note.share_id' | 'note.source' | 'note.source_application' | 'note.source_url' | 'note.title' | 'note.todo_completed' | 'note.todo_due' | 'note.updated_time' | 'note.user_created_time' | 'note.user_data' | 'note.user_updated_time' | 'note.type_'; +type ListRendererDatabaseDependency = 'folder.created_time' | 'folder.encryption_applied' | 'folder.encryption_cipher_text' | 'folder.icon' | 'folder.id' | 'folder.is_shared' | 'folder.master_key_id' | 'folder.parent_id' | 'folder.share_id' | 'folder.title' | 'folder.updated_time' | 'folder.user_created_time' | 'folder.user_data' | 'folder.user_updated_time' | 'folder.type_' | 'note.altitude' | 'note.application_data' | 'note.author' | 'note.body' | 'note.conflict_original_id' | 'note.created_time' | 'note.encryption_applied' | 'note.encryption_cipher_text' | 'note.id' | 'note.is_conflict' | 'note.is_shared' | 'note.is_todo' | 'note.latitude' | 'note.longitude' | 'note.markup_language' | 'note.master_key_id' | 'note.order' | 'note.parent_id' | 'note.share_id' | 'note.source' | 'note.source_application' | 'note.source_url' | 'note.title' | 'note.todo_completed' | 'note.todo_due' | 'note.updated_time' | 'note.user_created_time' | 'note.user_data' | 'note.user_updated_time' | 'note.type_'; // AUTO-GENERATED by generate-database-type export enum ItemFlow { diff --git a/packages/lib/services/synchronizer/tools.ts b/packages/lib/services/synchronizer/tools.ts index 339b555b4..942276605 100644 --- a/packages/lib/services/synchronizer/tools.ts +++ b/packages/lib/services/synchronizer/tools.ts @@ -1,8 +1,8 @@ -import { SqlQuery } from '../../database'; import JoplinDatabase from '../../JoplinDatabase'; import BaseItem from '../../models/BaseItem'; import Setting from '../../models/Setting'; import SyncTargetRegistry from '../../SyncTargetRegistry'; +import { SqlQuery } from '../database/types'; async function clearSyncContext() { const syncTargetIds = SyncTargetRegistry.allIds();