Add schema utils

This commit is contained in:
Jamie Kyle 2024-10-02 12:03:10 -07:00 committed by GitHub
parent c8a729f8be
commit b26466e59d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 674 additions and 151 deletions

View file

@ -22,6 +22,7 @@ import { getCallIdFromEra } from '../../util/callDisposition';
import { isValidUuid } from '../../util/isValidUuid';
import { createDB, updateToVersion } from './helpers';
import type { WritableDB, MessageType } from '../../sql/Interface';
import { parsePartial } from '../../util/schemas';
describe('SQL/updateToSchemaVersion89', () => {
let db: WritableDB;
@ -152,8 +153,8 @@ describe('SQL/updateToSchemaVersion89', () => {
return db
.prepare(selectHistoryQuery)
.all()
.map(row => {
return callHistoryDetailsSchema.parse({
.map((row: object) => {
return parsePartial(callHistoryDetailsSchema, {
...row,
// Not present at the time of migration, but required by zod