summaryrefslogtreecommitdiff
path: root/internal/gotosocial
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-09 11:25:13 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-09 11:25:13 +0200
commit0cbab627c77002711029527f4697fc7ec6cd870d (patch)
tree8d730be593e60489d4e3b3131c1c5feb6ce64452 /internal/gotosocial
parentstatus boosts (#16) (diff)
downloadgotosocial-0cbab627c77002711029527f4697fc7ec6cd870d.tar.xz
Letsencrypt (#17)
Diffstat (limited to 'internal/gotosocial')
-rw-r--r--internal/gotosocial/actions.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/internal/gotosocial/actions.go b/internal/gotosocial/actions.go
index 8d3142f84..0cdb29de5 100644
--- a/internal/gotosocial/actions.go
+++ b/internal/gotosocial/actions.go
@@ -40,6 +40,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/federation"
+ "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/media"
"github.com/superseriousbusiness/gotosocial/internal/message"
"github.com/superseriousbusiness/gotosocial/internal/oauth"
@@ -49,6 +50,28 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
)
+var models []interface{} = []interface{}{
+ &gtsmodel.Account{},
+ &gtsmodel.Application{},
+ &gtsmodel.Block{},
+ &gtsmodel.DomainBlock{},
+ &gtsmodel.EmailDomainBlock{},
+ &gtsmodel.Follow{},
+ &gtsmodel.FollowRequest{},
+ &gtsmodel.MediaAttachment{},
+ &gtsmodel.Mention{},
+ &gtsmodel.Status{},
+ &gtsmodel.StatusFave{},
+ &gtsmodel.StatusBookmark{},
+ &gtsmodel.StatusMute{},
+ &gtsmodel.StatusPin{},
+ &gtsmodel.Tag{},
+ &gtsmodel.User{},
+ &gtsmodel.Emoji{},
+ &oauth.Token{},
+ &oauth.Client{},
+}
+
// Run creates and starts a gotosocial server
var Run action.GTSAction = func(ctx context.Context, c *config.Config, log *logrus.Logger) error {
dbService, err := db.NewPostgresService(ctx, c, log)
@@ -109,6 +132,12 @@ var Run action.GTSAction = func(ctx context.Context, c *config.Config, log *logr
}
}
+ for _, m := range models {
+ if err := dbService.CreateTable(m); err != nil {
+ return fmt.Errorf("table creation error: %s", err)
+ }
+ }
+
if err := dbService.CreateInstanceAccount(); err != nil {
return fmt.Errorf("error creating instance account: %s", err)
}