Added User.clientData (even though not used yet but to not have to change db schema afterwards)
This commit is contained in:
parent
f5bd69868e
commit
8f774361e9
|
@ -30,7 +30,7 @@ open class SqliteBankingRepository(
|
|||
val tanMethods = getAllTanMethods().groupBy { it.userId }
|
||||
val tanMedia = getAllTanMedia().groupBy { it.userId }
|
||||
|
||||
return userQueries.selectAllUsers { id, bankCode, loginName, password, bankName, bic, customerName, userId, selectedTanMethodIdentifier, selectedTanMediumIdentifier, bankingGroup, serverAddress, userSetDisplayName, displayIndex, iconUrl, wrongCredentialsEntered ->
|
||||
return userQueries.selectAllUsers { id, bankCode, loginName, password, bankName, bic, customerName, userId, selectedTanMethodIdentifier, selectedTanMediumIdentifier, bankingGroup, serverAddress, userSetDisplayName, clientData, displayIndex, iconUrl, wrongCredentialsEntered ->
|
||||
UserEntity(id, bankCode, loginName, password, bankName, bic, customerName, userId, bankAccounts[id] ?: emptyList(), selectedTanMethodIdentifier, tanMethods[id] ?: emptyList(), selectedTanMediumIdentifier, tanMedia[id] ?: emptyList(),
|
||||
bankingGroup?.let { BankingGroup.valueOf(it) }, serverAddress, userSetDisplayName, displayIndex.toInt(), iconUrl, wrongCredentialsEntered)
|
||||
}.executeAsList()
|
||||
|
@ -40,7 +40,7 @@ open class SqliteBankingRepository(
|
|||
return userQueries.transactionWithResult {
|
||||
userQueries.insertUser(user.bankCode, user.loginName, user.password, user.bankName, user.bic,
|
||||
user.customerName, user.userId, user.selectedTanMethodIdentifier, user.selectedTanMediumIdentifier,
|
||||
user.bankingGroup?.name, user.serverAddress, user.userSetDisplayName, user.displayIndex.toLong(), user.iconUrl, user.wrongCredentialsEntered
|
||||
user.bankingGroup?.name, user.serverAddress, null, user.userSetDisplayName, user.displayIndex.toLong(), user.iconUrl, user.wrongCredentialsEntered
|
||||
)
|
||||
|
||||
val userId = getLastInsertedId() // getLastInsertedId() / last_insert_rowid() has to be called in a transaction with the insert operation, otherwise it will not work
|
||||
|
|
|
@ -20,6 +20,8 @@ CREATE TABLE IF NOT EXISTS User (
|
|||
bankingGroup TEXT,
|
||||
serverAddress TEXT,
|
||||
|
||||
clientData TEXT,
|
||||
|
||||
userSetDisplayName TEXT,
|
||||
displayIndex INTEGER NOT NULL,
|
||||
|
||||
|
@ -44,6 +46,8 @@ INSERT INTO User(
|
|||
bankingGroup,
|
||||
serverAddress,
|
||||
|
||||
clientData,
|
||||
|
||||
userSetDisplayName, displayIndex,
|
||||
|
||||
iconUrl,
|
||||
|
@ -58,8 +62,13 @@ VALUES(
|
|||
?,
|
||||
|
||||
?, ?,
|
||||
|
||||
?,
|
||||
|
||||
?, ?,
|
||||
?, ?
|
||||
|
||||
?,
|
||||
?
|
||||
);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue