Add accountId column to Service table - #2837
Open
ArnyminerZ wants to merge 4 commits into
Open
Conversation
accountId column to Service table
ArnyminerZ
force-pushed
the
2820-allow-creating-accounts-into-the-database-service
branch
from
August 20, 2026 10:22
e843598 to
de4ce6d
Compare
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
ArnyminerZ
force-pushed
the
2820-allow-creating-accounts-into-the-database-service
branch
from
August 20, 2026 10:25
de4ce6d to
78050d1
Compare
ArnyminerZ
marked this pull request as ready for review
August 20, 2026 10:27
6 tasks
Contributor
|
I think it would be better to defer this change until all existing accounts are stored in the database and we have gotten rid of In the meantime we should be able to use something like this for reading (untested): @Query("SELECT service.* FROM service LEFT JOIN account ON (service.accountName=account.name) WHERE account.id=:accountId AND service.type=:type")
suspend fun getByAccountIdAndType(accountId: Long, @ServiceType type: String): Service?
suspend fun getByAccountIdAndType(accountId: AccountId, @ServiceType type: String): Service? {
return when (accountId) {
is LegacyAccount -> getByAccountAndType(accountId.androidAccount.name, type)
is DbAccountId -> getByAccountIdAndType(accountId.id, type)
}
} |
Member
|
Yes let's discuss tomorrow how we continue. I think we should create the required tables in a coordinated effort as soon as the decoupling is finished / tested / released / stable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Organizational
Important
Please make sure an issue or discussion for this change exists and was acknowledged by the
core team before submitting. Uncoordinated pull requests may conflict with the project roadmap
and could be closed without merging — which would be a pity.
See CONTRIBUTING.md for details.
(The PR is still welcome otherwise, but could be closed at any time without much attention
when it doesn't fit.)
✨ AI contributions – only check if applicable:
is just referenced/copied into an AI prompt and then the result is submitted as PR.
PRs that are mainly driven by AI often have little worth, as everybody could just copy the issue
into a prompt. The worth of a good PR often comes from the main idea, architectural decisions etc.
behind it. So while all PRs are welcome, such PRs may be reviewed with less human attention and closed
at any time when they don't fit.
Purpose
Currently we use
accountNameas reference for the account inService. But this is external, and as such, doesn't have any foreign key in the table.Short description
accountIdcolumn (nullable), which referencesidofDbAccounttable.Checklist