create unique index for contact prekeys (to allow using REPLACE)

pull/46/head
sachaaaaa 7 years ago
parent 78d39ac177
commit 1bd7c5d862

@ -447,6 +447,11 @@ async function updateToSchemaVersion6(currentVersion, instance) {
);`
);
await instance.run(`CREATE UNIQUE INDEX contact_prekey_identity_key_string_keyid ON contactPreKeys (
identityKeyString,
keyId
);`);
await instance.run(
`CREATE TABLE contactSignedPreKeys(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@ -456,6 +461,11 @@ async function updateToSchemaVersion6(currentVersion, instance) {
);`
);
await instance.run(`CREATE UNIQUE INDEX contact_signed_prekey_identity_key_string_keyid ON contactSignedPreKeys (
identityKeyString,
keyId
);`);
await instance.run('PRAGMA schema_version = 6;');
await instance.run('COMMIT TRANSACTION;');
console.log('updateToSchemaVersion6: success!');

Loading…
Cancel
Save