Wire in delta for Postgres

This commit is contained in:
Neil Alexander 2021-04-16 16:27:14 +01:00
parent 8d4d28fedc
commit 97f2e3f94f
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 9 additions and 6 deletions

View file

@ -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
}

View file

@ -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
}