Fix room topic length (#108)

This commit is contained in:
IndeedNotJames 2019-11-17 20:10:02 +01:00 committed by Tulir Asokan
parent bb1d28c755
commit 0fba1db6aa
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,16 @@
package upgrades
import (
"database/sql"
)
func init() {
upgrades[11] = upgrade{"Adjust the length of column topic in portal", func(tx *sql.Tx, ctx context) error {
if ctx.dialect == SQLite {
// SQLite doesn't support constraint updates, but it isn't that careful with constraints anyway.
return nil
}
_, err := tx.Exec(`ALTER TABLE portal ALTER COLUMN topic TYPE VARCHAR(512)`)
return err
}}
}

View file

@ -28,7 +28,7 @@ type upgrade struct {
fn upgradeFunc
}
const NumberOfUpgrades = 11
const NumberOfUpgrades = 12
var upgrades [NumberOfUpgrades]upgrade