mautrix-whatsapp/database/upgrades/2019-11-12-fix-room-topic-length.go
2019-11-17 21:10:02 +02:00

16 lines
414 B
Go

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