Commit Graph

5 Commits

Author SHA1 Message Date
fullex
4fcf047fa9 refactor(database): update message and topic table structures
- Modified the `message` table to include `siblings_group_id` and `stats`, while removing `usage` and `metrics`.
- Renamed `response_group_id` to `siblings_group_id` for clarity.
- Enhanced the `topic` table by adding `active_node_id` and ensuring `sort_order` and `is_name_manually_edited` are defined correctly.
- Updated the database schema to reflect these changes and removed obsolete migration files.
2026-01-01 21:18:28 +08:00
fullex
1b9d8fe24a feat(database): add user data schemas for topic, message, group, and tag
- Add topicTable schema with group organization and pinning support
  - Add messageTable schema with tree structure (adjacency list pattern)
  - Add groupTable schema for organizing entities by type
  - Add tagTable and entityTagTable schemas for tagging system
  - Add FTS5 full-text search support for message content
  - Update preferenceTable to use composite primary key (scope, key)
  - Regenerate initial migration with all tables

  Changes Summary

  | Type        | Files                                                               |
  |-------------|---------------------------------------------------------------------|
  | New schemas | topic.ts, message.ts, group.ts, tag.ts, entityTag.ts, messageFts.ts |
  | Modified    | preference.ts (index → composite PK)                                |
  | Migration   | Renamed 0000_solid_lord_hawal.sql → 0000_init.sql with all tables   |

  This is part of the data refactoring project - adding core user data table schemas.
2025-12-24 23:19:25 +08:00
fullex
d321cd23ef chore: format 2025-09-06 18:32:33 +08:00
fullex
92eb5aed7f refactor(migration): rename data migration files and update migration logic
This commit renames the data migration files for clarity, changing `dataMigrate.html` to `dataRefactorMigrate.html` and updating the corresponding service imports. It also enhances the migration logic by implementing a new `app_state` table structure and removing deprecated migration files, streamlining the overall migration process.
2025-08-09 22:37:20 +08:00
fullex
9105e0f5c1 db init 2025-05-26 08:30:22 +08:00