|
@ -11,7 +11,8 @@ import {SystemRepo} from './entities/System'; |
|
|
import {UserRepo} from './entities/User'; |
|
|
import {UserRepo} from './entities/User'; |
|
|
|
|
|
|
|
|
//Migrations
|
|
|
//Migrations
|
|
|
import * as Migrations from './migrations/Migrations'; |
|
|
import { migratev0 } from "./migrations/MigrateV0"; |
|
|
|
|
|
import { migratev1 } from "./migrations/MigrateV1"; |
|
|
|
|
|
|
|
|
//keys
|
|
|
//keys
|
|
|
import {generateKey} from '../libs/Random'; |
|
|
import {generateKey} from '../libs/Random'; |
|
@ -45,8 +46,8 @@ export async function initDB(){ |
|
|
|
|
|
|
|
|
if (dbRef === null){ |
|
|
if (dbRef === null){ |
|
|
let schemaList = [ |
|
|
let schemaList = [ |
|
|
{schemaVersion: 0, schema: [System, User, Score], migration: Migrations.migratev0, encryptionKey: dbKey}, |
|
|
{schemaVersion: 0, schema: [System, User, Score], migration: migratev0, encryptionKey: dbKey}, |
|
|
{schemaVersion: 1, schema: [System, User, Score], migration: Migrations.migratev1, encryptionKey: dbKey} |
|
|
{schemaVersion: 1, schema: [System, User, Score], migration: migratev1, encryptionKey: dbKey} |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
let currentSchema = Realm.schemaVersion(Realm.defaultPath, dbKey); |
|
|
let currentSchema = Realm.schemaVersion(Realm.defaultPath, dbKey); |
|
|