Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Move local account settings to separate db table #2770

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

tsmethurst
Copy link
Contributor

@tsmethurst tsmethurst commented Mar 19, 2024

Description

If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.

If this is a documentation change, please briefly describe what you've changed and why.

This pull request migrates account settings for local accounts to a separate table, and adds functionality for selecting + updating those settings.

The reasoning for this: we were storing more and more columns for accounts which would never be used except for local accounts, which widens the accounts table pointlessly. By moving settings for local accounts to another table, we can expand the amount of settings available to users without having to worry about mashing more unused settings into the main accounts table.

Migration tested with a local postgres and a local sqlite, seems OK on both.

Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: [ ] -> [x]

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

Copy link
Member

@daenney daenney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. With the exception of the storing the settings separately, the rest of the code is updating how settings are fetched etc. Changes to the tests make sense in light of that.

@tsmethurst tsmethurst merged commit 7f4a0a1 into main Mar 22, 2024
3 checks passed
@tsmethurst tsmethurst deleted the account_settings branch March 22, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants