Further improvements for backup import/export

This commit is contained in:
Fedor Indutny 2024-09-18 22:26:52 -07:00 committed by GitHub
parent b9cd858ec7
commit d5f44c1b8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 539 additions and 201 deletions

View file

@ -20,7 +20,8 @@ describe('SQL/updateToSchemaVersion1100', () => {
beforeEach(() => {
db = createDB();
// index updated in 1170
updateToVersion(db, 1170);
// columns updated in 1210
updateToVersion(db, 1210);
});
afterEach(() => {

View file

@ -153,7 +153,13 @@ describe('SQL/updateToSchemaVersion89', () => {
.prepare(selectHistoryQuery)
.all()
.map(row => {
return callHistoryDetailsSchema.parse(row);
return callHistoryDetailsSchema.parse({
...row,
// Not present at the time of migration, but required by zod
startedById: null,
endedTimestamp: null,
});
});
}
@ -451,6 +457,10 @@ describe('SQL/updateToSchemaVersion89', () => {
direction: CallDirection.Incoming,
status: DirectCallStatus.Accepted,
timestamp: Date.now(),
// Not present at the time of migration
startedById: null,
endedTimestamp: null,
});
insertCallHistory({
callId: 'abc',
@ -461,6 +471,10 @@ describe('SQL/updateToSchemaVersion89', () => {
direction: CallDirection.Incoming,
status: GroupCallStatus.Accepted,
timestamp: Date.now(),
// Not present at the time of migration
startedById: null,
endedTimestamp: null,
});
updateToVersion(db, 89);
@ -487,6 +501,10 @@ describe('SQL/updateToSchemaVersion89', () => {
direction: CallDirection.Incoming,
status: DirectCallStatus.Pending,
timestamp: Date.now() - 1000,
// Not present at the time of migration
startedById: null,
endedTimestamp: null,
});
createCallHistoryMessage({