refactor: 移除 SQLite 支持,仅保留 MySQL
This commit is contained in:
@@ -244,8 +244,8 @@ export class AttendanceLessonService {
|
||||
} catch (err: unknown) {
|
||||
const code = (err as Record<string, unknown>).code;
|
||||
const errno = (err as Record<string, unknown>).errno;
|
||||
// MySQL: ER_DUP_ENTRY or errno 1062; SQLite: SQLITE_CONSTRAINT
|
||||
if (code === 'ER_DUP_ENTRY' || errno === 1062 || code === 'SQLITE_CONSTRAINT') {
|
||||
// MySQL: ER_DUP_ENTRY or errno 1062
|
||||
if (code === 'ER_DUP_ENTRY' || errno === 1062) {
|
||||
const existing = await sessionRepo.findOne({
|
||||
where: { scheduleId, lessonDate },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user