Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

v45.go 735B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2017 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. "fmt"
  7. "code.gitea.io/gitea/modules/log"
  8. "code.gitea.io/gitea/modules/setting"
  9. "github.com/go-xorm/xorm"
  10. )
  11. func removeIndexColumnFromRepoUnitTable(x *xorm.Engine) (err error) {
  12. switch {
  13. case setting.UseSQLite3:
  14. log.Warn("Unable to drop columns in SQLite")
  15. case setting.UseMySQL, setting.UsePostgreSQL, setting.UseMSSQL, setting.UseTiDB:
  16. if _, err := x.Exec("ALTER TABLE repo_unit DROP COLUMN index"); err != nil {
  17. return fmt.Errorf("DROP COLUMN index: %v", err)
  18. }
  19. default:
  20. log.Fatal(4, "Unrecognized DB")
  21. }
  22. return nil
  23. }