Fix DB queries

This commit is contained in:
vishnukvmd 2022-11-01 15:21:53 +05:30
parent b556204921
commit 1b2e677abe

View file

@ -40,16 +40,16 @@ class AuthenticatorDB {
await db.execute(
'''
CREATE TABLE $entityTable (
_generatedID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
id TEXT,
encryptedData TEXT NOT NULL,
header TEXT NOT NULL,
createdAt INTEGER NOT NULL,
updatedAt INTEGER NOT NULL,
shouldSync INTERGER DEFAULT 0
_generatedID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
id TEXT,
encryptedData TEXT NOT NULL,
header TEXT NOT NULL,
createdAt INTEGER NOT NULL,
updatedAt INTEGER NOT NULL,
shouldSync INTEGER DEFAULT 0,
UNIQUE(id)
);
CREATE UNIQUE INDEX entity_id on $entityTable (id);
''',
''',
);
}
@ -111,6 +111,8 @@ class AuthenticatorDB {
await db.update(
entityTable,
localAuthEntity.toMap(),
where: '_generatedID = ?',
whereArgs: [localAuthEntity.generatedID],
conflictAlgorithm: ConflictAlgorithm.replace,
);
}