Update mautrix-go

This commit is contained in:
Tulir Asokan
2020-07-10 15:56:45 +03:00
parent 8bacbbac5b
commit f40a91594d
6 changed files with 53 additions and 15 deletions

View File

@ -0,0 +1,13 @@
package upgrades
import (
"database/sql"
"maunium.net/go/mautrix/crypto"
)
func init() {
upgrades[16] = upgrade{"Add account_id to crypto store", func(tx *sql.Tx, c context) error {
return crypto.SQLStoreMigrations[1](tx, c.dialect.String())
}}
}

View File

@ -15,6 +15,17 @@ const (
SQLite
)
func (dialect Dialect) String() string {
switch dialect {
case Postgres:
return "postgres"
case SQLite:
return "sqlite3"
default:
return ""
}
}
type upgradeFunc func(*sql.Tx, context) error
type context struct {
@ -28,7 +39,7 @@ type upgrade struct {
fn upgradeFunc
}
const NumberOfUpgrades = 16
const NumberOfUpgrades = 17
var upgrades [NumberOfUpgrades]upgrade