mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-04 09:33:17 -06:00
fix up tests, add docs
This commit is contained in:
parent
9191e967a7
commit
da8e1cdd78
33 changed files with 497 additions and 170 deletions
|
|
@ -39,7 +39,6 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation/federatingdb"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gotosocial"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oidc"
|
||||
|
|
@ -51,32 +50,6 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/web"
|
||||
)
|
||||
|
||||
var models []interface{} = []interface{}{
|
||||
>smodel.Account{},
|
||||
>smodel.Application{},
|
||||
>smodel.Block{},
|
||||
>smodel.DomainBlock{},
|
||||
>smodel.EmailDomainBlock{},
|
||||
>smodel.Follow{},
|
||||
>smodel.FollowRequest{},
|
||||
>smodel.MediaAttachment{},
|
||||
>smodel.Mention{},
|
||||
>smodel.Status{},
|
||||
>smodel.StatusToEmoji{},
|
||||
>smodel.StatusToTag{},
|
||||
>smodel.StatusFave{},
|
||||
>smodel.StatusBookmark{},
|
||||
>smodel.StatusMute{},
|
||||
>smodel.Tag{},
|
||||
>smodel.User{},
|
||||
>smodel.Emoji{},
|
||||
>smodel.Instance{},
|
||||
>smodel.Notification{},
|
||||
>smodel.RouterSession{},
|
||||
>smodel.Token{},
|
||||
>smodel.Client{},
|
||||
}
|
||||
|
||||
// Start creates and starts a gotosocial server
|
||||
var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log *logrus.Logger) error {
|
||||
dbService, err := bundb.NewBunDBService(ctx, c, log)
|
||||
|
|
@ -84,10 +57,8 @@ var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log
|
|||
return fmt.Errorf("error creating dbservice: %s", err)
|
||||
}
|
||||
|
||||
for _, m := range models {
|
||||
if err := dbService.CreateTable(ctx, m); err != nil {
|
||||
return fmt.Errorf("table creation error: %s", err)
|
||||
}
|
||||
if err := dbService.CreateAllTables(ctx); err != nil {
|
||||
return fmt.Errorf("error creating database tables: %s", err)
|
||||
}
|
||||
|
||||
if err := dbService.CreateInstanceAccount(ctx); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue