fix: Correctly migrate to database v11 by adding a revision date

This commit is contained in:
Artem Chepurnoy 2024-06-26 17:19:48 +03:00
parent 1c916ffacc
commit ad4a94cddd
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
1 changed files with 1 additions and 2 deletions

View File

@ -155,7 +155,7 @@ class DatabaseManagerImpl(
sql = "SELECT data FROM cipher", sql = "SELECT data FROM cipher",
mapper = { cursor -> mapper = { cursor ->
val ciphers = sequence<BitwardenCipher> { val ciphers = sequence<BitwardenCipher> {
while (!cursor.next().value) { while (cursor.next().value) {
val cipher = kotlin.run { val cipher = kotlin.run {
val data = cursor.getString(0)!! val data = cursor.getString(0)!!
bitwardenCipherToStringAdapter.decode(data) bitwardenCipherToStringAdapter.decode(data)
@ -168,7 +168,6 @@ class DatabaseManagerImpl(
parameters = 0, parameters = 0,
).value ).value
ciphers.forEach { cipher -> ciphers.forEach { cipher ->
println("migrated = ${cipher.cipherId}")
val sql = "UPDATE cipher SET updatedAt = ? WHERE cipherId = ?" val sql = "UPDATE cipher SET updatedAt = ? WHERE cipherId = ?"
driver.execute( driver.execute(
identifier = null, identifier = null,