mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Rename files
This commit is contained in:
28
ts/sql/migrations/77-signal-tokenizer.std.ts
Normal file
28
ts/sql/migrations/77-signal-tokenizer.std.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { Database } from '@signalapp/sqlcipher';
|
||||
|
||||
export default function updateToSchemaVersion77(db: Database): void {
|
||||
db.exec(
|
||||
`
|
||||
-- Create FTS table with custom tokenizer from
|
||||
-- @signalapp/sqlcipher.
|
||||
|
||||
DROP TABLE messages_fts;
|
||||
|
||||
CREATE VIRTUAL TABLE messages_fts USING fts5(
|
||||
body,
|
||||
tokenize = 'signal_tokenizer'
|
||||
);
|
||||
|
||||
-- Reindex messages
|
||||
-- Based on messages_on_insert trigger from migrations/45-stories.ts
|
||||
|
||||
INSERT INTO messages_fts (rowid, body)
|
||||
SELECT rowid, body
|
||||
FROM messages
|
||||
WHERE isViewOnce IS NOT 1 AND storyId IS NULL;
|
||||
`
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user