From 97f2e3f94f64eb59241f7f1347eb97231005a641 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 16 Apr 2021 16:27:14 +0100 Subject: [PATCH] Wire in delta for Postgres --- .../deltas/20210416150927_state_blocks_refactor.go | 14 ++++++++------ roomserver/storage/postgres/storage.go | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go b/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go index 4aa3be5a..f256dfa5 100644 --- a/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go +++ b/roomserver/storage/postgres/deltas/20210416150927_state_blocks_refactor.go @@ -130,12 +130,14 @@ func UpStateBlocksRefactor(tx *sql.Tx) error { } } - if _, err = tx.Exec(`DROP TABLE _roomserver_state_snapshots;`); err != nil { - return fmt.Errorf("tx.Exec (delete old snapshot table): %w", err) - } - if _, err = tx.Exec(`DROP TABLE _roomserver_state_block;`); err != nil { - return fmt.Errorf("tx.Exec (delete old block table): %w", err) - } + /* + if _, err = tx.Exec(`DROP TABLE _roomserver_state_snapshots;`); err != nil { + return fmt.Errorf("tx.Exec (delete old snapshot table): %w", err) + } + if _, err = tx.Exec(`DROP TABLE _roomserver_state_block;`); err != nil { + return fmt.Errorf("tx.Exec (delete old block table): %w", err) + } + */ return nil } diff --git a/roomserver/storage/postgres/storage.go b/roomserver/storage/postgres/storage.go index bb3f841d..b9b205b8 100644 --- a/roomserver/storage/postgres/storage.go +++ b/roomserver/storage/postgres/storage.go @@ -50,6 +50,7 @@ func Open(dbProperties *config.DatabaseOptions, cache caching.RoomServerCaches) } m := sqlutil.NewMigrations() deltas.LoadAddForgottenColumn(m) + deltas.LoadStateBlocksRefactor(m) if err := m.RunDeltas(db, dbProperties); err != nil { return nil, err }