move to ulid

This commit is contained in:
tsmethurst 2021-06-11 18:38:58 +02:00
commit 26ee190338
51 changed files with 398 additions and 514 deletions

View file

@ -75,6 +75,20 @@ 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(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)
}
if err := dbService.CreateInstanceInstance(); err != nil {
return fmt.Errorf("error creating instance instance: %s", err)
}
federatingDB := federatingdb.New(dbService, c, log)
router, err := router.New(c, log)
@ -151,20 +165,6 @@ var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log
}
}
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)
}
if err := dbService.CreateInstanceInstance(); err != nil {
return fmt.Errorf("error creating instance instance: %s", err)
}
gts, err := gotosocial.NewServer(dbService, router, federator, c)
if err != nil {
return fmt.Errorf("error creating gotosocial service: %s", err)