Simplify database migrations
This commit is contained in:
parent
46d5b06bfc
commit
e6809c95db
106 changed files with 4661 additions and 6814 deletions
|
|
@ -3,27 +3,11 @@
|
|||
|
||||
import type { Database } from '@signalapp/sqlcipher';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
|
||||
export default function updateToSchemaVersion70(
|
||||
currentVersion: number,
|
||||
db: Database,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
if (currentVersion >= 70) {
|
||||
return;
|
||||
}
|
||||
|
||||
db.transaction(() => {
|
||||
// Used in `getAllStories`.
|
||||
db.exec(
|
||||
`
|
||||
CREATE INDEX messages_by_storyId ON messages (storyId);
|
||||
`
|
||||
);
|
||||
|
||||
db.pragma('user_version = 70');
|
||||
})();
|
||||
|
||||
logger.info('updateToSchemaVersion70: success!');
|
||||
export default function updateToSchemaVersion70(db: Database): void {
|
||||
// Used in `getAllStories`.
|
||||
db.exec(
|
||||
`
|
||||
CREATE INDEX messages_by_storyId ON messages (storyId);
|
||||
`
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue