aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/postgres/syncserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/storage/postgres/syncserver.go')
-rw-r--r--syncapi/storage/postgres/syncserver.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go
index a77c0ec0..60d67ac0 100644
--- a/syncapi/storage/postgres/syncserver.go
+++ b/syncapi/storage/postgres/syncserver.go
@@ -23,6 +23,7 @@ import (
"github.com/matrix-org/dendrite/eduserver/cache"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/setup/config"
+ "github.com/matrix-org/dendrite/syncapi/storage/postgres/deltas"
"github.com/matrix-org/dendrite/syncapi/storage/shared"
)
@@ -36,6 +37,7 @@ type SyncServerDatasource struct {
}
// NewDatabase creates a new sync server database
+// nolint:gocyclo
func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) {
var d SyncServerDatasource
var err error
@@ -86,6 +88,11 @@ func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, e
if err != nil {
return nil, err
}
+ m := sqlutil.NewMigrations()
+ deltas.LoadFixSequences(m)
+ if err = m.RunDeltas(d.db, dbProperties); err != nil {
+ return nil, err
+ }
d.Database = shared.Database{
DB: d.db,
Writer: d.writer,