diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-25 23:02:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-25 23:02:35 +0900 |
| commit | 38b8fc0e9927c4146b4c8b309b2bcc644abd63d0 (patch) | |
| tree | f76ba23251645e552fccd201362064b06de50bdd /src/client/db/index.ts | |
| parent | 7a77e72bb49ed3990a0c4581292a37a8a4f35231 (diff) | |
| download | kioku-38b8fc0e9927c4146b4c8b309b2bcc644abd63d0.tar.gz kioku-38b8fc0e9927c4146b4c8b309b2bcc644abd63d0.tar.zst kioku-38b8fc0e9927c4146b4c8b309b2bcc644abd63d0.zip | |
Allow each deck to specify a default note type that is auto-selected
when creating new notes. Includes DB schema migration, server API
updates, sync layer support, and UI for editing the default in the
deck settings modal.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/client/db/index.ts')
| -rw-r--r-- | src/client/db/index.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/db/index.ts b/src/client/db/index.ts index 50d8bbd..a3fbd49 100644 --- a/src/client/db/index.ts +++ b/src/client/db/index.ts @@ -77,6 +77,7 @@ export interface LocalDeck { userId: string; name: string; description: string | null; + defaultNoteTypeId: string | null; createdAt: Date; updatedAt: Date; deletedAt: Date | null; @@ -251,6 +252,17 @@ export class KiokuDatabase extends Dexie { notes: "id, deckId, noteTypeId, updatedAt", noteFieldValues: "id, noteId, noteFieldTypeId, updatedAt", }); + + // Version 4: Add defaultNoteTypeId to decks (no index change needed) + this.version(4).stores({ + decks: "id, userId, updatedAt", + cards: "id, deckId, noteId, updatedAt, due, state", + reviewLogs: "id, cardId, userId, reviewedAt", + noteTypes: "id, userId, updatedAt", + noteFieldTypes: "id, noteTypeId, updatedAt", + notes: "id, deckId, noteTypeId, updatedAt", + noteFieldValues: "id, noteId, noteFieldTypeId, updatedAt", + }); } } |
