gitea源码

12345678910111213141516171819
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_23
  4. import "xorm.io/xorm"
  5. // AddSkipSeconderyAuthToOAuth2ApplicationTable: add SkipSecondaryAuthorization column, setting existing rows to false
  6. func AddSkipSecondaryAuthColumnToOAuth2ApplicationTable(x *xorm.Engine) error {
  7. type oauth2Application struct {
  8. SkipSecondaryAuthorization bool `xorm:"NOT NULL DEFAULT FALSE"`
  9. }
  10. _, err := x.SyncWithOptions(xorm.SyncOptions{
  11. IgnoreConstrains: true,
  12. IgnoreIndices: true,
  13. }, new(oauth2Application))
  14. return err
  15. }