mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 18:38:15 +01:00
Initial donationReceipts data types
This commit is contained in:
35
ts/sql/migrations/1380-donation-receipts.ts
Normal file
35
ts/sql/migrations/1380-donation-receipts.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
import type { WritableDB } from '../Interface';
|
||||
|
||||
export const version = 1380;
|
||||
|
||||
export function updateToSchemaVersion1380(
|
||||
currentVersion: number,
|
||||
db: WritableDB,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
if (currentVersion >= 1380) {
|
||||
return;
|
||||
}
|
||||
|
||||
db.transaction(() => {
|
||||
db.exec(`
|
||||
CREATE TABLE donationReceipts(
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
currencyType TEXT NOT NULL,
|
||||
paymentAmount INTEGER NOT NULL,
|
||||
paymentDetailJson TEXT NOT NULL,
|
||||
paymentType TEXT NOT NULL,
|
||||
timestamp INTEGER NOT NULL
|
||||
) STRICT;
|
||||
|
||||
CREATE INDEX donationReceipts_byTimestamp on donationReceipts(timestamp);
|
||||
`);
|
||||
db.pragma('user_version = 1380');
|
||||
})();
|
||||
|
||||
logger.info('updateToSchemaVersion1380: success!');
|
||||
}
|
||||
@@ -112,10 +112,11 @@ import { updateToSchemaVersion1330 } from './1330-sync-tasks-type-index';
|
||||
import { updateToSchemaVersion1340 } from './1340-recent-gifs';
|
||||
import { updateToSchemaVersion1350 } from './1350-notification-profiles';
|
||||
import { updateToSchemaVersion1360 } from './1360-attachments';
|
||||
import { updateToSchemaVersion1370 } from './1370-message-attachment-indexes';
|
||||
import {
|
||||
updateToSchemaVersion1370,
|
||||
updateToSchemaVersion1380,
|
||||
version as MAX_VERSION,
|
||||
} from './1370-message-attachment-indexes';
|
||||
} from './1380-donation-receipts';
|
||||
|
||||
import { DataWriter } from '../Server';
|
||||
|
||||
@@ -2106,6 +2107,7 @@ export const SCHEMA_VERSIONS = [
|
||||
updateToSchemaVersion1350,
|
||||
updateToSchemaVersion1360,
|
||||
updateToSchemaVersion1370,
|
||||
updateToSchemaVersion1380,
|
||||
];
|
||||
|
||||
export class DBVersionFromFutureError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user