Add option to set private chat portal rooms' name/avatar explicitly

This commit is contained in:
Tulir Asokan
2019-06-01 20:03:29 +03:00
parent 9fa0ad923d
commit e124641107
8 changed files with 158 additions and 51 deletions

View File

@ -0,0 +1,19 @@
package upgrades
import (
"database/sql"
)
func init() {
upgrades[7] = upgrade{"Add columns to store avatar MXC URIs", func(dialect Dialect, tx *sql.Tx, db *sql.DB) error {
_, err := tx.Exec(`ALTER TABLE puppet ADD COLUMN avatar_url VARCHAR(255)`)
if err != nil {
return err
}
_, err = tx.Exec(`ALTER TABLE portal ADD COLUMN avatar_url VARCHAR(255)`)
if err != nil {
return err
}
return nil
}}
}

View File

@ -22,7 +22,7 @@ type upgrade struct {
fn upgradeFunc
}
const NumberOfUpgrades = 7
const NumberOfUpgrades = 8
var upgrades [NumberOfUpgrades]upgrade