Fix DB queries
This commit is contained in:
parent
b556204921
commit
1b2e677abe
1 changed files with 11 additions and 9 deletions
|
@ -40,16 +40,16 @@ class AuthenticatorDB {
|
||||||
await db.execute(
|
await db.execute(
|
||||||
'''
|
'''
|
||||||
CREATE TABLE $entityTable (
|
CREATE TABLE $entityTable (
|
||||||
_generatedID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
_generatedID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||||
id TEXT,
|
id TEXT,
|
||||||
encryptedData TEXT NOT NULL,
|
encryptedData TEXT NOT NULL,
|
||||||
header TEXT NOT NULL,
|
header TEXT NOT NULL,
|
||||||
createdAt INTEGER NOT NULL,
|
createdAt INTEGER NOT NULL,
|
||||||
updatedAt INTEGER NOT NULL,
|
updatedAt INTEGER NOT NULL,
|
||||||
shouldSync INTERGER DEFAULT 0
|
shouldSync INTEGER DEFAULT 0,
|
||||||
|
UNIQUE(id)
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX entity_id on $entityTable (id);
|
''',
|
||||||
''',
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,8 @@ class AuthenticatorDB {
|
||||||
await db.update(
|
await db.update(
|
||||||
entityTable,
|
entityTable,
|
||||||
localAuthEntity.toMap(),
|
localAuthEntity.toMap(),
|
||||||
|
where: '_generatedID = ?',
|
||||||
|
whereArgs: [localAuthEntity.generatedID],
|
||||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue