refactor: 移除 SQLite 支持,仅保留 MySQL
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user