2019-11-12-fix-room-topic-length.go 414 B

12345678910111213141516
  1. package upgrades
  2. import (
  3. "database/sql"
  4. )
  5. func init() {
  6. upgrades[11] = upgrade{"Adjust the length of column topic in portal", func(tx *sql.Tx, ctx context) error {
  7. if ctx.dialect == SQLite {
  8. // SQLite doesn't support constraint updates, but it isn't that careful with constraints anyway.
  9. return nil
  10. }
  11. _, err := tx.Exec(`ALTER TABLE portal ALTER COLUMN topic TYPE VARCHAR(512)`)
  12. return err
  13. }}
  14. }