mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 16:42:25 -05:00
[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:
parent
0767647056
commit
7f4a0a1aeb
36 changed files with 525 additions and 191 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
transmodel "github.com/superseriousbusiness/gotosocial/internal/trans/model"
|
||||
)
|
||||
|
|
@ -73,6 +74,14 @@ func (i *importer) inputEntry(ctx context.Context, entry transmodel.Entry) error
|
|||
if err := i.putInDB(ctx, account); err != nil {
|
||||
return fmt.Errorf("inputEntry: error adding account to database: %s", err)
|
||||
}
|
||||
if account.Domain == "" && account.Username != config.GetHost() {
|
||||
// Local, non-instance account.
|
||||
// Insert barebones settings model.
|
||||
settings := &transmodel.AccountSettings{AccountID: account.ID}
|
||||
if err := i.putInDB(ctx, settings); err != nil {
|
||||
return fmt.Errorf("inputEntry: error adding account settings to database: %s", err)
|
||||
}
|
||||
}
|
||||
log.Infof(ctx, "added account with id %s", account.ID)
|
||||
return nil
|
||||
case transmodel.TransBlock:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue