Refactor code structure for improved readability and maintainability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
co-authored by
Copilot
parent
983c8fd6aa
commit
4126b41064
@@ -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",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user