Refactor code structure for improved readability and maintainability

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Poyraz Avsever
2026-05-07 09:50:01 +03:00
co-authored by Copilot
parent 983c8fd6aa
commit 4126b41064
7 changed files with 379 additions and 1 deletions
+10 -1
View File
@@ -24,18 +24,27 @@ export interface Task {
created_at: string;
}
export interface ChatMessage {
id: string;
role: "user" | "assistant";
content: string;
created_at: string;
}
export class MindSpaceDB extends Dexie {
journals!: Table<Journal>;
tasks!: Table<Task>;
chat_messages!: Table<ChatMessage>;
constructor() {
super("MindSpaceDatabase");
// Schema tanımlamaları.
// IndexedDB'de sadece indekslenecek (üzerinde arama/sıralama yapılacak) alanları belirtiriz.
this.version(1).stores({
this.version(2).stores({
journals: "id, date, mood",
tasks: "id, status, date, journal_id",
chat_messages: "id, created_at",
});
}
}