refactor: 移除 SQLite 支持,仅保留 MySQL

This commit is contained in:
2026-08-05 17:43:13 +08:00
parent 81e622fa09
commit 47720a8fcc
35 changed files with 111 additions and 1961 deletions

View File

@@ -78,8 +78,7 @@ export class AiConfigService implements AiConfigProbeContext {
const code = isErrWithCode ? (err as Record<string, unknown>).code : undefined;
const errno = isErrWithCode ? (err as Record<string, unknown>).errno : undefined;
// MySQL: ER_DUP_ENTRY (code 'ER_DUP_ENTRY') or errno 1062
// SQLite: SQLITE_CONSTRAINT (code 'SQLITE_CONSTRAINT')
if (code === 'ER_DUP_ENTRY' || errno === 1062 || code === 'SQLITE_CONSTRAINT') {
if (code === 'ER_DUP_ENTRY' || errno === 1062) {
const existing = await this.repo.findOne({ where: { singletonKey: SINGLETON_KEY } });
if (existing) return existing;
}