cherry-studio/migrations
fullex 3dfd5c7c2b feat: add custom SQL handling for triggers and virtual tables
- Introduced a new method `runCustomMigrations` in `DbService` to execute custom SQL statements that Drizzle cannot manage, such as triggers and virtual tables.
- Updated `database-patterns.md` and `README.md` to document the handling of custom SQL and its importance in maintaining database integrity during migrations.
- Refactored `messageFts.ts` to define FTS5 virtual table and associated triggers as idempotent SQL statements for better migration management.
2026-01-04 01:07:04 +08:00
..
sqlite-drizzle feat: add custom SQL handling for triggers and virtual tables 2026-01-04 01:07:04 +08:00
README.md feat(database): message.stats and related message type definitions 2025-12-25 21:52:07 +08:00
sqlite-drizzle.config.ts mv dir to data 2025-08-09 14:30:24 +08:00

THIS DIRECTORY IS NOT FOR RUNTIME USE

v2 Data Refactoring Notice Before the official release of the alpha version, the database structure may change at any time. To maintain simplicity, the database migration files will be periodically reinitialized, which may cause the application to fail. If this occurs, please delete the cherrystudio.sqlite file located in the user data directory.

  • Using libsql as the sqlite3 driver, and drizzle as the ORM and database migration tool
  • Table schemas are defined in src\main\data\db\schemas
  • migrations/sqlite-drizzle contains auto-generated migration data. Please DO NOT modify it.
  • If table structure changes, we should run migrations.
  • To generate migrations, use the command yarn run db:migrations:generate