Huakun Shen 5d5cbcdeb7
Refactor ORM commands and searchExtensionData function for improved readability and consistency
- Reformatted import statements for better organization.
- Cleaned up whitespace and indentation in searchExtensionData function.
- Enhanced readability of SQL conditions and query building logic.
- Disabled eslint for explicit any usage in the troubleshooters page.
2025-03-26 12:10:35 -04:00
..
2025-03-21 05:28:19 -04:00
2025-03-21 05:28:19 -04:00

drizzle

  • Only use pull to generate the schema from existing database.
  • Don't migrate or push.
export DB_FILE_NAME="~/Library/Application Support/sh.kunkun.desktop/kk.dev.sqlite"
bunx drizzle-kit pull

We are using sqlite with fts5, which drizzle doesn't support yet, so pushing the schema will destroy the existing schema.

We only use pulled schema to generate sql queries.

Update Schema

After drizzle-kit pull the schema may have problem with JSON type and boolean type.

Will need to manually update the following

JSON

+ data: text({ mode: "json" }).notNull(),
+ metadata: text({ mode: "json" }),
- data: numeric().notNull(),
- metadata: numeric(),

Boolean

+ enabled: integer({ mode: "boolean" }),
- enabled: numeric().default(sql`(TRUE)`),