mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 23:22:05 +08:00
format
This commit is contained in:
parent
aa47fc3ed7
commit
c0efb46c2b
@ -1,13 +1,15 @@
|
|||||||
|
import { loggerService } from '@logger'
|
||||||
import { drizzle } from 'drizzle-orm/libsql'
|
import { drizzle } from 'drizzle-orm/libsql'
|
||||||
import { migrate } from 'drizzle-orm/libsql/migrator'
|
import { migrate } from 'drizzle-orm/libsql/migrator'
|
||||||
import { app } from 'electron'
|
import { app } from 'electron'
|
||||||
import Logger from 'electron-log'
|
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { pathToFileURL } from 'url'
|
import { pathToFileURL } from 'url'
|
||||||
|
|
||||||
import Seeding from './seeding'
|
import Seeding from './seeding'
|
||||||
import type { DbType } from './types'
|
import type { DbType } from './types'
|
||||||
|
|
||||||
|
const logger = loggerService.withContext('DbService')
|
||||||
|
|
||||||
const DB_NAME = 'cherrystudio.sqlite'
|
const DB_NAME = 'cherrystudio.sqlite'
|
||||||
const MIGRATIONS_BASE_PATH = 'migrations/sqlite-drizzle'
|
const MIGRATIONS_BASE_PATH = 'migrations/sqlite-drizzle'
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ class DbService {
|
|||||||
await new Seed().migrate(this.db)
|
await new Seed().migrate(this.db)
|
||||||
return true
|
return true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error)
|
logger.error('migration seeding failed', error as Error)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
* All the database table names use **singular** form, snake_casing
|
- All the database table names use **singular** form, snake_casing
|
||||||
* Export table names use `xxxxTable`
|
- Export table names use `xxxxTable`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user