mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-03 12:27:41 +08:00
The previous glob `./src/main/data/db/schemas/*` matched the `__tests__` directory, and drizzle-kit's `prepareFilenames` expands any matched directory by reading its immediate files regardless of extension. That pulled `_columnHelpers.test.ts` into the schema load path, and its `import ... from 'vitest'` blew up because drizzle-kit loads schemas via CJS `require()` (vitest is ESM-only). Switch to a recursive pattern that also excludes `*.test.ts` by name, so the config tolerates future subdirectory-organised schemas without re-introducing the same class of bug.
9 lines
300 B
TypeScript
9 lines
300 B
TypeScript
import { defineConfig } from 'drizzle-kit'
|
|
export default defineConfig({
|
|
out: './migrations/sqlite-drizzle',
|
|
// Recursive + exclude *.test.ts so drizzle-kit never loads vitest-dependent files.
|
|
schema: './src/main/data/db/schemas/**/!(*.test).ts',
|
|
dialect: 'sqlite',
|
|
casing: 'snake_case'
|
|
})
|