mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02: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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user