Simplify database migrations
This commit is contained in:
parent
46d5b06bfc
commit
e6809c95db
106 changed files with 4661 additions and 6814 deletions
|
@ -3,29 +3,13 @@
|
|||
|
||||
import type { Database } from '@signalapp/sqlcipher';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging';
|
||||
|
||||
export default function updateToSchemaVersion68(
|
||||
currentVersion: number,
|
||||
db: Database,
|
||||
logger: LoggerType
|
||||
): void {
|
||||
if (currentVersion >= 68) {
|
||||
return;
|
||||
}
|
||||
|
||||
db.transaction(() => {
|
||||
db.exec(
|
||||
`
|
||||
ALTER TABLE messages
|
||||
DROP COLUMN deprecatedSourceDevice;
|
||||
ALTER TABLE unprocessed
|
||||
DROP COLUMN deprecatedSourceDevice;
|
||||
`
|
||||
);
|
||||
|
||||
db.pragma('user_version = 68');
|
||||
})();
|
||||
|
||||
logger.info('updateToSchemaVersion68: success!');
|
||||
export default function updateToSchemaVersion68(db: Database): void {
|
||||
db.exec(
|
||||
`
|
||||
ALTER TABLE messages
|
||||
DROP COLUMN deprecatedSourceDevice;
|
||||
ALTER TABLE unprocessed
|
||||
DROP COLUMN deprecatedSourceDevice;
|
||||
`
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue