Fix room topic length (#108)
This commit is contained in:
parent
bb1d28c755
commit
0fba1db6aa
16
database/upgrades/2019-11-12-fix-room-topic-length.go
Normal file
16
database/upgrades/2019-11-12-fix-room-topic-length.go
Normal 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
|
||||||
|
}}
|
||||||
|
}
|
@ -28,7 +28,7 @@ type upgrade struct {
|
|||||||
fn upgradeFunc
|
fn upgradeFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
const NumberOfUpgrades = 11
|
const NumberOfUpgrades = 12
|
||||||
|
|
||||||
var upgrades [NumberOfUpgrades]upgrade
|
var upgrades [NumberOfUpgrades]upgrade
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user