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

* [chore] Move local account settings to separate database model

* don't use separate settings_id
This commit is contained in:
tobi
2024-03-22 14:03:46 +01:00
committed by GitHub
parent 0767647056
commit 7f4a0a1aeb
36 changed files with 525 additions and 191 deletions

View File

@ -126,9 +126,15 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateWithMention() {
}
func (suite *AccountUpdateTestSuite) TestAccountUpdateWithMarkdownNote() {
// Copy zork.
testAccount := &gtsmodel.Account{}
*testAccount = *suite.testAccounts["local_account_1"]
// Copy zork's settings.
settings := &gtsmodel.AccountSettings{}
*settings = *suite.testAccounts["local_account_1"].Settings
testAccount.Settings = settings
var (
ctx = context.Background()
note = "*hello* ~~here~~ i am!"
@ -136,8 +142,8 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateWithMarkdownNote() {
)
// Set status content type of account 1 to markdown for this test.
testAccount.StatusContentType = "text/markdown"
if err := suite.db.UpdateAccount(ctx, testAccount, "status_content_type"); err != nil {
testAccount.Settings.StatusContentType = "text/markdown"
if err := suite.db.UpdateAccountSettings(ctx, testAccount.Settings, "status_content_type"); err != nil {
suite.FailNow(err.Error())
}