mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 18:05:19 +02:00
[v11.0/forgejo] chore(cleanup): suppress non actionable XORM warnings (#8022)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8021 The following will trigger a XORM warning: ``` type Repository struct { ID int64 `xorm:"pk autoincr"` Topics []string `xorm:"TEXT JSON NOT NULL"` } ``` that looks like: ``` [W] Table repository Column topics db default is '', struct default is ``` it cannot be resolved because: - SQLite requires a default when there is a NOT NULL - MySQL forbids a default for TEXT Co-authored-by: Earl Warren <contact@earl-warren.org> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8022 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
parent
dc0d4fb3ad
commit
ff4f2bcf07
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@ func (l *XORMLogBridge) Warn(v ...any) {
|
|||
|
||||
// Warnf show warning log
|
||||
func (l *XORMLogBridge) Warnf(format string, v ...any) {
|
||||
if format == "Table %s Column %s db default is %s, struct default is %s" || format == "Table %s Column %s db nullable is %v, struct nullable is %v" {
|
||||
return
|
||||
}
|
||||
l.Log(stackLevel, log.WARN, format, v...)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue