mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Notification Profiles: Normalize ids
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { LoggerType } from '../../types/Logging.std.js';
|
||||
import type { WritableDB } from '../Interface.std.js';
|
||||
import { sql } from '../util.std.js';
|
||||
|
||||
export default function updateToSchemaVersion1490(
|
||||
db: WritableDB,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
const [query, params] = sql`
|
||||
DELETE FROM notificationProfiles
|
||||
WHERE id != lower(id);
|
||||
`;
|
||||
const result = db.prepare(query).run(params);
|
||||
|
||||
logger.info(
|
||||
`Removed ${result.changes} notification profiles with non-lowercase ids`
|
||||
);
|
||||
}
|
||||
@@ -124,6 +124,7 @@ import updateToSchemaVersion1450 from './1450-all-media.std.js';
|
||||
import updateToSchemaVersion1460 from './1460-attachment-duration.std.js';
|
||||
import updateToSchemaVersion1470 from './1470-kyber-triple.std.js';
|
||||
import updateToSchemaVersion1480 from './1480-chat-folders-remove-duplicates.std.js';
|
||||
import updateToSchemaVersion1490 from './1490-lowercase-notification-profiles.std.js';
|
||||
|
||||
import { DataWriter } from '../Server.node.js';
|
||||
|
||||
@@ -1605,6 +1606,7 @@ export const SCHEMA_VERSIONS: ReadonlyArray<SchemaUpdateType> = [
|
||||
{ version: 1460, update: updateToSchemaVersion1460 },
|
||||
{ version: 1470, update: updateToSchemaVersion1470 },
|
||||
{ version: 1480, update: updateToSchemaVersion1480 },
|
||||
{ version: 1490, update: updateToSchemaVersion1490 },
|
||||
];
|
||||
|
||||
export class DBVersionFromFutureError extends Error {
|
||||
|
||||
Reference in New Issue
Block a user