2020-10-17 20:56:54 +02:00
|
|
|
import {db, privateDB} from '../../src/databases/databases';
|
|
|
|
|
|
|
|
describe('dbUpgrade', () => {
|
2021-03-02 03:37:35 +01:00
|
|
|
it('Should update the database version when starting the application', async () => {
|
2021-07-04 07:34:31 +02:00
|
|
|
const dbVersion = (await db.prepare('get', 'SELECT key, value FROM config where key = ?', ['version'])).value;
|
|
|
|
const privateVersion = (await privateDB.prepare('get', 'SELECT key, value FROM config where key = ?', ['version'])).value;
|
2021-03-02 03:37:35 +01:00
|
|
|
if (dbVersion >= 1 && privateVersion >= 1) return;
|
|
|
|
else return 'Versions are not at least 1. db is ' + dbVersion + ', private is ' + privateVersion;
|
2020-10-17 20:56:54 +02:00
|
|
|
});
|
|
|
|
});
|