Browse Source

uuid dependency

pull/1/head
Tim Glasgow 2 years ago
parent
commit
018270543a
  1. 5
      squarenotsquare/realm/migrations/Migrations.js
  2. 3
      squarenotsquare/realm/repos/ScoreRepo.js
  3. 5
      squarenotsquare/realm/repos/SystemRepo.js
  4. 3
      squarenotsquare/realm/repos/UserRepo.js

5
squarenotsquare/realm/migrations/Migrations.js

@ -1,5 +1,6 @@
import {System} from '../entities/System';
import uuid from 'uuid';
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
export function migratev0(oldRealm, newRealm) {
//start with empty db
@ -8,7 +9,7 @@ export function migratev0(oldRealm, newRealm) {
export function migratev1(oldRealm, newRealm) {
if (oldRealm.schemaVersion === 0) {
newRealm.create(System.name, {
id: uuid.v4(),
id: uuidv4(),
key: 'username',
value: 'changeme'
});

3
squarenotsquare/realm/repos/ScoreRepo.js

@ -1,5 +1,6 @@
import {Score} from '../entities/Score';
import uuid from 'uuid';
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
export default class ScoreRepo {
realmDB = null;

5
squarenotsquare/realm/repos/SystemRepo.js

@ -1,5 +1,6 @@
import {System} from '../entities/System';
import uuid from 'uuid';
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
export default class SystemRepo {
realmDB = null;
@ -25,7 +26,7 @@ export default class SystemRepo {
let existing = this.getSystemKeyValue(key);
if (existing.id === null) {
sysID = uuid.v4();
sysID = uuidv4();
} else {
sysID = existing.id;
}

3
squarenotsquare/realm/repos/UserRepo.js

@ -1,5 +1,6 @@
import {User} from '../entities/User';
import uuid from 'uuid';
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
export default class UserRepo {
realmDB = null;

Loading…
Cancel
Save