You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v110.go 918B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import (
  6. "xorm.io/core"
  7. "xorm.io/xorm"
  8. )
  9. func changeReviewContentToText(x *xorm.Engine) error {
  10. if x.Dialect().DBType() == core.MYSQL {
  11. _, err := x.Exec("ALTER TABLE review MODIFY COLUMN content TEXT")
  12. return err
  13. }
  14. if x.Dialect().DBType() == core.ORACLE {
  15. _, err := x.Exec("ALTER TABLE review MODIFY content TEXT")
  16. return err
  17. }
  18. if x.Dialect().DBType() == core.MSSQL {
  19. _, err := x.Exec("ALTER TABLE review ALTER COLUMN content TEXT")
  20. return err
  21. }
  22. if x.Dialect().DBType() == core.POSTGRES {
  23. _, err := x.Exec("ALTER TABLE review ALTER COLUMN content TYPE TEXT")
  24. return err
  25. }
  26. // SQLite doesn't support ALTER COLUMN, and it seem to already make String to _TEXT_ default so no migration needed
  27. return nil
  28. }